Пример #1
0
 protected void Page_Load(object sender, EventArgs e)
 {
     if (!Page.IsPostBack)
     {
         Maticsoft.BLL.education_Activity bll=new Maticsoft.BLL.education_Activity();
         if (Request.Params["id"] != null && Request.Params["id"].Trim() != "")
         {
             int ActivityID=(Convert.ToInt32(Request.Params["id"]));
             bll.Delete(ActivityID);
             Response.Redirect("list.aspx");
         }
     }
 }
Пример #2
0
 protected void Page_Load(object sender, EventArgs e)
 {
     if (!Page.IsPostBack)
     {
         Maticsoft.BLL.education_Activity bll = new Maticsoft.BLL.education_Activity();
         if (Request.Params["id"] != null && Request.Params["id"].Trim() != "")
         {
             int ActivityID = (Convert.ToInt32(Request.Params["id"]));
             bll.Delete(ActivityID);
             Response.Redirect("list.aspx");
         }
     }
 }
Пример #3
0
 private void ShowInfo(int ActivityID)
 {
     Maticsoft.BLL.education_Activity bll=new Maticsoft.BLL.education_Activity();
     Maticsoft.Model.education_Activity model=bll.GetModel(ActivityID);
     this.lblActivityID.Text=model.ActivityID.ToString();
     this.lblA_DateTime.Text=model.A_DateTime.ToString();
     this.lblA_Location.Text=model.A_Location;
     this.lblA_Form.Text=model.A_Form;
     this.lblA_Object.Text=model.A_Object.ToString();
     this.lblA_Crowd.Text=model.A_Crowd;
     this.lblA_Duration.Text=model.A_Duration.ToString();
     this.lblA_Organizers.Text=model.A_Organizers;
     this.lblA_Partners.Text=model.A_Partners;
     this.lblA_Missionary.Text=model.A_Missionary;
     this.lblA_Number.Text=model.A_Number.ToString();
     this.lblA_Theme.Text=model.A_Theme;
 }
Пример #4
0
 private void ShowInfo(int ActivityID)
 {
     Maticsoft.BLL.education_Activity   bll   = new Maticsoft.BLL.education_Activity();
     Maticsoft.Model.education_Activity model = bll.GetModel(ActivityID);
     this.lblActivityID.Text   = model.ActivityID.ToString();
     this.lblA_DateTime.Text   = model.A_DateTime.ToString();
     this.lblA_Location.Text   = model.A_Location;
     this.lblA_Form.Text       = model.A_Form;
     this.lblA_Object.Text     = model.A_Object.ToString();
     this.lblA_Crowd.Text      = model.A_Crowd;
     this.lblA_Duration.Text   = model.A_Duration.ToString();
     this.lblA_Organizers.Text = model.A_Organizers;
     this.lblA_Partners.Text   = model.A_Partners;
     this.lblA_Missionary.Text = model.A_Missionary;
     this.lblA_Number.Text     = model.A_Number.ToString();
     this.lblA_Theme.Text      = model.A_Theme;
 }
Пример #5
0
        /// <summary>
        /// 点击确定按钮执行的方法
        /// </summary>
        /// <param name="sender"></param>
        /// <param name="e"></param>
        protected void Button1_Click(object sender, EventArgs e)
        {
            Maticsoft.BLL.education_Activity education_Activity_bll = new Maticsoft.BLL.education_Activity();
            Maticsoft.Model.education_Activity education_Activity_model = education_Activity_bll.GetModel(ActivityID);
            if (education_Activity_model == null)
            {
                education_Activity_model = new Maticsoft.Model.education_Activity();
            }

            education_Activity_model.A_DateTime = (DateTime)Common.sink(this.A_DateTime.UniqueID, MethodType.Post, 255, 0, DataType.Dat);
            education_Activity_model.A_Location = A_Location.Text;
            education_Activity_model.A_Object = (int)Common.sink(this.A_Object.UniqueID, MethodType.Post, 255, 0, DataType.Int);
            education_Activity_model.A_Crowd = A_Crowd.Text;
            education_Activity_model.A_Form = A_Form.Text;
            education_Activity_model.A_Duration = (int)Common.sink(this.A_Duration.UniqueID, MethodType.Post, 255, 0, DataType.Int);
            education_Activity_model.A_Organizers = A_Organizers.Text;
            education_Activity_model.A_Partners = A_Partners.Text;
            education_Activity_model.A_Missionary = A_Missionary.Text;
            education_Activity_model.A_Number = (int)Common.sink(this.A_Number.UniqueID, MethodType.Post, 255, 0, DataType.Int);
            education_Activity_model.A_Theme = A_Theme.Text;

            switch (CMD)
            {
                case "New":
                    CMD_Txt = "增加";
                    //如果是增加操作,就调用Add方法
                    education_Activity_model.ActivityID = education_Activity_bll.Add(education_Activity_model);
                    break;
                case "Edit":
                    CMD_Txt = "修改";
                    //如果是修改操作,就调用Update方法
                    education_Activity_bll.Update(education_Activity_model);
                    break;
            }
            All_Title_Txt = CMD_Txt + App_Txt;
            //以下方法的第4个参数需要更改
            EventMessage.MessageBox(1, "操作成功", string.Format("{1}ID({0})成功!", education_Activity_model.ActivityID, All_Title_Txt), Icon_Type.OK, Common.GetHomeBaseUrl("default.aspx"));
        }
