Пример #1
0
 public static BasicInfo GetBasicInfoById(int id)
 {
     try
     {
         var ps = BasicInfo.FindById(id);
         return(ps);
     }
     catch
     {
         return(null);
     }
 }
Пример #2
0
 public static bool DeleteBasicInfo(int basicInfoId)
 {
     try
     {
         BasicInfo basic = BasicInfo.FindById(basicInfoId);
         basic.IsDelete = true;
         basic.Save();
     }
     catch
     {
         return(false);
     }
     return(true);
 }
Пример #3
0
 public static bool UpdateBasicInfo(int basicInfoId, string name, string phone, string email, string address, string zipcode)
 {
     try
     {
         BasicInfo basic = BasicInfo.FindById(basicInfoId);
         basic.Name              = name;
         basic.Phone             = phone;
         basic.Email             = email;
         basic.DepartmentAddress = address;
         basic.ZipCode           = zipcode;
         basic.Save();
     }
     catch
     {
         return(false);
     }
     return(true);
 }
Пример #4
0
 protected void Page_Load(object sender, EventArgs e)
 {
     if (!IsPostBack)
     {
         if (basicInfoId != 0)//修改
         {
             btn_Add.Text = "确认修改";
             //回填
             try
             {
                 BasicInfo basic = BasicInfo.FindById(basicInfoId);
                 tb_name.Text  = basic.Name;
                 tb_phone.Text = basic.Phone;
                 tb_email.Text = basic.Email;
             }
             catch (Exception ex)
             {
                 text(ex.ToString());
                 Page.ClientScript.RegisterStartupScript(this.GetType(), "alter", "alert('数据加载错误,请重新再试!')", true);
             }
         }
     }
 }