How can i implement the event-dependent sequential operation of devices?

I am trying to develop a code to automate the valve operations of a gas plumbing system. for example, i would like to select "leak test" from an enumerated list and then have the system open some valves (digital output), wait for user confirmation, open more valves, activate compressor, wait for certain pressure (analog input), close certain valves, continue compressing untill certain pressure, stop compressing, wait 60 minutes while logging pressure readings. That is basically what i'm trying to implement. i am stuck on how to carry this out. i already have somewhat of a state machine built, my trouble is with the structure of how to build the sequence. I know this is probably vague, i'll answer any questions anyone has. Thank you very much.
Brian

Take a look at a Queued State Machine.  Here you build a list of the order of steps to take.  It could either an array where at the end of each step, it picks off the next item on the array.  Or it could actually be a queue.   The next state to operate gets picked off the queue.  You would preload the queue with all of your desired steps.  On each iteration, it would dequeue the next state to do.  In the cases where you need to repeat a step (such as continually doing a step until a condition as been met) you would re-enqueue the same step at the front of the queue.

Similar Messages

  • How can I get the events from a java program?

    I want to make a monitor to watch a java program.How can I get the events from the GUI of this program some as mouse cliking, keyinput. So I can watch these in my monitor.
    Thanks

    Hi,
    To put a monitor to the events occuring in the GHUI u need to register required components with the appropriate EventListeners.
    Liek if u want to get notified when a mouse is clicked, then u need to add The MouseListener to the component which u want to be monitored.
    Say
    myFrame which is the JFrame object which shuld be monitored for the events.
    Then in ur program u have to add following code
    myFrame.addMouseListener( someObectReference );
    Here the someObjectReference should be an instance to a concrete class ..i.e. U write a class like the following
    public class MyMouseListener implements MouseListener {
    // override the followig methods
    public void mouseClicked(MouseEvent me){ sop("MOUSE CLICKED ON THE FRAME");}
    public void mousePressed(MouseEvent me){}
    public void mouseReleased(MouseEvent me){}
    If u dont want to use another class for listening to the events. Then u can make teh current class monitor the events. To do so ur class should implement the appropriate listener and should override the required methods.
    and u should say myFrame.addMouseListenet( this );
    thats it

  • How can I disable the "Events" how can I disable "Faces"

    buona sera
    how can I disable the "Events"
    how can I disable "Faces"
    grazie

    You can not
    Events are one of many views or your photos in your library - as are faces
    YOu can simply ignore both but you can disable them
    LN

  • How can we implement the currency translation in a query definition

    How can we implement the currency translation in a query definition and should it modified for each and every type of currencies

    hi rama krishna
    i think u can not get any translation in Query. this is only for het the report as it is there in tables. if u want to write a report take a help of the Abaper
    hope u goit,assign points if u ok for this
    thanks
    subbu

  • How can I implement the connection pool in my java stored procedure

    my java stored procedures (in database 'B') have to connect to another oracle database ,let's say 'A'. And how can I implement the behavior like the so-called connection pool in my java stored procedure in 'B', as below.
    1. database B, has 2 java stored procedures sp1 and sp2
    2. both sp1 and sp2 connects to databse 'A'
    whatever I call the sp1 and sp2 and the database 'A' always only one connected session from sp1 and sp2 in database 'B'.
    THANKS A LOTS...

    my problem is I have a lots of java stored procedures need to cnnect to the remote oracle db, and I hope the remote db can only have a connected session from my java stored procedures in my local db. I try as below
    class sp{
    static Connection conn=null; //the remote db connection,
    public static void sp1(){...}//procedure 1, using conn
    public static void sp2(){...}//procedure 2, using conn,too
    I can 'see' the 'conn' variable if I invoke the sp1() and sp2() from the same client application(maybe sqlplus). But if I invoke the sp1() from client 'A' and invoke sp2() from client 'B' then the sp1() and sp2() can not see the 'conn' variable for each other. I think it's because the two clients cause oracle to create two instances of the class 'sp' and the sp1() and sp2() located in different instance seperately. Thus the sp1() and sp2() can not see 'conn' for each other. They can only see its own 'conn'.
    To connect to the remote db from the java stored procedure is easy but is it possible to connect to the remote db via database link from the java stored procedure at my local db ? If so, then I also archive my goal .
    BTW , thanks a lots...
    andrew :-)

  • How can I hide the events in a delegate calendar

    Hi,
    My boss is asking me how can we hide the event information in the delegates, in order that the delegates can see that he is busy but not to know in what he is busy?

    There was earlier a thread on column level secuirty in 11g. PFB the link. See if it helps.
    Column level security does not seem to work in OBIEE11g
    Also, in 10g for column level security we had used choose statement. Am not sure if same can be used in 11g. PFB link for getting information on choose statement.
    http://obiee101.blogspot.com/2008/09/obiee-choose-statement.html

  • How can we trace the event

    Hello Expert,
    We have a lot of process chain which was trigger by one event with different variant. However, since the last two days, the process chain did not run. it seems the event was not triggered.
    How can we trace the event? I mean, if it is triggered or not within one day.
    As I checked the process chain, some of the process chain was successfully triggered by the same event. it is really weird...
    Thanks
    XY
    Edited by: xy chen on Nov 6, 2008 3:24 AM
    Edited by: xy chen on Nov 6, 2008 3:30 AM

    Hi......
    Copy the event...........then go to SE16 >> RSEVENTHEAD............there in the event field give the event name.........then execute............from there you will get the event collector name................
    If you don't get it here then search in table RSEVENTCHAIN.........
    Copy the event and go to RSA1OLD(if you are in 7.0)............otherwise go to RSA1...............from there go to the Event collector........give the event collector name and check whether it registered or not............if registered when last it was registered.............if you are unable to find this event in these two chains............then go SM37................from there choose the event..........and in the Job field write BI_PROCESS_TRIGGER..............from there check when this job last triggered for this event.............
    Hope this helps.........
    Regards,
    Debjani........
    Edited by: Debjani  Mukherjee on Nov 6, 2008 4:44 AM

  • How can we link the Apple iPad or any Apple device to window's based network/server?

    how can we link the Apple iPad or any Apple device to window's based network/server?
    we are software development company !
    how to use apache developed web site from windows pc in aaple i-pad
    and testing that perticuller web site on windows network !
    ipad software version 5.0.1 !
    How We Open developed web site in safari browser from i-pad !

    No ... won't work.
    If this is iPad is a first generation, the iOS should be 5.1.1.

  • Hi how can i implement the scenario.......plz reply asap.........

    HI folks,
    i have a typical problem in bex .
    my scenario is:i am having 2 values say 'x','y'.
    i want to implement a formula like x-y.
    if the x value is negative then i have to get the result as negative after the 'y' value get subtracted.if 'x' is positive, i have to get positive value after subtracting 'y' value.
    please let me know how can i implement this scenario in bex.
    by using a formaula or condition or anything else. please let me know clearly including the expression asap.
    Best reagards,
    ashok.

    answered

  • How can I implement the security ports..?

    How can I use the security ports and SSL through javamail..?
    Can someone tell me what are the necessary things to b done while connecting to "Gmail" through Javamail??....like how to authenticate..etc??
    Edited by: shyamwdr on May 20, 2008 6:21 AM

    Did you read the FAQ?

  • How can I upgrade the 10.4.11 operating system on my Mac pro? have a Mac Pro

    I know my OS is old but it worked perfectly well until I attempted to sync my Iphone 3. How can I upgrade the system so I can use my phone/Ipod?

    Purchase Snow Leopard ($29.)

  • How can I read the filter dependent values in abap class implementation ?

    Hi Experts,
    I need read the filter dependent values in my Z Class implementation but I don´t know how to do it.
    In classic badi was via FT_VAL parameter.
    Now how can I do it ?
    Regars,
    Bala

    Rogerio,
    In case of badis the field flt_val gets added automatically as an import parameter when you check FILTER DEPENDENT check box. This is to restrict which implementation of the badi should be executed, if there are more than one.
    There is no such concept when you are building a class.
    If you want one of your methods to be executed on in certain cases, you need add the required logic within the method.
    If you are referring to the FILTER check box in the pic below, that is used for a different purpose. It is used to filter what is displayed on the class builder screen. F1 on the field to know more about the same.
    Thanks,
    Vikram.M

  • WPF How can I implement the INotifyPropertyChanged in a Three-tier architecture?

    I am a student and I am confused on using the INotifyPropertyChanged in a three-tier style of coding. Can you guys help me a bit with these?
    I have a solution named MetroAppProject. It is composed of four projects (I omitted the using clauses and references, just imagine they are there and are working fine):
    1. MetroApp.BluePrints - a class library composed of the classes in my sql db
    An example of my class
    namespace MetroApp.BluePrints
        public partial class Patient
            public long Id { get; set; }
            public string PatientNumber { get; set; }
            public string LastName { get; set; }
            public string FirstName { get; set; }
            public string MiddleName { get; set; }        
            public string AddressLine1 { get; set; }
            public Nullable<short> CityId { get; set; }
    public string CityName { get; set; }
            public Nullable<short> ProvinceId { get; set; }
    public string ProvinceName { get; set; }        
    Then the second project:
    2. MetroApp.DataAccess = a class library composed of methods that calls my sql procedures. I used the SqlHelper class which contains the connection strings and other stuffs.
    example class
    namespace MetroApp.DataAccess
        public class PatientDb
    public Patient Retrieve(PatientParams parameters)
                SqlCommand command = new SqlCommand();
                Patient singItem = new Patient();
                command.CommandText = "RetrievePatients";
                command.CommandType = CommandType.StoredProcedure;
                command.Parameters.AddWithValue("@Id", parameters.Id).Direction = ParameterDirection.Input;
                DataTable dt = SqlHelper.GetData(command);
                if (dt.Rows.Count > 0)
                    DataRow row = dt.Rows[0];
                    singItem.Id = TDefaultValue.GetInt(row["Id"].ToString());
                    singItem.PatientNumber = TDefaultValue.GetString(row["PatientNumber"].ToString());
                    singItem.LastName = TDefaultValue.GetString(row["LastName"].ToString());
                    singItem.FirstName = TDefaultValue.GetString(row["FirstName"].ToString());
                    singItem.MiddleName = TDefaultValue.GetString(row["MiddleName"].ToString());
                    singItem.AddressLine1 = TDefaultValue.GetString(row["AddressLine1"].ToString());
                    singItem.CityId = TDefaultValue.GetShort(row["CityId"].ToString());
                    singItem.CityName = TDefaultValue.GetString(row["CityName"].ToString());
                    singItem.ProvinceId = TDefaultValue.GetShort(row["ProvinceId"].ToString());
                    singItem.ProvinceName = TDefaultValue.GetString(row["ProvinceName"].ToString());
                return singItem;
            public List<Patient> RetrieveMany(PatientParams parameters)
                var items = new List<Patient>();
                var command = new SqlCommand();
                command.CommandText = "RetrievePatients";
                command.CommandType = CommandType.StoredProcedure;
                command.Parameters.AddWithValue("@Id", parameters.Id).Direction = ParameterDirection.Input;
                command.Parameters.AddWithValue("@PatientNumber", parameters.PatientNumber).Direction = ParameterDirection.Input;
                command.Parameters.AddWithValue("@LastName", parameters.LastName).Direction = ParameterDirection.Input;
                command.Parameters.AddWithValue("@FirstName", parameters.FirstName).Direction = ParameterDirection.Input;
                command.Parameters.AddWithValue("@MiddleName", parameters.MiddleName).Direction = ParameterDirection.Input;            
                command.Parameters.AddWithValue("@CityId", parameters.CityId).Direction = ParameterDirection.Input;
                command.Parameters.AddWithValue("@ProvinceId", parameters.ProvinceId).Direction = ParameterDirection.Input;
                DataTable dt = SqlHelper.GetData(command);
                foreach (DataRow row in dt.Rows)
                    var item = new Patient();
                    item.Id = TDefaultValue.GetLong(row["Id"].ToString());
                    item.PatientNumber = (row["PatientNumber"].ToString());
                    item.LastName = (row["LastName"].ToString());
                    item.FirstName = (row["FirstName"].ToString());
                    item.MiddleName = (row["MiddleName"].ToString());                
                    item.AddressLine1 = (row["AddressLine1"].ToString());
                    item.CityId = (short)row["CityId"].ToString();
                    item.CityName = (row["CityName"].ToString());
                    item.ProvinceId = (short)row["ProvinceId"].ToString();
                    item.ProvinceName = (row["ProvinceName"].ToString());
                    items.Add(item);
                return items;
            public bool Insert(Patient entity, int userId, ref bool doesExist)
                var command = new SqlCommand();
                try
                    command.CommandText = "AddPatient";
                    command.CommandType = CommandType.StoredProcedure;
                    command.Parameters.AddWithValue("@PatientNumber", entity.PatientNumber).Direction = ParameterDirection.Input;
                    command.Parameters.AddWithValue("@LastName", entity.LastName).Direction = ParameterDirection.Input;
                    command.Parameters.AddWithValue("@FirstName", entity.FirstName).Direction = ParameterDirection.Input;
                    command.Parameters.AddWithValue("@MiddleName", entity.MiddleName).Direction = ParameterDirection.Input;
                    command.Parameters.AddWithValue("@AddressLine1", entity.AddressLine1).Direction = ParameterDirection.Input;
                    command.Parameters.AddWithValue("@CityId", entity.CityId).Direction = ParameterDirection.Input;
                    command.Parameters.AddWithValue("@ProvinceId", entity.ProvinceId).Direction = ParameterDirection.Input;
    command.Parameters.AddWithValue("@Id", entity.Id).Direction = ParameterDirection.Input;
                    command.Parameters.Add("@DoesExist", SqlDbType.Bit).Direction = ParameterDirection.Output;
                    int result = SqlHelper.ExecuteNonQuery(command);
                    doesExist = (bool)(command.Parameters["@DoesExist"].Value);
                    entity.Id = (int)(command.Parameters["@Id"].Value);
                    if (result == 0 || doesExist)
                        return false;
                    return true;
                catch (Exception)
                    return false;
            public bool Update(Patient entity, int userId, ref bool doesExist)
                var command = new SqlCommand();
                try
                    command.CommandText = "EditPatient";
                    command.CommandType = CommandType.StoredProcedure;
                    command.Parameters.AddWithValue("@PatientNumber", entity.PatientNumber).Direction = ParameterDirection.Input;
                    command.Parameters.AddWithValue("@LastName", entity.LastName).Direction = ParameterDirection.Input;
                    command.Parameters.AddWithValue("@FirstName", entity.FirstName).Direction = ParameterDirection.Input;
                    command.Parameters.AddWithValue("@MiddleName", entity.MiddleName).Direction = ParameterDirection.Input;
                    command.Parameters.AddWithValue("@AddressLine1", entity.AddressLine1).Direction = ParameterDirection.Input;
                    command.Parameters.AddWithValue("@CityId", entity.CityId).Direction = ParameterDirection.Input;
                    command.Parameters.AddWithValue("@ProvinceId", entity.ProvinceId).Direction = ParameterDirection.Input;
    command.Parameters.AddWithValue("@Id", SqlDbType.Int).Direction = ParameterDirection.Output;
                    command.Parameters.Add("@DoesExist", SqlDbType.Bit).Direction = ParameterDirection.Output;
    doesExist = (bool)(command.Parameters["@DoesExist"].Value);
                    int result = SqlHelper.ExecuteNonQuery(command);
                    if (result == 0 || doesExist)
                        return false;
                    return true;
                catch (Exception)
                    return false;
    Then a business logic
    3. MetroApp.BusinessLogic = class libray for calling the methods from DataAccess
    namespace MetroApp.BusinessLogic
        public class PatientMgr
            #region Fields
            private readonly PatientDb _db;
            #endregion
            #region Properties
            public Patient Entity { get; set; }
            public List<Patient> EntityList { get; set; }
            public PatientParams Parameters { get; set; }
            #endregion
            #region Constructors
            public PatientMgr()
                _db = new PatientDb();
                Entity = new Patient();
                EntityList = new List<Patient>();
                Parameters = new PatientParams();
            #endregion
            #region Methods
    public Patient Retrieve(PatientParams parameters)
                return _db.Retrieve(parameters);
            public List<Patient> RetrieveMany(PatientParams parameters)
                return _db.RetrieveMany(parameters);
            public bool Insert(Patient entity, int userId, ref bool doesExist)
                return _db.Insert(entity, userId, ref doesExist);
            public bool Update(Patient entity, int userId, ref bool doesExist)
                return _db.Update(entity, userId, ref doesExist);
            #endregion
    Then the last one, the WPF GUI
    <UserControl x:Class="MetroDentProject.Pages.PatientDetailsPage"
                 xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation"
                 xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml"
                 xmlns:mc="http://schemas.openxmlformats.org/markup-compatibility/2006" 
                 xmlns:d="http://schemas.microsoft.com/expression/blend/2008" 
                 xmlns:dims="clr-namespace:MetroAppProject.UserCons"
                 mc:Ignorable="d" 
                 d:DesignHeight="720" d:DesignWidth="1280">
        <Grid x:Name="MainGrid" >
            <Grid.RowDefinitions>
                <RowDefinition  Height="40"/>
                <RowDefinition  />
                <RowDefinition  />
                <RowDefinition  />
                <RowDefinition  />
                <RowDefinition  />
                <RowDefinition  />
                <RowDefinition  />
                <RowDefinition  />
                <RowDefinition  />
                <RowDefinition  />
                <RowDefinition  />
            </Grid.RowDefinitions>
            <Grid.ColumnDefinitions>
                <ColumnDefinition />
                <ColumnDefinition />
                <ColumnDefinition />
            </Grid.ColumnDefinitions>
            <GroupBox Grid.Column="0" Grid.Row="1" Grid.RowSpan="7" x:Name="DetailsGroupBox" Header="Patient Details" >
                <Grid>
                    <Grid.ColumnDefinitions>
                        <ColumnDefinition/>
                        <ColumnDefinition/>
                    </Grid.ColumnDefinitions>
                    <Grid.RowDefinitions>
                        <RowDefinition/>
                        <RowDefinition/>
                        <RowDefinition/>
                        <RowDefinition/>
                        <RowDefinition/>
                        <RowDefinition/>
                        <RowDefinition/>
                        <RowDefinition/>
                        <RowDefinition/>
                        <RowDefinition/>
                    </Grid.RowDefinitions>
                    <TextBlock Text="Id: " Grid.Column="1" Grid.Row="0" Visibility="Collapsed"/>
                    <TextBox x:Name="IdTextBox" Grid.Column="1" Grid.Row="1" Visibility="Collapsed"/>
                    <TextBlock x:Name="PatientNumberTextBlock" Text="Patient Number: " Grid.Column="0" Grid.Row="0" />
                    <TextBox x:Name="PatientNumberTextBox" Grid.Column="1" Grid.Row="0" IsReadOnly="True" IsReadOnlyCaretVisible="True"/>
                    <TextBlock Text="Last Name: " Grid.Column="0" Grid.Row="1" />
                    <TextBox x:Name="LastNameTextBox" Grid.Column="1" Grid.Row="1" />
                    <TextBlock Text="First Name: " Grid.Column="0" Grid.Row="2" />
                    <TextBox x:Name="FirstNameTextBox" Grid.Column="1" Grid.Row="2" />
                    <TextBlock Text="Middle Name: " Grid.Column="0" Grid.Row="3" />
                    <TextBox x:Name="MiddleNameTextBox" Grid.Column="1" Grid.Row="3" />
                </Grid>
            </GroupBox>
            <GroupBox x:Name="ContactDetailsGroupBox" Header="Contact Details" Grid.Column="1" Grid.Row="1" Grid.RowSpan="7">
                <Grid>
                    <Grid.ColumnDefinitions>
                        <ColumnDefinition/>
                        <ColumnDefinition />
                    </Grid.ColumnDefinitions>
                    <Grid.RowDefinitions>
                        <RowDefinition/>
                        <RowDefinition/>
                        <RowDefinition/>
                        <RowDefinition/>
                        <RowDefinition/>
                        <RowDefinition/>
                        <RowDefinition/>
                        <RowDefinition/>
                        <RowDefinition/>
                        <RowDefinition/>
                    </Grid.RowDefinitions>
                    <TextBlock Text="Address: " Grid.Column="0" Grid.Row="0" Grid.RowSpan="2" />
                    <TextBlock Text="City: " Grid.Column="0" Grid.Row="2" />
                    <TextBlock Text="Province: " Grid.Column="0" Grid.Row="3"/>
                    <TextBox x:Name="AddressTextBox" Grid.Column="1" Grid.Row="0" Grid.RowSpan="2"
                             TextWrapping="Wrap"
                             AcceptsReturn="True"
                             VerticalScrollBarVisibility="Auto"
                             />
                    <ComboBox x:Name="CitiesComboBox"  Grid.Column="1" Grid.Row="2"  />
                    <ComboBox x:Name="ProvincesComboBox"  Grid.Column="1" Grid.Row="3" />
                </Grid>
            </GroupBox>
            <dims:FunctionButtonsControl x:Name="FunctionButtonsCon" Grid.Row="9" Grid.Column="0" Grid.ColumnSpan="2"
                                         ExecuteClick="FunctionButtonsCon_OnExecuteClick"
                                         UndoClick="FunctionButtonsCon_OnUndoClick"
                                         BackClick="FunctionButtonsCon_OnBackClick"
                                         DeleteClick="FunctionButtonsCon_OnDeleteClick"
                                         />
        </Grid>
    </UserControl>
    I apologize for the long post. As you can see, I don't use binding. Binding requires me to use INotifyPropertyChanged interface which I am not familiar. Can you at least make my project to implement the INotifypropertyChanged?
    Here is my sample code for the WPF page:
    public partial class PatientDetailsPage 
            readonly PatientMgr itemMgr = new PatientMgr();       
            public PatientParams CurrentPar = new PatientParams(); // for undoActionType _action = ActionType.Insert; // this is an enum from another project, ActionType.Insert, ActionType.Update
            public ActionType Action
                get { return _action; }
                set { _action = value; }
            public PatientDetailsPage()
                InitializeComponent();
                BindComboBoxes();
            #region Methods
            public void OnFragmentNavigation(FragmentNavigationEventArgs e)
            public void OnNavigatedFrom(NavigationEventArgs e)
            public void OnNavigatedTo(NavigationEventArgs e)
            {            Setup();
            public void OnNavigatingFrom(NavigatingCancelEventArgs e)
            public Patient GetPageEntity()
                Patient setEntity = new Patient();
                setEntity.Id = (long)IdTextBox.Text;
                setEntity.PatientNumber = PatientNumberTextBox.Text;
                setEntity.LastName = LastNameTextBox.Text;
                setEntity.FirstName = FirstNameTextBox.Text;
                setEntity.MiddleName = MiddleNameTextBox.Text;
                setEntity.AddressLine1 = AddressTextBox.Text;
                setEntity.CityId = (short)CitiesComboBox.SelectedValue);
                setEntity.ProvinceId = (short)ProvincesComboBox.SelectedValue;
                setEntity.StatusId = true;
                return setEntity;
            public void Setup()
                switch (Action)
                    case ActionType.Insert:
                        Clearer(); //clears all textboxes and set all comboboxes to default
                        this.PatientNumberTextBlock.Visibility = Visibility.Collapsed;
                        this.PatientNumberTextBox.Visibility = Visibility.Collapsed;
                        FunctionButtonsCon.ExecuteButton.Content = "Add";
                        FunctionButtonsCon.DeleteButton.IsEnabled = false;
                        FunctionButtonsCon.DeleteButton.Visibility = Visibility.Hidden;
                        break;
                    //**Setup Update
                    case ActionType.Update:CurrentPar.Id = (long)IdTextBox.Text;
                        LoadSingle(CurrentPar);
                        this.PatientNumberTextBlock.Visibility = Visibility.Visible;
                        this.PatientNumberTextBox.Visibility = Visibility.Visible;
                        FunctionButtonsCon.ExecuteButton.Content = "Save";
                        FunctionButtonsCon.DeleteButton.IsEnabled = true;
                        FunctionButtonsCon.DeleteButton.Visibility = Visibility.Visible;
                        break;                
                LastNameTextBox.CaretIndex = LastNameTextBox.Text.Length;
                IsVisibleChanged += AutoFocus;
            public void LoadSingle(PatientParams parameters)
                var entity = itemMgr.Retrieve(parameters); //calls the BusinessLogic
                IdTextBox.Text = (entity.Id);
                PatientNumberTextBox.Text = (entity.PatientNumber);
                LastNameTextBox.Text = (entity.LastName);
                FirstNameTextBox.Text = (entity.FirstName);
                MiddleNameTextBox.Text = (entity.MiddleName);
                AddressTextBox.Text = (entity.AddressLine1);
                CitiesComboBox.SelectedValue = (short)entity.CityId;
                ProvincesComboBox.SelectedValue = (short)entity.ProvinceId;
            public void Save(ActionType action, int userId)
                itemMgr.Entity = GetPageEntity();
                bool doesExist = false;
                switch (action)
                    case ActionType.Insert:
                        if (itemMgr.Insert((itemMgr.Entity), userId, ref doesExist))
                            System.Windows.Forms.MessageBox.Show("Successfully added a Patient!", "Patient Insertion");                  
                        else if (doesExist)
                            System.Windows.Forms.MessageBox.Show("Item already exists.", "Patient Insertion");
                        else
                            System.Windows.Forms.MessageBox.Show("Not all fields were filled in.", "Patient Insertion");
                        break;
                    case ActionType.Update:
                        if (itemMgr.Update(itemMgr.Entity, userId, ref doesExist))
                            System.Windows.Forms.MessageBox.Show("Successfully updated a Patient!", "Patient Modification");
                            itemMgr.Parameters.Id = itemMgr.Entity.Id;
                            Action = ActionType.Update;
                            Setup();
                        else if (doesExist)
                            System.Windows.Forms.MessageBox.Show("Item already exists.", "Patient Modification");
                        else
                            System.Windows.Forms.MessageBox.Show("Not all fields were filled in.", "Patient Modification");
                        break;                
            public void Clearer()
                IdTextBox.Clear();
                PatientNumberTextBox.Clear();
                LastNameTextBox.Clear();
                FirstNameTextBox.Clear();
                MiddleNameTextBox.Clear();
                CitiesComboBox.SelectedIndex = 0;
                ProvincesComboBox.SelectedIndex = 0;
                AddressTextBox.Clear();            
            public void BindComboBoxes()
                CitiesComboBox.ItemsSource = new BindingSource(CommonMgr.GetCitiesDropDown(), null);// the CommonMgr is a static class from another project. It works just fine
                CitiesComboBox.DisplayMemberPath = "Value";
                CitiesComboBox.SelectedValuePath = "Key";           
                ProvincesComboBox.ItemsSource = new BindingSource(CommonMgr.GetProvincesDropDown(), null);
                ProvincesComboBox.DisplayMemberPath = "Value";
                ProvincesComboBox.SelectedValuePath = "Key";
                CitiesComboBox.SelectedIndex = 0;
                ProvincesComboBox.SelectedIndex = 0;
            #endregion
            #region Events
            private void FunctionButtonsCon_OnExecuteClick(object sender, RoutedEventArgs e)
                Save(Action, SessionHelper.MyUser.Id); //SessionHelper.MyUser.Id
            private void FunctionButtonsCon_OnUndoClick(object sender, RoutedEventArgs e)
                if (Action == ActionType.Insert)
                    Clearer();
                    return;
            private void FunctionButtonsCon_OnBackClick(object sender, RoutedEventArgs e)
                Exiter();
            private void FunctionButtonsCon_OnDeleteClick(object sender, RoutedEventArgs e)
                var ans = System.Windows.Forms.MessageBox.Show("Are you sure you want to delete this entry?", "Patient Deletion", MessageBoxButtons.YesNo);
                if (!Equals(ans, System.Windows.Forms.DialogResult.Yes)) return;
                Action = ActionType.Delete;
                Save(Action, SessionHelper.MyUser.Id);
                Exiter();
            #endregion

    Hello Kokombads,
    I thought you are using MVVM from your title but it seems your project is just a simple WPF project. In that way, please check the following msdn article to know how to Implement Property Change Notification
    https://msdn.microsoft.com/en-us/library/ms743695(v=vs.110).aspx
    using System.ComponentModel;
    namespace SDKSample
    // This class implements INotifyPropertyChanged
    // to support one-way and two-way bindings
    // (such that the UI element updates when the source
    // has been changed dynamically)
    public class Person : INotifyPropertyChanged
    private string name;
    // Declare the event
    public event PropertyChangedEventHandler PropertyChanged;
    public Person()
    public Person(string value)
    this.name = value;
    public string PersonName
    get { return name; }
    set
    name = value;
    // Call OnPropertyChanged whenever the property is updated
    OnPropertyChanged("PersonName");
    // Create the OnPropertyChanged method to raise the event
    protected void OnPropertyChanged(string name)
    PropertyChangedEventHandler handler = PropertyChanged;
    if (handler != null)
    handler(this, new PropertyChangedEventArgs(name));
    It is not so complex, you only need to refer to the interface from here:
    https://msdn.microsoft.com/en-us/library/system.componentmodel.inotifypropertychanged(v=vs.110).aspx
    And understand that you have to do the following:
    For change notification to occur in a binding between a bound client and a data source, your bound type should either:
    Implement the INotifyPropertyChanged interface (preferred).
    Provide a change event for each property of the bound type
    Best regards,
    Barry
    We are trying to better understand customer views on social support experience, so your participation in this interview project would be greatly appreciated if you have time. Thanks for helping make community forums a great place.
    Click
    HERE to participate the survey.

  • How can I change the event display in an APEX 4.2 calendar?

    Colleagues:  The APEX calendar feature is pretty neat, but of course there's a feature I'd like to use but can't find how/where to change it.  In other calendaring apps (e.g., Thunderbird) when an event is logged, like tomorrow's staff meeting, the time is blocked out vertically for the length of the event.  So for example: if staff is from 2pm-4pm, both 2-3 and 3-4 are colorized so a quick visual will show what times during the day are not available.
    The APEX calendar will show a colored bar for the start time of the event, but not a blocked-out vertical for the entire event.  Make sense?  Any way I can change the calendar/event view to accommodate this?
    Thanks for your help.
    Broc Norman II
    Sr DBA
    GIT / Hillsboro Manufacturing Site

    use - Region Plugin - SkillBuilders Calendar which is useful to display event as your requirement
    Try this.
    Pars.

  • How  can i get the event of selected PageItem in ActionScript

    hi,
    when i select the pageitem on document then i want the event of that pageitem .
    Is there a possibility to get that event ?
    best thanks for any hint.
    govind

    Marcel,
    Please consult the "Tables" chapter in the UIX Developer's Guide. You can search for a method titled "doSelectionEvent" that will indicate how to deal with table selections.
    Hope this helps,
    Ryan Pollock

Maybe you are looking for