Пример #6
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.education_Activity bll = new Maticsoft.BLL.education_Activity();
     DataSet datas = bll.GetListByPage(SearchTerms, orderby, startIndex, endIndex);
     GridView1.DataSource = datas;
     GridView1.DataBind();
     this.AspNetPager1.RecordCount = bll.GetRecordCount(SearchTerms);
 }
Пример #7
0
 /// <summary>
 /// 在编辑的时候将对应的值绑定到Label上
 /// </summary>
 private void InputData()
 {
     Maticsoft.BLL.education_Activity education_Activity_bll = new Maticsoft.BLL.education_Activity();
     Maticsoft.Model.education_Activity education_Activity_model = education_Activity_bll.GetModel(ActivityID);
     if (education_Activity_model != null)
     {
         A_DateTime.Text = education_Activity_model.A_DateTime.ToShortDateString();
         A_Location.Text = education_Activity_model.A_Location;
         Maticsoft.BLL.sys_Group sys_Group_bll = new Maticsoft.BLL.sys_Group();
         Maticsoft.Model.sys_Group sys_Group_model = sys_Group_bll.GetModel(education_Activity_model.A_Object);
         A_Object.Value = education_Activity_model.A_Object + "";
         A_Object_input.Text = sys_Group_model.G_CName;
         A_Crowd.Text = education_Activity_model.A_Crowd;
         A_Form.Text = education_Activity_model.A_Form;
         A_Duration.Text = education_Activity_model.A_Duration + "";
         A_Organizers.Text = education_Activity_model.A_Organizers;
         A_Partners.Text = education_Activity_model.A_Partners;
         A_Missionary.Text = education_Activity_model.A_Missionary;
         A_Number.Text = education_Activity_model.A_Number + "";
         A_Theme.Text = education_Activity_model.A_Theme;
     }
 }
Пример #8
0
        /// <summary>
        /// 初始化
        /// </summary>
        private void OnStart()
        {
            if (CMD == "New")
            {

            }
            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&ActivityID={0}')", ActivityID);
                HeadMenuWebControls1.ButtonList.Add(bi2);

                InputData();
            }
            else if (CMD == "Delete")
            {
                Maticsoft.BLL.education_Activity bll = new Maticsoft.BLL.education_Activity();
                Maticsoft.Model.education_Activity model = bll.GetModel(ActivityID);
                bll.Delete(model.ActivityID);
                EventMessage.MessageBox(1, "操作成功", string.Format("{1}ID({0})成功!", ActivityID, "删除信息"), Icon_Type.OK, Common.GetHomeBaseUrl("default.aspx"));
            }
        }
