protected void Page_Load(object sender, EventArgs e)
 {
     if (!IsPostBack)
     {
         int nID = 0;
         if (Request.QueryString["nID"] != null && int.TryParse(Request.QueryString["nID"].ToString(), out nID) && nID > 0)
         {
             lblBigtitle.Text  = "编辑数据";
             BtnAdd.Visible    = false;
             btnUpdate.Visible = true;
             DBLL.clsProductCategory clProductCategory = new DBLL.clsProductCategory();
             DataTable dt = clProductCategory.Select_tb_ProductCategoryBynProductCategoryID(nID);
             if (dt != null && dt.Rows.Count > 0)
             {
                 hfID.Value = dt.Rows[0]["nProductCategoryID"].ToString();
                 txtsProductCategoryNameCN.Text = dt.Rows[0]["sProductCategoryNameCN"].ToString();
                 txtsProductCategoryNameEN.Text = dt.Rows[0]["sProductCategoryNameEN"].ToString();
                 txtnSorting.Text = dt.Rows[0]["nSorting"].ToString();
                 //绑定数据
             }
         }
         else
         {
             lblBigtitle.Text  = "添加数据";
             btnUpdate.Visible = false;
             BtnAdd.Visible    = true;
         }
     }
 }
Пример #2
0
 protected void BtnAdd_Click(object sender, EventArgs e)
 {
     //判断session
     if (Session["User"] == null || Session["User"].ToString().Length < 1)
     {
         Response.Redirect(Request.RawUrl);
     }
     if (ValiAdd())
     {
         DBLL.clsProductCategory ProductCategory = new DBLL.clsProductCategory();
         DBLL.OptionSysDBLL      option          = new DBLL.OptionSysDBLL();
         int _Result = ProductCategory.insert_tb_ProductCategory(ddlProductCateTreelist1.nSelectProductCategoryID, txtsProductCategoryNameCN.Text, txtsProductCategoryNameEN.Text, CKEditorControl1.Text, CKEditorControl2.Text, Session["User"].ToString(), DateTime.Now, Session["User"].ToString(), DateTime.Now, true, int.Parse(ddlnSorting.SelectedValue));
         if (_Result > 0)
         {
             ShowMsg1.InnerContent = option.GetOptionValue("FormatSetting", "CommandControl", "InsertSuccess");
             ShowMsg1.Show();
             Clear();
         }
         else
         {
             ShowMsg1.InnerContent = option.GetOptionValue("FormatSetting", "CommandControl", "InsertFail");
             ShowMsg1.Show();
         }
     }
     else
     {
         ShowMsg1.Show();
     }
 }
Пример #3
0
    protected void lvProductCategoryList_SelectedIndexChanging(object sender, ListViewSelectEventArgs e)
    {
        Label lblnID = (Label)lvProductCategoryList.Items[e.NewSelectedIndex].FindControl("lblnProductCategoryID");
        int   _nID   = 0;

        DBLL.clsProductCategory ProductCategory = new DBLL.clsProductCategory();
        if (int.TryParse(lblnID.Text.Trim(), out _nID) && _nID > 0)
        {
            DBLL.DBcommon dbcom = new DBLL.DBcommon();
            Model.dsProduct.tb_ProductCategoryDataTable ProductList = new Model.dsProduct.tb_ProductCategoryDataTable();
            ProductList.Merge(dbcom.selectNormalTableofAll(false, "tb_ProductCategory"));
            ddlProductCateTreelist1.ProductList = ProductList;
            ddlProductCateTreelist1.Fresh();

            MultiView1.ActiveViewIndex = 1;
            DataTable dt = ProductCategory.Select_tb_ProductCategoryBynProductCategoryID(_nID);
            txtsProductCategoryNameCN.Text = dt.Rows[0]["sProductCategoryNameCN"].ToString();
            txtsProductCategoryNameEN.Text = dt.Rows[0]["sProductCategoryNameEN"].ToString();
            CKEditorControl1.Text          = dt.Rows[0]["sContentCN"].ToString();
            CKEditorControl2.Text          = dt.Rows[0]["sContentEN"].ToString();
            lblPCID.Text = dt.Rows[0]["nParentCategoryID"].ToString();
            //ddlProductCateTreelist1.nSelectProductCategoryID = int.Parse(dt.Rows[0]["nParentCategoryID"].ToString());
            ddlProductCateTreelist1.setnSelectID(int.Parse(dt.Rows[0]["nParentCategoryID"].ToString()));
            ddlnSorting.SelectedValue       = dt.Rows[0]["nSorting"].ToString();
            hfProductCategoryUpdateID.Value = _nID.ToString();
        }
    }
