public client client_insert()
        {
            client.client_id = person.person_id;
            if (Insert_deceasedYes.Checked == true)
            {
                client.client_status = "D";
            }
            else
            {
                client.client_status = "M";
            }
            client.ethnicity  = Insert_ethnicity_txt.Text;
            client.eye_color  = Insert_eye_color_ddl.SelectedValue;
            client.hair_color = Insert_hair_color_ddl.SelectedValue;
            client.height     = Insert_height_ddl.SelectedValue;
            byte[] uploaded_picture = Insert_FileUpload.FileBytes;
            Insert_Save_Picture();
            client.picture                  = uploaded_picture;
            client.weight                   = Convert.ToInt32(Insert_weight_txt.Text);
            client.skin_color               = Insert_skin_color_ddl.SelectedValue;
            client.Subscribed_Alerts        = "N";
            client.Info_Field               = "";
            client.Client_Shelter_ID        = 0;
            client.Emergency_Contact_Name   = "";
            client.Emergency_Contact_Number = "";

            client = client.Insert(client);
            //GridView1.DataBind();
            return(client);
        }
 public client client_insert()
 {
     client.client_status = Insert_client_status_txt.Text;
     client.ethnicity     = Insert_ethnicity_txt.Text;
     client.eye_color     = Insert_eye_color_txt.Text;
     client = client.Insert(client);
     Insert_Client_GridView.DataBind();
     return(client);
 }
Пример #3
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();
            }
        }