Exemplo n.º 1
0
        /// <summary>
        /// 点击确定按钮执行的方法
        /// </summary>
        /// <param name="sender"></param>
        /// <param name="e"></param>
        protected void Button1_Click(object sender, EventArgs e)
        {
            Maticsoft.BLL.AR_Report AR_Report_bll = new Maticsoft.BLL.AR_Report();
            Maticsoft.Model.AR_Report AR_Report_model = AR_Report_bll.GetModel(ReportID);
            if (AR_Report_model == null)
            {
                AR_Report_model = new Maticsoft.Model.AR_Report();
            }

            AR_Report_model.R_Type = 2;
            AR_Report_model.R_Title = R_Title.Text;
            AR_Report_model.R_Content = R_Content.Text;
            AR_Report_model.R_DateTime = DateTime.Now;
            AR_Report_model.R_ResponsibilityUserID = UserData.GetUserDate.UserID;  //获取当前用户ID
            AR_Report_model.R_GroupID = UserData.GetUserDate.U_GroupID;
            switch (CMD)
            {
                case "New":
                    CMD_Txt = "增加";
                    //如果是增加操作,就调用Add方法
                    AR_Report_model.ReportID = AR_Report_bll.Add(AR_Report_model);
                    break;
                case "Edit":
                    CMD_Txt = "修改";
                    //如果是修改操作,就调用Update方法
                    AR_Report_bll.Update(AR_Report_model);
                    break;
            }
            All_Title_Txt = CMD_Txt + App_Txt;
            EventMessage.MessageBox(1, "操作成功", string.Format("{1}ID({0})成功!", AR_Report_model.ReportID, All_Title_Txt), Icon_Type.OK, Common.GetHomeBaseUrl("default.aspx"));
        }
Exemplo n.º 2
0
 private void ShowInfo(int ReportID)
 {
     Maticsoft.BLL.AR_Report   bll   = new Maticsoft.BLL.AR_Report();
     Maticsoft.Model.AR_Report model = bll.GetModel(ReportID);
     this.lblReportID.Text               = model.ReportID.ToString();
     this.lblR_Title.Text                = model.R_Title;
     this.lblR_Content.Text              = model.R_Content;
     this.lblR_DateTime.Text             = model.R_DateTime.ToString();
     this.lblR_ResponsibilityUserID.Text = model.R_ResponsibilityUserID.ToString();
 }
Exemplo n.º 3
0
 private void ShowInfo(int ReportID)
 {
     Maticsoft.BLL.AR_Report bll=new Maticsoft.BLL.AR_Report();
     Maticsoft.Model.AR_Report model=bll.GetModel(ReportID);
     this.lblReportID.Text=model.ReportID.ToString();
     this.lblR_Title.Text=model.R_Title;
     this.lblR_Content.Text=model.R_Content;
     this.lblR_DateTime.Text=model.R_DateTime.ToString();
     this.lblR_ResponsibilityUserID.Text=model.R_ResponsibilityUserID.ToString();
 }
Exemplo n.º 4
0
 protected void Button2_Click(object sender, EventArgs e)
 {
     Maticsoft.BLL.AR_Report AR_Report_bll = new Maticsoft.BLL.AR_Report();
     Maticsoft.Model.AR_Report AR_Report_model = AR_Report_bll.GetModel(ReportID);
     AR_Report_model.R_ResponsibilityUserID = UserData.GetUserDate.UserID; //更改责任人
     AR_Report_model.R_GroupID = UserData.GetUserDate.U_GroupID; //更改报告部门
     CMD_Txt = "增加";
     AR_Report_model.ReportID = AR_Report_bll.Add(AR_Report_model);
     All_Title_Txt = CMD_Txt + App_Txt;
     EventMessage.MessageBox(1, "操作成功", string.Format("{1}ID({0})成功!", AR_Report_model.ReportID, All_Title_Txt), Icon_Type.OK, Common.GetHomeBaseUrl("default.aspx"));
 }
Exemplo n.º 5
0
 protected void Page_Load(object sender, EventArgs e)
 {
     if (!Page.IsPostBack)
     {
         Maticsoft.BLL.AR_Report bll=new Maticsoft.BLL.AR_Report();
         if (Request.Params["id"] != null && Request.Params["id"].Trim() != "")
         {
             int ReportID=(Convert.ToInt32(Request.Params["id"]));
             bll.Delete(ReportID);
             Response.Redirect("list.aspx");
         }
     }
 }
Exemplo n.º 6
0
 protected void Page_Load(object sender, EventArgs e)
 {
     if (!Page.IsPostBack)
     {
         Maticsoft.BLL.AR_Report bll = new Maticsoft.BLL.AR_Report();
         if (Request.Params["id"] != null && Request.Params["id"].Trim() != "")
         {
             int ReportID = (Convert.ToInt32(Request.Params["id"]));
             bll.Delete(ReportID);
             Response.Redirect("list.aspx");
         }
     }
 }