Пример #4
0
    protected void lvProductList_ItemDataBound(object sender, ListViewItemEventArgs e)
    {
        try
        {

            DBLL.OptionSysDBLL option = new DBLL.OptionSysDBLL();
            DBLL.clsProductCategory ProductCategory = new DBLL.clsProductCategory();
            if (e.Item.ItemType == ListViewItemType.DataItem)
            {
                int nType = 0;
                Label lblnProductCategoryID = (Label)e.Item.FindControl("lblnProductCategoryID");
                if (int.TryParse(lblnProductCategoryID.Text, out nType))
                {
                    nType = int.Parse(lblnProductCategoryID.Text);
                    string sTopicName = ProductCategory.Select_tb_ProductCategoryBynProductCategoryID(nType).Rows[0]["sProductCategoryNameCN"].ToString();
                    lblnProductCategoryID.Text = sTopicName;
                }
            }
            ImageButton imgDelete = (ImageButton)e.Item.FindControl("imgDelete");
            imgDelete.OnClientClick = "javascript:if (confirm('" + option.GetOptionValue("FormatSetting", "CommandControl", "bIsDelete") + "')){$('#EntryForm').block({ message: null });}else{return false;}";

        }
        catch (Exception)
        {

        }
    }
Пример #5
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;
        }
    }
Пример #6
0
    protected bool ValiAdd()
    {
        bool bcheck = true;

        ShowMsg1.InnerContent = "";
        DBLL.clsProductCategory ProductCategory = new DBLL.clsProductCategory();
        DataTable dt = new DataTable();

        dt = ProductCategory.Select_tb_ProductCategoryBynParentCategoryID(ddlProductCateTreelist2.nSelectProductCategoryID);
        if (dt != null)
        {
            ShowMsg1.InnerContent += "你选择的产品类型不是最尾级,请确认<br/>";
            bcheck = false;
        }
        if (string.IsNullOrEmpty(txtsProductNameCN.Text))
        {
            ShowMsg1.InnerContent += "产品名称(中文)不能为空<br/>";
            bcheck = false;
        }
        if (string.IsNullOrEmpty(txtsProductNameEN.Text))
        {
            ShowMsg1.InnerContent += "产品名称(英文)不能为空<br/>";
            bcheck = false;
        }
        return(bcheck);
    }
Пример #7
0
 protected void Page_Load(object sender, EventArgs e)
 {
     if (!IsPostBack)
     {
         DBLL.clsProductCategory clspdc = new DBLL.clsProductCategory();
         lvProCate.DataSource = TopicCateDataTable;
         lvProCate.DataBind();
     }
 }
Пример #8
0
 public void setnSelectID(int nSelectPCID)
 {
     nSelectProductCategoryID = nSelectPCID;
     DBLL.clsProductCategory clspc = new DBLL.clsProductCategory();
     Model.dsProduct.tb_ProductCategoryDataTable pcdt = new Model.dsProduct.tb_ProductCategoryDataTable();
     if (pcdt != null && pcdt.Rows.Count > 0)
     {
         pcdt.Merge(clspc.Select_tb_ProductCategoryBynProductCategoryID(nSelectPCID));
         txtProducCateID.Text = pcdt.Rows[0]["sProductCategoryNameCN"].ToString();
     }
     else
     {
         txtProducCateID.Text = "没有上级产品类";
     }
 }
Пример #9
0
    public void setnSelectID(int nSelectPCID)
    {
        nSelectProductCategoryID = nSelectPCID;
        DBLL.clsProductCategory clspc = new DBLL.clsProductCategory();
        DBLL.DBcommon           DBc   = new DBLL.DBcommon();
        DataTable pcdt = new DataTable();

        pcdt = DBc.selectNormalTableofAll(false, "tb_ProductCategory");
        if (pcdt != null && pcdt.Rows.Count > 0)
        {
            pcdt.Merge(clspc.Select_tb_ProductCategoryBynProductCategoryID(nSelectPCID));
            txtProducCateID.Text = pcdt.Rows[0]["sProductCategoryNameCN"].ToString();
        }
        else
        {
            txtProducCateID.Text = "没有上级产品类";
        }
    }
Пример #10
0
    public void ReBindPageList()
    {
        DBLL.clsProductCategory ProductCategory = new DBLL.clsProductCategory();
        DataTable dt = new DataTable();

        dt = ProductCategory.sp_selectNormalTableOfAllByProductCategory(false);
        if (dt != null)
        {
            ProductList.Merge(dt);
            lvProductCategoryList.DataSource = ProductList;
            lvProductCategoryList.DataBind();
        }
        else
        {
            lvProductCategoryList.DataSource = null;
            lvProductCategoryList.DataBind();
        }
    }
