public client client_update(int ID)
 {
     client = client.Select(ID);
     if (Update_deceasedYes.Checked == true)
     {
         client.client_status = "D";
     }
     else
     {
         client.client_status = "M";
     }
     client.ethnicity  = Update_ethnicity_txt.Text;
     client.eye_color  = Update_eye_color_ddl.SelectedValue;
     client.hair_color = Update_hair_color_ddl.SelectedValue;
     client.height     = Update_height_ddl.SelectedValue;
     if (Update_FileUpload.HasFile == true)
     {
         byte[] uploaded_picture = Update_FileUpload.FileBytes;
         client.picture = uploaded_picture;
     }
     client.weight     = Convert.ToInt32(Update_weight_txt.Text);
     client.skin_color = Update_skin_color_ddl.SelectedValue;
     client.Update(client);
     //GridView1.DataBind();
     return(client);
 }
 public client client_update(int ID)
 {
     client               = client.Select(ID);
     client.client_id     = Convert.ToInt32(Update_client_id_txt.Text);
     client.client_status = Update_client_status_txt.Text;
     client.ethnicity     = Update_ethnicity_txt.Text;
     client.eye_color     = Update_eye_color_txt.Text;
     client.Update(client);
     Update_Client_GridView.DataBind();
     return(client);
 }
 public client client_update(int ID)
 {
     client = client.Select(ID);
     client.client_id = Convert.ToInt32(Update_client_id_txt.Text);
     client.client_status = Update_client_status_txt.Text;
     client.ethnicity = Update_ethnicity_txt.Text;
     client.eye_color = Update_eye_color_txt.Text;
     client.Update(client);
     Update_Client_GridView.DataBind();
     return client;
 }
Exemple #4
0
        private void Confirm_Click(object sender, RoutedEventArgs e)
        {
            List <Boolean>    list = new List <Boolean>();
            BindingExpression bindingExprFirstName = firstName.GetBindingExpression(TextBox.TextProperty);
            BindingExpression bindingExprLastName  = lastName.GetBindingExpression(TextBox.TextProperty);

            bindingExprFirstName.UpdateSource();
            bindingExprLastName.UpdateSource();
            list.Add(bindingExprFirstName.HasValidationError);
            list.Add(bindingExprLastName.HasValidationError);
            if (!list.Contains(true))
            {
                var     emailsArray    = emails.Items.Cast <Object>().Select(item => item.ToString()).ToArray();
                var     phoneArray     = contacts.Items.Cast <Object>().Select(item => item.ToString()).ToArray();
                Contact contact        = EntityFactory.CreateContact(emailsArray, phoneArray);
                long[]  attends_events = new long[events.Items.Count];
                for (int i = 0; i < events.Items.Count; i++)
                {
                    attends_events[i] = reservations.FirstOrDefault(r => r.Value.Equals(events.Items.GetItemAt(i))).Key;
                }
                client client = EntityFactory.CreateClient(EntityFactory.User.id, firstName.Text, lastName.Text, companyName.Text, JsonConvert.SerializeObject(contact), notes.Text, attends_events);
                if (search.Visibility.Equals(Visibility.Hidden))
                {
                    client.Insert(client);
                }
                else
                {
                    client.Update(client, EntityFactory.Client.id);
                }
                DataContext      = new client();
                firstName.Text   = "";
                lastName.Text    = "";
                companyName.Text = "";
                contacts.Items.Clear();
                emails.Items.Clear();
                events.Items.Clear();
            }
        }
 public client client_update(int ID)
 {
     client = client.Select(ID);
     if (Update_deceasedYes.Checked == true)
     {
         client.client_status = "D";
     }
     else
     {
         client.client_status = "M";
     }
     client.ethnicity = Update_ethnicity_txt.Text;
     client.eye_color = Update_eye_color_ddl.SelectedValue;
     client.hair_color = Update_hair_color_ddl.SelectedValue;
     client.height = Update_height_ddl.SelectedValue;
     if (Update_FileUpload.HasFile == true)
     {
         byte[] uploaded_picture = Update_FileUpload.FileBytes;
         client.picture = uploaded_picture;
     }
     client.weight = Convert.ToInt32(Update_weight_txt.Text);
     client.skin_color = Update_skin_color_ddl.SelectedValue ;
     client.Update(client);
     //GridView1.DataBind();
     return client;
 }