예제 #1
0
 protected void Save_Click(object sender, EventArgs e)
 {
     LabMS.BLL.ProfessionalPlan ProPlan = new LabMS.BLL.ProfessionalPlan();
     LabMS.Model.ProfessionalPlan model = new LabMS.Model.ProfessionalPlan();
     model.Pro_Content = tb_Content.Text;
     model.Pro_Professional = Convert.ToInt32(ddl_Pro.SelectedValue.Trim());
     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 = int.Parse(ddl_Term.SelectedValue);
     }
     try
     {
         ProPlan.Add(model);
         Page.ClientScript.RegisterClientScriptBlock(GetType(), "script", "<script type='text/javascript'>alert('�����ɹ�');window.location.href='ProPlanList.aspx';</script>");
     }
     catch
     {
         LabMS.Common.JShelper.JSAlert(this, "�������", "����ʧ�ܣ�������ݺ������ύ");
     }
 }
예제 #2
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();
        }
예제 #3
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, "�������", "����ʧ�ܣ�������ݺ������ύ");
            }
        }
예제 #4
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();
        }
예제 #5
0
        /// <summary>
        /// �õ�һ������ʵ��
        /// </summary>
        public LabMS.Model.ProfessionalPlan GetModel(int ID)
        {
            StringBuilder strSql=new StringBuilder();
            strSql.Append("select  top 1 ID,Pro_Year,Pro_SubmitTime,Pro_Professional,Pro_Curriculum,Pro_Content from ProfessionalPlan ");
            strSql.Append(" where ID=@ID ");
            SqlParameter[] parameters = {
                    new SqlParameter("@ID", SqlDbType.Int,4)};
            parameters[0].Value = ID;

            LabMS.Model.ProfessionalPlan model=new LabMS.Model.ProfessionalPlan();
            DataSet ds=DbHelperSQL.Query(strSql.ToString(),parameters);
            if(ds.Tables[0].Rows.Count>0)
            {
                if(ds.Tables[0].Rows[0]["ID"].ToString()!="")
                {
                    model.ID=int.Parse(ds.Tables[0].Rows[0]["ID"].ToString());
                }
                if(ds.Tables[0].Rows[0]["Pro_Year"].ToString()!="")
                {
                    model.Pro_Year=int.Parse(ds.Tables[0].Rows[0]["Pro_Year"].ToString());
                }
                if(ds.Tables[0].Rows[0]["Pro_SubmitTime"].ToString()!="")
                {
                    model.Pro_SubmitTime=DateTime.Parse(ds.Tables[0].Rows[0]["Pro_SubmitTime"].ToString());
                }
                if(ds.Tables[0].Rows[0]["Pro_Professional"].ToString()!="")
                {
                    model.Pro_Professional=int.Parse(ds.Tables[0].Rows[0]["Pro_Professional"].ToString());
                }
                if(ds.Tables[0].Rows[0]["Pro_Curriculum"].ToString()!="")
                {
                    model.Pro_Curriculum=int.Parse(ds.Tables[0].Rows[0]["Pro_Curriculum"].ToString());
                }
                model.Pro_Content=ds.Tables[0].Rows[0]["Pro_Content"].ToString();
                return model;
            }
            else
            {
                return null;
            }
        }