Пример #1
0
 private void birthday_Leave(object sender, EventArgs e)
 {
     if (GF.validateDateTime(birthday))
     {
         if (birthday.MaskFull)
         {
             current_age.Text = GF.calculateAge(birthday.Text);
         }
     }
 }
Пример #2
0
        private void member_manage_Load(object sender, EventArgs e)
        {
            if (!string.IsNullOrEmpty(member_id.Trim()))
            {
                GF.showLoading(this);
                Dictionary <string, string> values = new()
                {
                    { "member_id", member_id.Trim() }
                };

                Dictionary <string, object> Obj = DB.Post("Member/getMemberData/", values);

                if (Obj != null)
                {
                    if (Obj.ContainsKey("result"))
                    {
                        Dictionary <string, object> Item = GF.ToType <Dictionary <string, object> >(Obj["result"]);
                        if (Item.Keys.Count > 0)
                        {
                            member_no.Text           = (Item["member_no"] ?? "").ToString();
                            current_member_type.Text = (Item["current_member_type"] ?? "").ToString();
                            during_date.Text         = (Item["during_date"] ?? "").ToString();
                            first_date.Text          = GF.formatDBDateTime((Item["create_date"] ?? "").ToString());
                            current_contract_no.Text = (Item["contract_no"] ?? "").ToString();

                            firstname_th.Text = (Item["firstname_th"] ?? "").ToString();
                            lastname_th.Text  = (Item["lastname_th"] ?? "").ToString();
                            nickname_th.Text  = (Item["nickname_th"] ?? "").ToString();
                            firstname_en.Text = (Item["firstname_en"] ?? "").ToString();
                            lastname_en.Text  = (Item["lastname_en"] ?? "").ToString();
                            nickname_en.Text  = (Item["nickname_en"] ?? "").ToString();

                            martial_status.Text = Item["martial_status"].ToString();
                            if (!string.IsNullOrEmpty((Item["birthday"] ?? "").ToString()))
                            {
                                birthday.Text    = Item["birthday"].ToString();
                                current_age.Text = GF.calculateAge(Item["birthday"].ToString());
                            }
                            if (!string.IsNullOrEmpty((Item["document_type"] ?? "").ToString()))
                            {
                                document_type.Text = Item["document_type"].ToString();
                            }
                            document_no.Text = (Item["document_no"] ?? "").ToString();
                            email.Text       = (Item["email"] ?? "").ToString();
                            occupation.Text  = (Item["occupation"] ?? "").ToString();
                            gender.Text      = Item["gender"].ToString();
                            address.Text     = (Item["address"] ?? "").ToString();

                            company_name.Text = (Item["company_name"] ?? "").ToString();
                            work_phone.Text   = (Item["work_phone"] ?? "").ToString();
                            home_phone.Text   = (Item["home_phone"] ?? "").ToString();
                            mobile_phone.Text = (Item["mobile_phone"] ?? "").ToString();

                            emergency_contact_name.Text         = (Item["emergency_contact_name"] ?? "").ToString();
                            emergency_contact_phone.Text        = (Item["emergency_contact_phone"] ?? "").ToString();
                            emergency_contact_relationship.Text = (Item["emergency_contact_relationship"] ?? "").ToString();

                            weight.Text             = (Item["weight"] ?? "").ToString();
                            height.Text             = (Item["height"] ?? "").ToString();
                            congenital_disease.Text = (Item["congenital_disease"] ?? "").ToString();

                            pictureFilename = (Item["image_file"] ?? "").ToString();
                            if (!string.IsNullOrEmpty(pictureFilename.Trim()))
                            {
                                GF.getImage(pictureFilename, ref picture, "member_picture");
                            }
                        }
                    }
                }

                GF.closeLoading();
            }
            else
            {
                picture.Visible = false;
            }
        }