Пример #11
0
    public void Bind(int nProductID)
    {
        DBLL.clsProduct         clspro     = new DBLL.clsProduct();
        DBLL.clsProductCategory clsprocate = new DBLL.clsProductCategory();
        DataTable dtpro = clspro.Select_tb_ProductBynProductID(nProductID);

        if (dtpro != null && dtpro.Rows.Count > 0)
        {
            Panel1.Visible = false;
            Panel2.Visible = true;
            DataRow   dtprorow  = dtpro.Rows[0];
            DataTable dtprocate = clsprocate.Select_tb_ProductCategoryBynProductCategoryID(int.Parse(dtprorow["nProductCategoryID"].ToString()));
            if (Session["languageGlobal"] == "en")
            {
                lblProductName.Text      = dtprorow["sProductNameEN"].ToString();
                lblProductCate.Text      = dtprocate.Rows[0]["sProductCategoryNameEN"].ToString();
                lblsBrandName.Text       = dtprorow["sBrandNameEN"].ToString();
                divProductInfo.InnerHtml = dtprorow["sIntroEN"].ToString();
                divProductCate.InnerHtml = dtprorow["sSummaryEN"].ToString();
                IMGbig.ImageUrl          = dtprorow["sPImagePath"].ToString();
                //lblSensitivity.Text = dtprorow["sEnsitivityCN"].ToString();
                //lblchannelbalance.Text = dtprorow["sChannelBalanceCN"].ToString();
                //lblimpedance.Text = dtprorow["sImpedanceCN"].ToString();
                //lblfrequencyrange.Text = dtprorow["sFrequencyCN"].ToString();
                //lblratedpower.Text = dtprorow["sRatedPowerCN"].ToString();
                //lblmaximumpower.Text = dtprorow["sMaximumPowerCN"].ToString();
            }
            else
            {
                lblProductName.Text      = dtprorow["sProductNameCN"].ToString();
                lblProductCate.Text      = dtprocate.Rows[0]["sProductCategoryNameCN"].ToString();
                lblsBrandName.Text       = dtprorow["sBrandNameCN"].ToString();
                divProductInfo.InnerHtml = dtprorow["sIntroCN"].ToString();
                divProductCate.InnerHtml = dtprorow["sSummaryCN"].ToString();
                IMGbig.ImageUrl          = dtprorow["sPImagePath"].ToString();
                //lblSensitivity.Text = dtprorow["sEnsitivityEN"].ToString();
                //lblchannelbalance.Text = dtprorow["sChannelBalanceEN"].ToString();
                //lblimpedance.Text = dtprorow["sImpedanceEN"].ToString();
                //lblfrequencyrange.Text = dtprorow["sFrequencyEN"].ToString();
                //lblratedpower.Text = dtprorow["sRatedPowerEN"].ToString();
                //lblmaximumpower.Text = dtprorow["sMaximumPowerEN"].ToString();
            }
        }
    }
 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;
     }
 }
Пример #13
0
    protected void Page_Load(object sender, EventArgs e)
    {
        OnSetLanguage();
        if (!IsPostBack)
        {
            Panel1.Visible = true;
            Panel2.Visible = false;
            DBLL.clsProductCategory clspc = new DBLL.clsProductCategory();
            DBLL.DBcommon           dbcom = new DBLL.DBcommon();
            DataTable dtProductCategory   = dbcom.selectNormalTableofAll(false, "tb_ProductCategory");


            DBLL.TreeViewFromTableBLL tvfbll = new DBLL.TreeViewFromTableBLL();


            tvfbll.nRootParentID      = 0;
            tvfbll.FatherIDColumnName = dtProductCategory.Columns["nParentCategoryID"].ColumnName;
            //   tvfbll.NavigateUrlColumnName = "ProductList.aspx?nProductCategoryIDColumn=" + pcdt.nProductCategoryIDColumn.ColumnName;
            tvfbll.NodeValueColumnName = dtProductCategory.Columns["nProductCategoryID"].ColumnName;
            if (Session["languageGlobal"] == "en")
            {
                tvfbll.NodeTextColumnName = dtProductCategory.Columns["sProductCategoryNameEN"].ColumnName;
            }
            else
            {
                tvfbll.NodeTextColumnName = dtProductCategory.Columns["sProductCategoryNameCN"].ColumnName;
            }
            tvfbll.bIsClick = true;


            TreeNode[] nodepages = tvfbll.GetTreeNodes(dtProductCategory);
            TreeView1.Nodes.Clear();
            if (nodepages != null && nodepages.Length > 0)
            {
                for (int i = 0; i < nodepages.Length; i++)
                {
                    if (nodepages[i].Text.Length > 18)
                    {
                        nodepages[i].ToolTip = nodepages[i].Text;
                        nodepages[i].Text    = nodepages[i].Text.Substring(0, 18) + "...";
                    }
                    TreeView1.Nodes.Add(nodepages[i]);
                }
            }
            TreeView1.ExpandDepth = 1;



            DataTable dtProduct = dbcom.selectNormalTableofAll(false, "tb_Product");
            DataTableProduct = dtProduct;
            BindProductData(dtProduct);


            string sMenuname = "";
            if (Session["languageGlobal"] == "en")
            {
                sMenuname = "sProductCategoryNameEN";
            }
            else
            {
                sMenuname = "sProductCategoryNameCN";
            }
            if (dtProductCategory != null && dtProductCategory.Rows.Count > 0)
            {
                foreach (DataRow row in dtProductCategory.Rows)
                {
                    MenuItem menuitem1 = new MenuItem(row[sMenuname].ToString(), row["nProductCategoryID"].ToString(), "~/style/images/newsfront.gif");
                    Menu1.Items.Add(menuitem1);
                }
            }

            int nProductID = 0;
            if (Request.QueryString["nProductID"] != null && int.TryParse(Request.QueryString["nProductID"], out nProductID))
            {
                if (nProductID > 0)
                {
                    Bind(nProductID);
                }
            }
        }
    }