Exemplo n.º 7
0
        public void btnSave_Click(object sender, EventArgs e)
        {
            string strErr = "";

            if (this.txtR_Title.Text.Trim().Length == 0)
            {
                strErr += "报告标题不能为空!\\n";
            }
            if (this.txtR_Content.Text.Trim().Length == 0)
            {
                strErr += "报告内容不能为空!\\n";
            }
            if (!PageValidate.IsDateTime(txtR_DateTime.Text))
            {
                strErr += "报告时间格式错误!\\n";
            }
            if (!PageValidate.IsNumber(txtR_ResponsibilityUserID.Text))
            {
                strErr += "责任人格式错误!\\n";
            }

            if (strErr != "")
            {
                MessageBox.Show(this, strErr);
                return;
            }
            int      ReportID               = int.Parse(this.lblReportID.Text);
            string   R_Title                = this.txtR_Title.Text;
            string   R_Content              = this.txtR_Content.Text;
            DateTime R_DateTime             = DateTime.Parse(this.txtR_DateTime.Text);
            int      R_ResponsibilityUserID = int.Parse(this.txtR_ResponsibilityUserID.Text);


            Maticsoft.Model.AR_Report model = new Maticsoft.Model.AR_Report();
            model.ReportID               = ReportID;
            model.R_Title                = R_Title;
            model.R_Content              = R_Content;
            model.R_DateTime             = R_DateTime;
            model.R_ResponsibilityUserID = R_ResponsibilityUserID;

            Maticsoft.BLL.AR_Report bll = new Maticsoft.BLL.AR_Report();
            bll.Update(model);
            Maticsoft.Common.MessageBox.ShowAndRedirect(this, "保存成功!", "list.aspx");
        }
Exemplo n.º 8
0
        public void btnSave_Click(object sender, EventArgs e)
        {
            string strErr="";
            if(this.txtR_Title.Text.Trim().Length==0)
            {
                strErr+="报告标题不能为空!\\n";
            }
            if(this.txtR_Content.Text.Trim().Length==0)
            {
                strErr+="报告内容不能为空!\\n";
            }
            if(!PageValidate.IsDateTime(txtR_DateTime.Text))
            {
                strErr+="报告时间格式错误!\\n";
            }
            if(!PageValidate.IsNumber(txtR_ResponsibilityUserID.Text))
            {
                strErr+="责任人格式错误!\\n";
            }

            if(strErr!="")
            {
                MessageBox.Show(this,strErr);
                return;
            }
            int ReportID=int.Parse(this.lblReportID.Text);
            string R_Title=this.txtR_Title.Text;
            string R_Content=this.txtR_Content.Text;
            DateTime R_DateTime=DateTime.Parse(this.txtR_DateTime.Text);
            int R_ResponsibilityUserID=int.Parse(this.txtR_ResponsibilityUserID.Text);

            Maticsoft.Model.AR_Report model=new Maticsoft.Model.AR_Report();
            model.ReportID=ReportID;
            model.R_Title=R_Title;
            model.R_Content=R_Content;
            model.R_DateTime=R_DateTime;
            model.R_ResponsibilityUserID=R_ResponsibilityUserID;

            Maticsoft.BLL.AR_Report bll=new Maticsoft.BLL.AR_Report();
            bll.Update(model);
            Maticsoft.Common.MessageBox.ShowAndRedirect(this,"保存成功!","list.aspx");
        }
Exemplo n.º 9
0
        /// <summary>
        /// 初始化
        /// </summary>
        private void OnStart()
        {
            if (CMD == "New")
            {
                Button1.Visible = true;
                Button2.Visible = false;
            }
            else if (CMD == "Edit")
            {
                HeadMenuButtonItem bi2 = new HeadMenuButtonItem();
                bi2.ButtonPopedom = PopedomType.Delete;
                bi2.ButtonName = "活动";
                bi2.ButtonUrlType = UrlType.JavaScript;
                bi2.ButtonUrl = string.Format("DelData('?CMD=Delete&ReportID={0}')", ReportID);
                HeadMenuWebControls1.ButtonList.Add(bi2);

                InputData();
            }
            else if (CMD == "Delete")
            {
                Maticsoft.BLL.AR_Report bll = new Maticsoft.BLL.AR_Report();
                Maticsoft.Model.AR_Report model = bll.GetModel(ReportID);
                bll.Delete(model.ReportID);
                EventMessage.MessageBox(1, "操作成功", string.Format("{1}ID({0})成功!", ReportID, "删除信息"), Icon_Type.OK, Common.GetHomeBaseUrl("default.aspx"));
            }
        }
Exemplo n.º 10
0
 /// <summary>
 /// 在编辑的时候将对应的值绑定到Label上
 /// </summary>
 private void InputData()
 {
     Maticsoft.BLL.AR_Report AR_Report_bll = new Maticsoft.BLL.AR_Report();
     Maticsoft.Model.AR_Report AR_Report_model = AR_Report_bll.GetModel(ReportID);
     if (AR_Report_model != null)
     {
         R_Title.Text = AR_Report_model.R_Title;
         R_Content.Text = AR_Report_model.R_Content;
     }
     if (UserData.GetUserDate.UserID != AR_Report_model.ReportID)
     {
         Button1.Visible = false;
         Button2.Visible = true;
     }
     else
     {
         Button1.Visible = true;
         Button2.Visible = false;
     }
 }
Exemplo n.º 11
0
 /// <summary>
 /// 绑定列表数据
 /// </summary>
 private void BindData()
 {
     string orderby = OrderType == 0 ? Orderfld + " asc" : Orderfld + " desc";
     int startIndex = (this.AspNetPager1.CurrentPageIndex - 1) * this.AspNetPager1.PageSize + 1;
     int endIndex = this.AspNetPager1.CurrentPageIndex * this.AspNetPager1.PageSize;
     Maticsoft.BLL.AR_Report bll = new Maticsoft.BLL.AR_Report();
     DataSet datas = bll.GetListByPage(SearchTerms, orderby, startIndex, endIndex);
     GridView1.DataSource = datas;
     GridView1.DataBind();
     this.AspNetPager1.RecordCount = bll.GetRecordCount(SearchTerms);
 }