Пример #9
0
        protected void btnSave_Click(object sender, EventArgs e)
        {
            string strErr = "";

            if (!PageValidate.IsDateTime(txtA_DateTime.Text))
            {
                strErr += "活动时间格式错误!\\n";
            }
            if (this.txtA_Location.Text.Trim().Length == 0)
            {
                strErr += "活动地点不能为空!\\n";
            }
            if (this.txtA_Form.Text.Trim().Length == 0)
            {
                strErr += "活动形式不能为空!\\n";
            }
            if (!PageValidate.IsNumber(txtA_Object.Text))
            {
                strErr += "居委会ID格式错误!\\n";
            }
            if (this.txtA_Crowd.Text.Trim().Length == 0)
            {
                strErr += "参与人群不能为空!\\n";
            }
            if (!PageValidate.IsNumber(txtA_Duration.Text))
            {
                strErr += "持续时间(min)格式错误!\\n";
            }
            if (this.txtA_Organizers.Text.Trim().Length == 0)
            {
                strErr += "主办单位不能为空!\\n";
            }
            if (this.txtA_Partners.Text.Trim().Length == 0)
            {
                strErr += "合作伙伴不能为空!\\n";
            }
            if (this.txtA_Missionary.Text.Trim().Length == 0)
            {
                strErr += "宣教人不能为空!\\n";
            }
            if (!PageValidate.IsNumber(txtA_Number.Text))
            {
                strErr += "参与人数格式错误!\\n";
            }
            if (this.txtA_Theme.Text.Trim().Length == 0)
            {
                strErr += "活动主题不能为空!\\n";
            }

            if (strErr != "")
            {
                MessageBox.Show(this, strErr);
                return;
            }
            DateTime A_DateTime   = DateTime.Parse(this.txtA_DateTime.Text);
            string   A_Location   = this.txtA_Location.Text;
            string   A_Form       = this.txtA_Form.Text;
            int      A_Object     = int.Parse(this.txtA_Object.Text);
            string   A_Crowd      = this.txtA_Crowd.Text;
            int      A_Duration   = int.Parse(this.txtA_Duration.Text);
            string   A_Organizers = this.txtA_Organizers.Text;
            string   A_Partners   = this.txtA_Partners.Text;
            string   A_Missionary = this.txtA_Missionary.Text;
            int      A_Number     = int.Parse(this.txtA_Number.Text);
            string   A_Theme      = this.txtA_Theme.Text;

            Maticsoft.Model.education_Activity model = new Maticsoft.Model.education_Activity();
            model.A_DateTime   = A_DateTime;
            model.A_Location   = A_Location;
            model.A_Form       = A_Form;
            model.A_Object     = A_Object;
            model.A_Crowd      = A_Crowd;
            model.A_Duration   = A_Duration;
            model.A_Organizers = A_Organizers;
            model.A_Partners   = A_Partners;
            model.A_Missionary = A_Missionary;
            model.A_Number     = A_Number;
            model.A_Theme      = A_Theme;

            Maticsoft.BLL.education_Activity bll = new Maticsoft.BLL.education_Activity();
            bll.Add(model);
            Maticsoft.Common.MessageBox.ShowAndRedirect(this, "保存成功!", "add.aspx");
        }
Пример #10
0
        protected void btnSave_Click(object sender, EventArgs e)
        {
            string strErr="";
            if(!PageValidate.IsDateTime(txtA_DateTime.Text))
            {
                strErr+="活动时间格式错误!\\n";
            }
            if(this.txtA_Location.Text.Trim().Length==0)
            {
                strErr+="活动地点不能为空!\\n";
            }
            if(this.txtA_Form.Text.Trim().Length==0)
            {
                strErr+="活动形式不能为空!\\n";
            }
            if(!PageValidate.IsNumber(txtA_Object.Text))
            {
                strErr+="居委会ID格式错误!\\n";
            }
            if(this.txtA_Crowd.Text.Trim().Length==0)
            {
                strErr+="参与人群不能为空!\\n";
            }
            if(!PageValidate.IsNumber(txtA_Duration.Text))
            {
                strErr+="持续时间(min)格式错误!\\n";
            }
            if(this.txtA_Organizers.Text.Trim().Length==0)
            {
                strErr+="主办单位不能为空!\\n";
            }
            if(this.txtA_Partners.Text.Trim().Length==0)
            {
                strErr+="合作伙伴不能为空!\\n";
            }
            if(this.txtA_Missionary.Text.Trim().Length==0)
            {
                strErr+="宣教人不能为空!\\n";
            }
            if(!PageValidate.IsNumber(txtA_Number.Text))
            {
                strErr+="参与人数格式错误!\\n";
            }
            if(this.txtA_Theme.Text.Trim().Length==0)
            {
                strErr+="活动主题不能为空!\\n";
            }

            if(strErr!="")
            {
                MessageBox.Show(this,strErr);
                return;
            }
            DateTime A_DateTime=DateTime.Parse(this.txtA_DateTime.Text);
            string A_Location=this.txtA_Location.Text;
            string A_Form=this.txtA_Form.Text;
            int A_Object=int.Parse(this.txtA_Object.Text);
            string A_Crowd=this.txtA_Crowd.Text;
            int A_Duration=int.Parse(this.txtA_Duration.Text);
            string A_Organizers=this.txtA_Organizers.Text;
            string A_Partners=this.txtA_Partners.Text;
            string A_Missionary=this.txtA_Missionary.Text;
            int A_Number=int.Parse(this.txtA_Number.Text);
            string A_Theme=this.txtA_Theme.Text;

            Maticsoft.Model.education_Activity model=new Maticsoft.Model.education_Activity();
            model.A_DateTime=A_DateTime;
            model.A_Location=A_Location;
            model.A_Form=A_Form;
            model.A_Object=A_Object;
            model.A_Crowd=A_Crowd;
            model.A_Duration=A_Duration;
            model.A_Organizers=A_Organizers;
            model.A_Partners=A_Partners;
            model.A_Missionary=A_Missionary;
            model.A_Number=A_Number;
            model.A_Theme=A_Theme;

            Maticsoft.BLL.education_Activity bll=new Maticsoft.BLL.education_Activity();
            bll.Add(model);
            Maticsoft.Common.MessageBox.ShowAndRedirect(this,"保存成功!","add.aspx");
        }