Example #1
0
        protected void DataBinds()
        {
            LabMS.BLL.ProfessionalPlan ProPlan = new LabMS.BLL.ProfessionalPlan();
            LabMS.Model.ProfessionalPlan proplanmodel = new LabMS.Model.ProfessionalPlan();
            proplanmodel = ProPlan.GetModel(QueryString);
              /* LabMS.BLL.Dictionary Dic = new LabMS.BLL.Dictionary();
            List<LabMS.Model.Dictionary> ls = new List<LabMS.Model.Dictionary>();
            ls = Dic.GetModelList("DClass='ruxuenianfen'");
            ddl_Year.DataTextField = "Name";
            ddl_Year.DataValueField = "Code";
            ddl_Year.DataSource = ls;
            ddl_Year.DataBind();
            */

            YearBind();

            LabMS.BLL.Professional Professional = new LabMS.BLL.Professional();
            List<LabMS.Model.Professional> ls1 = new List<LabMS.Model.Professional>();
            ls1 = Professional.GetModelList("");
            ddl_Pro.DataSource = ls1;
            ddl_Pro.DataTextField = "Pro_Name";
            ddl_Pro.DataValueField = "ID";
            ddl_Pro.DataBind();
            if (proplanmodel != null)
            {
                tb_Content.Text = proplanmodel.Pro_Content;
                if (proplanmodel.Pro_Curriculum == 1)
                {
                    ddl_Term.SelectedValue = "1";
                }
                else
                {
                    ddl_Term.SelectedValue="2";
                }
                if (ddl_Pro.Items.FindByValue(proplanmodel.Pro_Professional.ToString()) != null)
                {
                    ddl_Pro.Items.FindByValue(proplanmodel.Pro_Professional.ToString()).Selected = true;
                }
            }
            hf_ID.Value = QueryString.ToString();
        }
Example #2
0
        protected void btn_Save_Click(object sender, EventArgs e)
        {
            LabMS.BLL.ProfessionalPlan ProPlan = new LabMS.BLL.ProfessionalPlan();
            LabMS.Model.ProfessionalPlan model = new LabMS.Model.ProfessionalPlan();
            model = ProPlan.GetModel(QueryString);
            model.Pro_Content = tb_Content.Text;

            model.Pro_SubmitTime = DateTime.Now;
            int Year = 0;
            if (int.TryParse(ddl_Year.SelectedValue, out Year))
            {
                model.Pro_Year = Year;
            }
            else
            {
                model.Pro_Year = DateTime.Now.Year;
            }
            int Term = 0;
            if (int.TryParse(ddl_Term.SelectedValue, out Term))
            {
                model.Pro_Curriculum = Term;
            }

            int ProID = 0;
            if (int.TryParse(ddl_Pro.SelectedValue, out ProID))
            {
                model.Pro_Professional = ProID;
            }

            try
            {
                ProPlan.Update(model);
                Page.ClientScript.RegisterClientScriptBlock(GetType(), "script", "<script type='text/javascript'>alert('�����ɹ�');window.location.href='proplanpreview.aspx?id="+QueryString+"';</script>");
            }
            catch
            {
                LabMS.Common.JShelper.JSAlert(this, "�������", "����ʧ�ܣ�������ݺ������ύ");
            }
        }
Example #3
0
        protected void DataBinds()
        {
            tb_Content.Attributes.Add("readonly", "readonly");
            LabMS.BLL.ProfessionalPlan ProPlan = new LabMS.BLL.ProfessionalPlan();
            LabMS.Model.ProfessionalPlan model = new LabMS.Model.ProfessionalPlan();

            model = ProPlan.GetModel(QueryString);
            LabMS.Model.Professional professionalmodel = new LabMS.Model.Professional();
            LabMS.BLL.Professional Profess = new LabMS.BLL.Professional();
            professionalmodel = Profess.GetModel(model.Pro_Professional.Value);

            lb_Pro.Text = professionalmodel.Pro_Name;
            if (model.Pro_Curriculum == 1)
            {
                lb_Term.Text = "��ѧ��";
            }
            else
            {
                lb_Term.Text = "��ѧ��";
            }
            lb_Year.Text = model.Pro_Year.ToString();
            tb_Content.Text = model.Pro_Content;
            hf_ID.Value = QueryString.ToString();
        }