Esempio n. 1
0
 protected override string AddData()
 {
     RDFNew.Module.Admin.Sys.Sys_Menu obj = new RDFNew.Module.Admin.Sys.Sys_Menu();
     DataTable dt = RDFNew.Module.DALHelper.GetMasterEmpty(null, "Sys_Menu");
     DataRow dr;
     dr = dt.NewRow();
     dr["MenuID"] = App_Com.Helper.InputText(this.txtMenuID.Text, 500);
     dr["MenuName"] = App_Com.Helper.InputText(this.txtMenuName.Text, 500);
     dr["UrlParameter"] = App_Com.Helper.InputText(this.txtUrlParameter.Text, 500);
     dr["Enabled"] = this.ckbEnabled.Checked;
     dr["Remark"] = App_Com.Helper.InputText(this.txtRemark.Text, 500);
     dr["ModuleID"] = App_Com.Helper.InputText(this.txtModuleID.Text, 500);
     dr["Icon"] = App_Com.Helper.InputText(this.txtIcon.Text, 500);
     FineUI.Icon xIcon = IconHelper.String2Icon(dr["Icon"].ToString(), true);
     if (xIcon != FineUI.Icon.None)
         dr["IconUrl"] = IconHelper.GetIconUrl(xIcon);
     else
         dr["IconUrl"] = IconHelper.GetIconUrl(FineUI.Icon.Image);
     dr["Visibled"] = this.ckbVisibled.Checked;
     dr["PID"] = this.hidPID.Text;
     dr["CrtBy"] = App_Com.Sys_User.GetUserInfo("UserID");
     dr["CrtOn"] = System.DateTime.Now.ToString("yyyy-MM-dd HH:mm:ss");
     dt.Rows.Add(dr);
     object[] data = obj.ApplyMaster(dt.GetChanges(DataRowState.Added),
                                 App_Com.Helper.BuildLog("Sys_Menu", "add"));
     if (data[0].ToString() != "0") //正常
         throw data[1] as Exception;
     else
         return data[1].ToString();
 }
Esempio n. 2
0
 protected override void OnInit(EventArgs e)
 {
     base.OnInit(e);
     B_ModuleID = "Sys_Menu";
     B_ModuleName = "菜单";
     B_PageDetail = "Sys_Menu.aspx";
     B_ToolBar1 = this.Toolbar1;
     B_Window1 = this.Window1;
     B_Grid1 = this.Grid1;
     B_IDAL = new RDFNew.Module.Admin.Sys.Sys_Menu();
     B_TableKey = "Sys_Menu.MenuID";
     B_OrderBy = " Sys_Menu.RID ";
 }
Esempio n. 3
0
 protected override void OnInit(EventArgs e)
 {
     base.OnInit(e);
     B_ModuleID = "Sys_Menu";
     B_ModuleName = "菜单";
     B_ToolBar1 = this.Toolbar1;
     B_IDAL = new RDFNew.Module.Admin.Sys.Sys_Menu();
 }
Esempio n. 4
0
 protected override string UpdateData()
 {
     RDFNew.Module.Admin.Sys.Sys_Menu obj = new RDFNew.Module.Admin.Sys.Sys_Menu();
     string Keyword = Request.QueryString["keyword"];
     object[] data = obj.GetMaster(Keyword);
     if (data[0].ToString() == "0") //正常
     {
         DataTable dt = data[1] as DataTable;
         if (dt.Rows.Count > 0)
         {
             DataRow dr;
             dr = dt.Rows[0];
             dr["MenuName"] = App_Com.Helper.InputText(this.txtMenuName.Text, 500);
             dr["UrlParameter"] = App_Com.Helper.InputText(this.txtUrlParameter.Text, 500);
             dr["Enabled"] = this.ckbEnabled.Checked;
             dr["Remark"] = App_Com.Helper.InputText(this.txtRemark.Text, 500);
             dr["ModuleID"] = App_Com.Helper.InputText(this.txtModuleID.Text, 500);
             dr["Icon"] = App_Com.Helper.InputText(this.txtIcon.Text, 500);
             FineUI.Icon xIcon = IconHelper.String2Icon(dr["Icon"].ToString(), true);
             if (xIcon != FineUI.Icon.None)
                 dr["IconUrl"] = IconHelper.GetIconUrl(xIcon);
             else
                 dr["IconUrl"] = IconHelper.GetIconUrl(FineUI.Icon.Image);
             dr["Visibled"] = this.ckbVisibled.Checked;
             dr["PID"] = this.hidPID.Text;
             dr["ModBy"] = App_Com.Sys_User.GetUserInfo("UserID");
             dr["ModOn"] = System.DateTime.Now.ToString("yyyy-MM-dd HH:mm:ss");
             data = obj.ApplyMaster(dt.GetChanges(DataRowState.Modified),
                                     App_Com.Helper.BuildLog("Sys_Menu", "edit"));
             if (data[0].ToString() != "0") //正常
                 throw data[1] as Exception;
             else
                 return data[1].ToString();
         }
         else
         {
             throw new Exception("需要修改的记录已不存在,请刷新后再试.");
         }
     }
     else
     {
         throw data[1] as Exception;
     }
 }