Esempio n. 1
0
        protected void Page_Load(object sender, EventArgs e)
        {
            strPagePrivilege.Add("BKGL");
            strPageUserType.Add("mana");

            if (!Page.IsPostBack)
            {
                if (!string.IsNullOrEmpty(Request.QueryString["plateID"]))
                {
                    int id = 0;

                    if (!int.TryParse(Request.QueryString["plateID"], out id))
                    {
                        throw new Exception("�������ʵ�ҳ�治����!");
                    }

                    LabMS.BLL.PostPlate pp = new LabMS.BLL.PostPlate();
                    LabMS.Model.PostPlate ppInfo = pp.GetModel(id);

                    if (ppInfo == null)
                    {
                        throw new Exception("�������ʵ�ҳ�治����!");
                    }

                    PlateTitle.Text = ppInfo.Name;
                    PlateDescripttion.Text = ppInfo.Description;
                }
                else
                {
                    throw new Exception("�������ʵ�ҳ�治����!");
                }
            }
        }
Esempio n. 2
0
        /// <summary>
        /// Modify
        /// </summary>
        /// <param name="sender"></param>
        /// <param name="e"></param>
        protected void BtnSubmit_Click(object sender, EventArgs e)
        {
            #region Validation

            if (string.IsNullOrEmpty(PlateTitle.Text.Trim())) { WriteBackScript("alert('���������ⲻ��Ϊ��!')"); return; }

            if (PlateDescripttion.Text.Length > 500) { WriteBackScript("alert('�������������Ȳ��ܳ���500�ַ�!')"); return; }

            #endregion

            int id = int.Parse(Request.QueryString["plateID"]);

            LabMS.BLL.PostPlate pp = new LabMS.BLL.PostPlate();
            LabMS.Model.PostPlate ppInfo = pp.GetModel(id);

            if (ppInfo == null)
            {
                WriteBackScript("alert('��ǰ����Ѿ�����һ����ɾ��!');window.returnValue=true;window.close();");
                return;
            }

            ppInfo.Name = PlateTitle.Text;
            ppInfo.Description = PlateDescripttion.Text;

            pp.Update(ppInfo);

            WriteBackScript("alert('�޸ijɹ�!');window.returnValue=true;window.close();");
        }
Esempio n. 3
0
        /// <summary>
        /// 
        /// </summary>
        /// <param name="sender"></param>
        /// <param name="e"></param>
        protected void BtnSubmit_Click(object sender, EventArgs e)
        {
            #region Validation

            if (string.IsNullOrEmpty(PlateTitle.Text.Trim())) { WriteBackScript("alert('���������ⲻ��Ϊ��!')"); return; }

            if (PlateDescripttion.Text.Length > 500) { WriteBackScript("alert('�������������Ȳ��ܳ���500�ַ�!')"); return; }

            #endregion

            LabMS.BLL.PostPlate bll = new LabMS.BLL.PostPlate();
            LabMS.Model.PostPlate plate = new LabMS.Model.PostPlate();

            plate.Description = PlateDescripttion.Text;
            plate.Name = PlateTitle.Text;

            if (SectionList.Visible != false)
            {
                plate.ParentID = int.Parse(SectionList.SelectedValue);
                plate.ID = bll.Add(plate);
                WriteBackScript("alert('��Ӱ��ɹ�!');window.location.href='Index.aspx';");
            }
            else
            {
                plate.ParentID = int.Parse(Request.QueryString["sectionID"]);
                plate.ID = bll.Add(plate);
                WriteBackScript("alert('��Ӱ��ɹ�!');window.returnValue=true;window.close();");
            }
        }
Esempio n. 4
0
        protected void Page_Load(object sender, EventArgs e)
        {
            if (!Page.IsPostBack)
            {
                if (!string.IsNullOrEmpty(Request.QueryString["plateID"]))
                {
                    int id = 0;

                    if (!int.TryParse(Request.QueryString["plateID"], out id))
                    {
                        throw new Exception("你所访问的页面不存在!");
                    }

                    LabMS.BLL.PostPlate pp = new LabMS.BLL.PostPlate();
                    LabMS.Model.PostPlate ppInfo = pp.GetModel(id);

                    if (ppInfo == null)
                    {
                        throw new Exception("你所访问的页面不存在!");
                    }

                    PlateName.Text = ppInfo.Name;
                }
                else
                {
                    throw new Exception("你所访问的页面不存在!");
                }
            }
        }
Esempio n. 5
0
        /// <summary>
        /// 
        /// </summary>
        /// <param name="sender"></param>
        /// <param name="e"></param>
        protected void BtnSubmit_Click(object sender, EventArgs e)
        {
            #region Validation

            if (string.IsNullOrEmpty(SectionTitle.Text.Trim())) { WriteBackScript("alert('���������ⲻ��Ϊ��!')"); return; }

            if (SectionDescripttion.Text.Length > 500) { WriteBackScript("alert('�������������Ȳ��ܳ���500�ַ�!')"); return; }

            #endregion

            LabMS.BLL.PostPlate bll = new LabMS.BLL.PostPlate();
            LabMS.Model.PostPlate plate = new LabMS.Model.PostPlate();

            plate.Description = SectionDescripttion.Text;
            plate.Name = SectionTitle.Text;
            plate.ParentID = 1;

            plate.ID = bll.Add(plate);

            WriteBackScript("alert('��ӷ����ɹ�!');window.returnValue=true;window.close();");
        }