Ejemplo n.º 1
0
    private void InitData()
    {
        int id = 0;

        if (int.TryParse(Request.QueryString["id"] + "", out id) && id > 0)
        {
            examModel = bllExam.GetModel(id);
            if (examModel == null || (personModel.id != 0 && examModel.PersonID.Value != personModel.id))
            {
                examModel = new TFXK.Model.TestingPersonExam();
                return;
            }


            //if (examModel.TypeID != null) {
            //    return;
            //}
            planModel = bllPlan.GetModel(examModel.TypeID.Value);
            if (planModel == null)
            {
                planModel = new TFXK.Model.TestingPersonPlan();
                return;
            }
        }
    }
Ejemplo n.º 2
0
 private void InitExamData(int exid)
 {
     examModel = bllTestingPersonExam.GetModel(exid);
     if (examModel.TypeID != null && examModel.TypeID.Value != 0)
     {
         planModel = bllPlan.GetModel(examModel.TypeID.Value);
         if (planModel == null)
         {
             Response.Redirect("Default.aspx");
             Response.End();
         }
     }
 }
Ejemplo n.º 3
0
    private void InitExamData(int exid)
    {
        planModel = bllPlan.GetModel(exid);
        if (planModel == null)
        {
            Response.Redirect("Default.aspx");
            Response.End();
        }

        subClassList = bllCategory.GetModelList(" id in(" + planModel.TestingSubClass + ")");

        ddlClass.DataSource = subClassList;
        ddlClass.DataBind();
    }
Ejemplo n.º 4
0
    private void Add(TFXK.Model.TestingPersonPlan model)
    {
        int rows = bll.Add(model);

        hdfPid.Value = rows + "";
        if (rows > 0)
        {
            Msg.ShowAndRedirect("添加信息成功!", "Default.aspx");
        }
        else
        {
            Msg.Show("添加信息失败!");
        }
    }
Ejemplo n.º 5
0
    private void InitExamData(int exid)
    {
        examModel = bllTestingPersonExam.GetModel(exid);
        if (examModel.TypeID != null && examModel.TypeID.Value != 0)
        {
            planModel = bllPlan.GetModel(examModel.TypeID.Value);
            if (planModel == null)
            {
                Response.Redirect("Default.aspx");
                Response.End();
            }

            NeedPayTotal = GetPayMoney(examModel.TypeID + "", examModel.ClassLevel).ToString("n2");
        }
    }
Ejemplo n.º 6
0
    private void InitData(int id)
    {
        //this.txtDate.EditFormatString = "yyyy-MM-dd HH:mm";
        //this.txtDate.DisplayFormatString = "yyyy-MM-dd HH:mm";
        //this.txtEndTime.EditFormatString = "yyyy-MM-dd HH:mm";
        //this.txtEndTime.DisplayFormatString = "yyyy-MM-dd HH:mm";
        //txtDate.Properties.VistaDisplayMode = DevExpress.Utils.DefaultBoolean.True;
        //txtDate.Properties.VistaEditTime = DevExpress.Utils.DefaultBoolean.True;
        TFXK.Model.TestingPersonPlan model = bll.GetModel(id);
        if (model != null)
        {
            txtTitle.Text = model.TestingTitle;
            if (model.TestTimeAMStart.HasValue)
            {
                this.txtStartTime.Value = model.TestTimeAMStart.Value.ToString("yyyy-MM-dd HH:mm:ss");
            }
            if (model.TestTimeAMStart.HasValue)
            {
                this.txtEndTime.Value = model.TestTimeAMEnd.Value.ToString("yyyy-MM-dd HH:mm:ss");
            }

            if (model.TestTimePMStart.HasValue)
            {
                this.txtCheckStartTime.Value = model.TestTimePMStart.Value.ToString("yyyy-MM-dd HH:mm:ss");
            }
            if (model.TestTimePMStart.HasValue)
            {
                this.txtCheckEndTime.Value = model.TestTimePMEnd.Value.ToString("yyyy-MM-dd HH:mm:ss");
            }

            if (model.CreateTime.HasValue)
            {
                this.txtCreateTime.Value = model.CreateTime.Value.ToString("yyyy-MM-dd HH:mm:ss");
            }
            txtContent.Value         = model.Description;
            this.txtAddress.Text     = model.Address;
            txtTotalCount.Text       = model.TotalCount + "";
            ddlState.SelectedValue   = model.Status + "";
            txtOrderby.Text          = model.OrderNum + "";
            this.txtNumberPrefx.Text = model.NumberPrefx;
            this.txtNumberEnd.Text   = model.NumberStart;
            if (!string.IsNullOrEmpty(model.TestingSubClass))
            {
                subClass = model.TestingSubClass.Split(',');
            }
        }
    }
