Beispiel #1
0
        protected override string UpdateData()
        {
            RDFNew.Module.Admin.Sys.Sys_Notice obj = new RDFNew.Module.Admin.Sys.Sys_Notice();
            object[] data = obj.GetMaster(B_Keyword);
            if (data[0].ToString() == "0") //正常
            {
                DataTable dt = data[1] as DataTable;
                if (dt.Rows.Count > 0)
                {
                    DataRow dr;
                    dr = dt.Rows[0];
                    dr["NoticeTitle"] = App_Com.Helper.InputText(this.txtNoticeTitle.Text, 500);
                    dr["NoticeContent"] = this.txtNoticeContent.Text.Trim();
                    dr["Enabled"] = this.ckbEnabled.Checked;

                    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(B_ModuleID, "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;
            }
        }
Beispiel #2
0
 protected override void OnInit(EventArgs e)
 {
     base.OnInit(e);
     B_ModuleID = "Sys_Notice";
     B_ModuleName = "系统公告";
     B_ToolBar1 = this.Toolbar1;
     B_IDAL =new RDFNew .Module .Admin .Sys .Sys_Notice() ;
 }
 protected override void OnInit(EventArgs e)
 {
     base.OnInit(e);
     B_ModuleID = "Sys_Notice";
     B_ModuleName = "系统公告";
     B_PageDetail = "Sys_Notice.aspx";
     B_ToolBar1 = this.Toolbar1;
     B_Window1 = this.Window1;
     B_Grid1 = this.Grid1;
     B_IDAL = new RDFNew.Module.Admin.Sys.Sys_Notice();
     B_TableKey = "Sys_Notice.NoticeID";
     B_OrderBy = "Sys_Notice.CrtOn Desc ";
     B_WinSize = new int[] { 750, 500 };
     B_WindowMaxSize = true;
 }
Beispiel #4
0
        protected override string AddData()
        {
            RDFNew .Module .Admin .Sys .Sys_Notice obj = new RDFNew .Module .Admin .Sys .Sys_Notice();
            DataTable dt = RDFNew.Module.DALHelper.GetMasterEmpty(null, B_ModuleID);
            DataRow dr;
            dr = dt.NewRow();
            dr["NoticeID"] = App_Com.Helper.InputText(this.txtNoticeID.Text, 500);
            dr["NoticeTitle"] = App_Com.Helper.InputText(this.txtNoticeTitle.Text, 500);
            dr["NoticeContent"] = this.txtNoticeContent.Text.Trim();
            dr["Enabled"] = this.ckbEnabled.Checked;

            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(B_ModuleID, "add"));
            if (data[0].ToString() != "0") //正常
                throw data[1] as Exception;
            else
                return data[1].ToString();
        }