Exemplo n.º 1
0
 protected void btnSave_ServerClick(object sender, EventArgs e)
 {
     string strName = txt_Name.Value.Trim();
     if (nId <= 0 && SystemOrganizationType.Exist(strName))
     {
         PageUtil.PageAlert(this.Page, "该类型已存在!");
         return;
     }
     SystemOrganizationType addItem = SystemOrganizationType.Get(nId);
     if (null == addItem)
     {
         addItem = new SystemOrganizationType();
     }
     addItem.Name = strName;
     addItem.ParentId = TypeUtil.ParseInt(sel_OrganizationTypeId.SelectedValue, -1);
     addItem.Remark = txt_Remark.Text;
     int nAddId = SystemOrganizationType.Save(addItem);
     PageUtil.PageAlert(this.Page, nAddId > 0 ? "保存成功!" : "保存失败!");
 }
Exemplo n.º 2
0
 public static int Save(SystemOrganizationType _Entity)
 {
     int result;
     if (null == _Entity)
     {
         result = -1;
     }
     else
     {
         result = EntityAccess<SystemOrganizationType>.Access.Save(_Entity);
     }
     return result;
 }