Ejemplo n.º 7
0
 /// <summary>
 /// 更新一条数据
 /// </summary>
 public bool Update(TFXK.Model.TestingPersonPlan model)
 {
     return(dal.Update(model));
 }
Ejemplo n.º 8
0
 /// <summary>
 /// 增加一条数据
 /// </summary>
 public int  Add(TFXK.Model.TestingPersonPlan model)
 {
     return(dal.Add(model));
 }
Ejemplo n.º 9
0
 private void Modify(TFXK.Model.TestingPersonPlan model)
 {
     bll.Update(model);
     hdfPid.Value = model.id + "";
     Msg.ShowAndRedirect("修改信息成功!", "Default.aspx");
 }
Ejemplo n.º 10
0
    protected void ibtnAdd_Click(object sender, EventArgs e)
    {
        //验证代码
        try
        {
            StringBuilder strClassIds = new StringBuilder();
            foreach (RepeaterItem rptParItem in this.rptClass.Items)
            {
                Repeater rplChild = (Repeater)rptParItem.FindControl("rptCheckList");
                if (rplChild == null)
                {
                    continue;
                }
                foreach (RepeaterItem rptItem in rplChild.Items)
                {
                    HtmlInputCheckBox inputCheck = rptItem.FindControl("chkSubClass") as HtmlInputCheckBox;
                    try
                    {
                        if (inputCheck.Checked)
                        {
                            int iid = int.Parse(inputCheck.Value);
                            strClassIds.AppendFormat("{0},", iid);
                        }
                    }
                    catch
                    {
                        break;
                    }
                }
            }
            if (string.IsNullOrEmpty(txtTitle.Text.Trim()))
            {
                Msg.Show("请输入考级标题");
                return;
            }

            if (string.IsNullOrEmpty(strClassIds + ""))
            {
                Msg.Show("请选择考试分类");
                return;
            }
            if (string.IsNullOrEmpty(txtTotalCount.Text.Trim()))
            {
                Msg.Show("请输入计划人数");
                return;
            }



            if (string.IsNullOrEmpty(txtNumberPrefx.Text.Trim() + ""))
            {
                Msg.Show("请输入固定编号");
                return;
            }
            if (string.IsNullOrEmpty(txtNumberEnd.Text.Trim()))
            {
                Msg.Show("请输入结尾编号,数字自增");
                return;
            }

            TFXK.Model.TestingPersonPlan model = new TFXK.Model.TestingPersonPlan();
            try
            {
                int id = int.Parse(Request.QueryString["id"].ToString());
                model = bll.GetModel(id);
            }
            catch { model.id = 0; }
            model.TestingSubClass = strClassIds.ToString().TrimEnd(',');
            model.TestingTitle    = txtTitle.Text;
            model.Address         = this.txtAddress.Text;
            model.OrderNum        = int.Parse(this.txtOrderby.Text.Equals("") ? "0" : this.txtOrderby.Text);
            model.TestTimeAMStart = DateTime.Parse(this.txtStartTime.Value);
            model.TestTimeAMEnd   = DateTime.Parse(this.txtEndTime.Value);

            model.TestTimePMStart = DateTime.Parse(this.txtCheckStartTime.Value);
            model.TestTimePMEnd   = DateTime.Parse(this.txtCheckEndTime.Value);

            model.CreateTime  = DateTime.Parse(this.txtCreateTime.Value);
            model.Description = this.txtContent.Value;
            model.Status      = int.Parse(this.ddlState.SelectedValue);
            model.TotalCount  = int.Parse(this.txtTotalCount.Text);

            model.NumberPrefx = this.txtNumberPrefx.Text;
            model.NumberStart = this.txtNumberEnd.Text;
            string type = this.hdfAction.Value.Trim();
            // 判断动作
            switch (type)
            {
            case "add":
                Add(model);
                model.NumberIndex = int.Parse(model.NumberStart.TrimStart('0'));
                break;

            case "modify":
                Modify(model);
                break;
            }
        }
        catch (Exception ex)
        {
            log.Error(ex.Message);
            Msg.Show("网络错误!原因:" + ex.Message);
        }
    }