Esempio n. 1
0
 private void btn_Save_Click(object sender, EventArgs e)
 {
     if (txt_Address.Value == "")
     {
         MessageBox.Show("地址不能为空");
     }
     else if (txt_Post.Value == "")
     {
         MessageBox.Show("邮编不能为空");
     }
     else
     {
         ShopNum1_Member member;
         var             action = (ShopNum1_Member_Action)LogicFactory.CreateShopNum1_Member_Action();
         member = new ShopNum1_Member
         {
             AddressCode  = hid_AreaCode.Value,
             AddressValue = hid_AreaValue.Value,
             Address      = txt_Address.Value,
             Area         = string.Empty, //GetAdress(member.AddressValue, member.Address),
             WebSite      = txt_WebSite.Value,
             Fax          = txt_Fax.Value,
             ModifyUser   = StrMemLoginID,
             ModifyTime   = DateTime.Now
         };
         if (txt_Bth.Value != "")
         {
             member.Birthday = DateTime.Parse(txt_Bth.Value);
             DateTime?birthday = member.Birthday;
             DateTime now      = DateTime.Now;
             if (birthday.HasValue ? (birthday.GetValueOrDefault() > now) : false)
             {
                 MessageBox.Show("出生日期填写有误");
                 return;
             }
         }
         else
         {
             member.Birthday = DateTime.Now;
         }
         member.Vocation   = txt_Voc.Value;
         member.Postalcode = txt_Post.Value;
         try
         {
             if (action.UpdateMemInfoDetail(StrMemLoginID, member) > 0)
             {
                 MessageBox.Show("信息补充成功");
             }
         }
         catch
         {
         }
     }
 }
Esempio n. 2
0
        private void btn_Sure_Click(object sender, EventArgs e)
        {
            var action = (ShopNum1_Member_Action)LogicFactory.CreateShopNum1_Member_Action();
            var member = new ShopNum1_Member
            {
                RealName = txt_PalyName.Value
            };

            if (hid_Sex.Value != "")
            {
                member.Sex = Convert.ToByte(hid_Sex.Value);
            }
            else
            {
                member.Sex = Convert.ToByte("2");
            }
            if (((txt_Email.Value.Trim() != "") && (action.CheckmemEmail(txt_Email.Value.Trim()) > 0)) &&
                (action.FindPwdEamil(base.MemLoginID, txt_Email.Value.Trim()).Rows.Count == 0))
            {
                MessageBox.Show("邮箱已经被使用了,请换一个邮箱!");
            }
            else if (((txt_Mobile.Value.Trim() != "") &&
                      (action.CheckMemMobileByMobile(txt_Mobile.Value.Trim()).Rows.Count > 0)) &&
                     (base.MemLoginID !=
                      action.CheckMemMobileByMobile(txt_Mobile.Value).Rows[0]["MemLoginID"].ToString()))
            {
                MessageBox.Show("手机号码已经被使用了,请换一个手机号码!");
            }
            else
            {
                member.QQ         = txt_QQ.Value;
                member.Email      = txt_Email.Value;
                member.Mobile     = txt_Mobile.Value;
                member.ModifyUser = StrMemLoginID;
                member.ModifyTime = DateTime.Now;
                member.Name       = txt_UserName.Value;
                member.Tel        = txt_Tel.Value;
                try
                {
                    if (action.UpdateMemInfo(StrMemLoginID, member) > 0)
                    {
                        MessageBox.Show("修改成功");
                    }
                }
                catch
                {
                }
            }
        }