示例#1
0
    protected void BtnUpdate_Click(object sender, EventArgs e)
    {
        //判断session
        if (Session["User"] == null || Session["User"].ToString().Length < 1)
        {
            Response.Redirect(Request.RawUrl);
        }
        try
        {
            if (ValiEdit())
            {
                DBLL.clsProductCategory ProductCategory = new DBLL.clsProductCategory();
                DBLL.OptionSysDBLL      option          = new DBLL.OptionSysDBLL();
                bool _Result = ProductCategory.update_tb_ProductCategoryBynProductCategoryID(int.Parse(hfProductCategoryUpdateID.Value), ddlProductCateTreelist1.nSelectProductCategoryID, txtsProductCategoryNameCN.Text, txtsProductCategoryNameEN.Text, CKEditorControl1.Text, CKEditorControl2.Text, Session["User"].ToString(), DateTime.Now, true, int.Parse(ddlnSorting.SelectedValue));

                if (_Result == true)
                {
                    ShowMsg1.InnerContent = option.GetOptionValue("FormatSetting", "CommandControl", "InsertSuccess");
                    ShowMsg1.Show();
                    MultiView1.ActiveViewIndex = 0;
                    ReBindPageList();
                }
                else
                {
                    ShowMsg1.InnerContent = option.GetOptionValue("FormatSetting", "CommandControl", "InsertFail");
                    ShowMsg1.Show();
                }
            }
        }
        catch (Exception)
        {
            throw;
        }
    }
 protected void btnUpdate_Click(object sender, EventArgs e)
 {
     //判断session
     if (Session["User"] == null || Session["User"].ToString().Length < 1)
     {
         Response.Redirect(Request.RawUrl);
     }
     try
     {
         int nID = 0;
         if (int.TryParse(hfID.Value.ToString(), out nID) && nID > 0)
         {
             //更新
             if (ValiEdit())
             {
                 DBLL.clsProductCategory ProductCategory = new DBLL.clsProductCategory();
                 DBLL.OptionSysDBLL      option          = new DBLL.OptionSysDBLL();
                 bool _Result = ProductCategory.update_tb_ProductCategoryBynProductCategoryID(nID, 0, txtsProductCategoryNameCN.Text, txtsProductCategoryNameEN.Text, "", "", Session["user"].ToString(), DateTime.Now, true, int.Parse(txtnSorting.Text));
                 if (_Result == true)
                 {
                     ShowMsg1.InnerContent = option.GetOptionValue("FormatSetting", "CommandControl", "UpdateSuccess");
                     ShowMsg1.Show();
                 }
                 else
                 {
                     //失败就一条
                     ShowMsg1.InnerContent = option.GetOptionValue("FormatSetting", "CommandControl", "UpdateFail");
                     ShowMsg1.Show();
                 }
             }
             else
             {
                 ShowMsg1.Show();
             }
         }
     }
     catch (Exception)
     {
         throw;
     }
 }