Example #1
0
        public string GetProductModelAndName(HttpContext context)
        {
            string jsonStr      = string.Empty;
            int    Language     = Convert.ToInt32(context.Request.Params["lang"]);
            string ProductModel = context.Request.Params["ProductModel"];
            string ProductTitle = context.Request.Params["ProductTitle"];

            DBOperation.DBOperationManagment dbm = new DBOperation.DBOperationManagment();
            try
            {
                if (dbm.Open())
                {
                    DataTable dt = DAL.GetDataTable.GetProductModelAndName(Language, ProductModel, ProductTitle, dbm);
                    jsonStr = Newtonsoft.Json.JsonConvert.SerializeObject(dt);
                    context.Response.Write(jsonStr);
                }
            }
            catch (Exception ex)
            {
                context.Response.Write("FAIL|无法获取驳回原因");
            }
            finally
            {
                dbm.Close();
            }
            return(jsonStr);
        }
Example #2
0
        public string GetProductRelation(HttpContext context)
        {
            string jsonStr         = string.Empty;
            string ProductDetailID = context.Request.Params["ProductDetailID"];

            DBOperation.DBOperationManagment dbm = new DBOperation.DBOperationManagment();
            try
            {
                if (dbm.Open())
                {
                    DataTable dt = DAL.GetDataTable.GetProductRelation(ProductDetailID, dbm);
                    jsonStr = Newtonsoft.Json.JsonConvert.SerializeObject(dt);
                    context.Response.Write(jsonStr);
                }
            }
            catch (Exception ex)
            {
                context.Response.Write("FAIL|无法获取驳回原因");
            }
            finally
            {
                dbm.Close();
            }
            return(jsonStr);
        }
Example #3
0
        public string GetIndustryInformationDetail(HttpContext context)
        {
            string jsonStr  = string.Empty;
            int    ID       = Convert.ToInt32(context.Request.Params["ID"]);
            int    Language = Convert.ToInt32(context.Request.Params["lang"]);

            DBOperation.DBOperationManagment dbm = new DBOperation.DBOperationManagment();
            try
            {
                if (dbm.Open())
                {
                    Model.Industry_News iNew = Factory.GetExecution().SelectByID <Model.Industry_News>(ID);
                    iNew.BrowseTimes += 1;
                    bool flag = Factory.GetExecution().Update <Model.Industry_News>(iNew);
                    List <Model.Industry_News> cp = Factory.GetExecution().GetByWhereSqlList <Model.Industry_News>(" and ID=" + ID + " and Language=" + Language, " ID asc");
                    jsonStr = Newtonsoft.Json.JsonConvert.SerializeObject(cp);
                    context.Response.Write(jsonStr);
                }
            }
            catch (Exception ex)
            {
                context.Response.Write("FAIL|无法获取驳回原因");
            }
            finally
            {
                dbm.Close();
            }
            return(jsonStr);
        }
Example #4
0
        public string GetProductDetail(HttpContext context)
        {
            string jsonStr  = string.Empty;
            int    ID       = Convert.ToInt32(context.Request.Params["ID"]);
            int    Language = Convert.ToInt32(context.Request.Params["lang"]);

            DBOperation.DBOperationManagment dbm = new DBOperation.DBOperationManagment();
            try
            {
                if (dbm.Open())
                {
                    List <Model.ProductCenterDetail> cp = Factory.GetExecution().GetByWhereSqlList <Model.ProductCenterDetail>(" and Language=" + Language + " and ID=" + ID, " ID asc");
                    jsonStr = Newtonsoft.Json.JsonConvert.SerializeObject(cp);
                    context.Response.Write(jsonStr);
                }
            }
            catch (Exception ex)
            {
                context.Response.Write("FAIL|无法获取驳回原因");
            }
            finally
            {
                dbm.Close();
            }
            return(jsonStr);
        }
Example #5
0
        public string GetIndustryInformation(HttpContext context)
        {
            string jsonStr  = string.Empty;
            int    Language = Convert.ToInt32(context.Request.Params["lang"]);

            DBOperation.DBOperationManagment dbm = new DBOperation.DBOperationManagment();
            try
            {
                if (dbm.Open())
                {
                    List <Model.Industry_News> cp = Factory.GetExecution().GetByWhereSqlList <Model.Industry_News>(" and Language=" + Language, " ID asc", " ID,Title,UpdateTime ");
                    jsonStr = Newtonsoft.Json.JsonConvert.SerializeObject(cp);
                    context.Response.Write(jsonStr);
                }
            }
            catch (Exception ex)
            {
                context.Response.Write("FAIL|无法获取驳回原因");
            }
            finally
            {
                dbm.Close();
            }
            return(jsonStr);
        }
Example #6
0
        public string DelProduct(HttpContext context)
        {
            int ID = Convert.ToInt32(context.Request["ID"]);

            DBOperation.DBOperationManagment dbm = new DBOperation.DBOperationManagment();
            string msg     = string.Empty;
            string error   = string.Empty;
            string jsonStr = string.Empty;

            try
            {
                if (dbm.Open())
                {
                    Dictionary <string, string> r1  = new Dictionary <string, string>();
                    Model.ProductCenterModel    pcm = Factory.GetExecution().SelectByID <Model.ProductCenterModel>(ID);
                    if (pcm != null)
                    {
                        DataTable dt = DAL.GetDataTable.GetProductModelDetail(pcm.ProductModelID, dbm);
                        if (dt != null && dt.Rows.Count > 0)
                        {
                            msg   = "false";
                            error = "此产品型号已被绑定,不能删除!";
                            r1.Add("msg", msg);
                            r1.Add("error", error);
                            jsonStr = Newtonsoft.Json.JsonConvert.SerializeObject(r1);
                            context.Response.Write(jsonStr);
                            return(jsonStr);
                        }
                    }
                    if (Factory.GetExecution().Delete <Model.ProductCenterModel>(ID))
                    {
                        msg = "true";
                    }
                    else
                    {
                        msg   = "false";
                        error = "删除失败!";
                    }
                    r1.Add("msg", msg);
                    r1.Add("error", error);
                    jsonStr = Newtonsoft.Json.JsonConvert.SerializeObject(r1);
                    context.Response.Write(jsonStr);
                    return(jsonStr);
                }
            }
            catch (Exception ex)
            {
                LogTool.LogWriter.WriteError("读取资源出错,!", ex);
            }
            finally
            {
                dbm.Close();
            }
            return(jsonStr);
        }
Example #7
0
        protected void rptSpec_ItemCommand(object source, RepeaterCommandEventArgs e)
        {
            DBOperation.DBOperationManagment dbm = new DBOperation.DBOperationManagment();
            string msg = string.Empty;

            try
            {
                dbm.Open();
                switch (e.CommandName)
                {
                case "Delete":
                    try
                    {
                        string IDValue = e.CommandArgument.ToString();
                        int    ID      = 0;
                        if (Int32.TryParse(IDValue, out ID))
                        {
                            if (Factory.GetExecution().Delete <Model.Company_Location>(ID))
                            {
                                Common.MessageBox.ShowLayer(this, "删除成功!", 1);
                                BindData();
                            }
                            else
                            {
                                Common.MessageBox.ShowLayer(this, "删除失败!", 2);
                            }
                        }
                        else
                        {
                            Common.MessageBox.ShowLayer(this, "请求参数错误!", 2);
                        }
                    }
                    catch
                    {
                        Common.MessageBox.ShowLayer(this, "删除失败!", 2);
                    }
                    finally
                    {
                        dbm.Close();
                    }
                    break;
                }
            }
            catch (Exception ex)
            {
                Common.MessageBox.ShowLayer(this, "数据处理失败!" + ex.ToString(), 2);
            }
            finally
            {
                dbm.Close();
            }
        }
Example #8
0
 public void BindData()
 {
     DBOperation.DBOperationManagment dbm = new DBOperation.DBOperationManagment();
     try
     {
         if (view_action == "notify")
         {
             Model.ProductCenter cp = Factory.GetExecution().SelectByID <Model.ProductCenter>(requestID);
             if (cp != null)
             {
                 if (cp.Language == 1)
                 {
                     Chinese.Checked = true;
                 }
                 else if (cp.Language == 3)
                 {
                     English.Checked = true;
                 }
                 else if (cp.Language == 2)
                 {
                     Traditional.Checked = true;
                 }
                 txtTitle.Text               = cp.ProductTitle;
                 txtCreatePeople.Text        = cp.CreatePeople;
                 HomePageUploadImg.ImageUrl  = WebSite.IMAGESERVER_WEBPATH + photoPath + cp.LogoUrl;
                 HomePageUploadFileName.Text = cp.LogoUrl;
                 txtKeywords.Text            = cp.Keywords;
                 txtDescription.Text         = cp.Description;
                 Model.ProductCenterModel[] pcList = DAL.GetDataTable.GetProductModel(cp.ProductID, dbm);
                 foreach (var item in pcList)
                 {
                     string html = hfEditHtml.Value;
                     if (!string.IsNullOrEmpty(html))
                     {
                         hfEditHtml.Value = html + "," + item.ProductModel + ":" + item.ID;
                     }
                     else
                     {
                         hfEditHtml.Value = item.ProductModel + ":" + item.ID;
                     }
                 }
             }
         }
     }
     catch (Exception ex)
     {
         Common.MessageBox.ShowLayer(this, ex.Message, 2);
     }
 }
Example #9
0
        private void BindRelation()
        {
            int ProductType = Convert.ToInt32(Request["ProductType"]);
            int Language    = Convert.ToInt32(Request.Form["language"]);

            DBOperation.DBOperationManagment dbm = new DBOperation.DBOperationManagment();
            try
            {
                dbm.Open();
                DataTable productRelation = DAL.GetDataTable.GetProductRelation(Language, requestID, dbm);
                ddlProductRelation.DataTextField  = "Title";
                ddlProductRelation.DataValueField = "RelatinProductDetailID";
                ddlProductRelation.DataSource     = productRelation;
                ddlProductRelation.DataBind();
            }
            catch (Exception e)
            {
                LogTool.LogWriter.WriteError("绑定门店出错", e);
            }
            finally
            {
                dbm.Close();
            }
        }
Example #10
0
        public void BindData()
        {
            DateTime _tmpDtStart;
            DateTime _tmpDtEnd;

            if (!string.IsNullOrEmpty(txtPurchaseStart.Value) && !DateTime.TryParse(txtPurchaseStart.Value, out _tmpDtStart))
            {
                Common.MessageBox.ShowLayer(this, "请输入正确的查询开始时间!", 2);
                return;
            }
            if (!string.IsNullOrEmpty(txtPurchaseEnd.Value) && !DateTime.TryParse(txtPurchaseEnd.Value, out _tmpDtEnd))
            {
                Common.MessageBox.ShowLayer(this, "请输入正确的查询结束时间!", 2);
                return;
            }
            DBOperation.DBOperationManagment dbm = new DBOperation.DBOperationManagment();
            try
            {
                if (dbm.Open())
                {
                    int    pageCount;
                    int    rowCount;
                    string Title     = txtTitle.Text.Trim();
                    string startDate = txtPurchaseStart.Value.Trim();
                    string endDate   = txtPurchaseEnd.Value.Trim();
                    if (!string.IsNullOrEmpty(endDate) && string.IsNullOrEmpty(startDate))
                    {
                        startDate = endDate;
                    }
                    if (!string.IsNullOrEmpty(startDate) && string.IsNullOrEmpty(endDate))
                    {
                        endDate = startDate;
                    }

                    //判断时间段
                    if (!string.IsNullOrEmpty(endDate) && !string.IsNullOrEmpty(startDate))
                    {
                        DateTime sDate = DateTime.Parse(startDate);
                        DateTime eDate = DateTime.Parse(endDate);

                        if (sDate > eDate)
                        {
                            Common.MessageBox.ShowLayer(this, "开始时间不能大于结束时间!", 2);
                            return;
                        }
                    }
                    DataTable dt = DAL.GetDataTable.GetList <Model.Company_Location>(Title, startDate, endDate, AspNetPager2.CurrentPageIndex, AspNetPager2.PageSize, out pageCount, out rowCount, dbm);
                    if (null != dt)
                    {
                        rptChannel.DataSource    = dt;
                        AspNetPager2.RecordCount = rowCount;
                        rptChannel.DataBind();
                    }
                }
                else
                {
                    Common.MessageBox.ShowLayer(this, "操作失败,连接数据库失败!", 2);
                }
            }
            catch (Exception ex)
            {
                Common.MessageBox.ShowLayer(this, "操作失败," + ex.Message, 2);
            }
            finally
            {
                dbm.Close();
            }
        }
Example #11
0
 protected void btnSave_Click(object sender, EventArgs e)
 {
     DBOperation.DBOperationManagment dbm = new DBOperation.DBOperationManagment();
     try
     {
         MoveFile();
         string code       = "";
         var    photo_list = UpdateLogo(out code);
         dbm.Open();
         if (view_action == "notify")
         {
             Model.InBanner cp = Factory.GetExecution().SelectByID <Model.InBanner>(requestID);
             if (cp != null)
             {
                 cp.Language     = Convert.ToInt32(Request.Form["language"]);
                 cp.Title        = txtTitle.Text;
                 cp.CreatePeople = txtCreatePeople.Text;
                 cp.UpdateTime   = DateTime.Now;
                 cp.Keywords     = txtKeywords.Text.Trim();
                 cp.Description  = txtDescription.Text.Trim();
                 if (!string.IsNullOrEmpty(photo_list[0]))
                 {
                     cp.BannerPicname = photo_list[0].Trim(',');
                 }
                 bool flag = Factory.GetExecution().Update <Model.InBanner>(cp);
                 if (flag)
                 {
                     Common.MessageBox.ShowRedirect(this, "/Carousel/HomePageCarousel.aspx");
                 }
             }
         }
         else
         {
             Model.InBanner cp = new Model.InBanner();
             cp.Language     = Convert.ToInt32(Request.Form["language"]);
             cp.Title        = txtTitle.Text;
             cp.CreatePeople = txtCreatePeople.Text;
             cp.UpdateTime   = DateTime.Now;
             cp.CreateTime   = DateTime.Now;
             cp.Keywords     = txtKeywords.Text.Trim();
             cp.Description  = txtDescription.Text.Trim();
             if (!string.IsNullOrEmpty(photo_list[0]))
             {
                 cp.BannerPicname = photo_list[0].Trim(',');
             }
             bool flag = Factory.GetExecution().Add <Model.InBanner>(cp);
             if (flag)
             {
                 Common.MessageBox.ShowRedirect(this, "/Carousel/HomePageCarousel.aspx");
             }
         }
     }
     catch (Exception ex)
     {
         Common.MessageBox.ShowLayer(this, "添加失败!" + ex.Message, 2);
     }
     finally
     {
         dbm.Close();
         BindData();
     }
 }
Example #12
0
        protected void btnSave_Click(object sender, EventArgs e)
        {
            int ProductType = Convert.ToInt32(Request["ProductType"]);
            int Language    = Convert.ToInt32(Request.Form["language"]);

            DBOperation.DBOperationManagment dbm = new DBOperation.DBOperationManagment();
            try
            {
                dbm.Open();
                if (view_action == "notify")
                {
                    Model.ProductCenter cp = Factory.GetExecution().SelectByID <Model.ProductCenter>(requestID);
                    if (cp != null)
                    {
                        List <Model.ProductCenter> pcList = Factory.GetExecution().GetByWhereSqlList <Model.ProductCenter>(" and ProductType=" + ProductType + " and Language=" + Language, " UpdateTime desc");
                        if (pcList != null && pcList.Count > 0 && cp.Language != Language)
                        {
                            Common.MessageBox.ShowLayer(this, "同一种语言只能新建一个产品分类!", 2);
                            return;
                        }
                        cp.Language     = Language;
                        cp.ProductTitle = txtTitle.Text;
                        cp.CreatePeople = txtCreatePeople.Text;
                        cp.LogoUrl      = HomePageUploadFileName.Text;
                        cp.CreatePeople = txtCreatePeople.Text;
                        cp.UpdateTime   = DateTime.Now;
                        cp.Keywords     = txtKeywords.Text.Trim();
                        cp.Description  = txtDescription.Text.Trim();
                        bool flag2 = true;
                        //flag2 = DAL.GetDataTable.Delete<Model.ProductCenterModel>(cp.ProductID);

                        if (!string.IsNullOrEmpty(hfArrList.Value))
                        {
                            List <Prm> list = JsonConvert.DeserializeObject <List <Prm> >(hfArrList.Value);
                            foreach (Prm item in list)
                            {
                                if (!string.IsNullOrEmpty(item.ProductModel))
                                {
                                    DataTable dt = DAL.GetDataTable.IsExistProductModel(item.ProductModel, cp.ProductID, dbm);
                                    if (dt != null && dt.Rows.Count > 0)
                                    {
                                    }
                                    else
                                    {
                                        Model.ProductCenterModel pcm = new Model.ProductCenterModel();
                                        pcm.ProductModelID = RuleUtility.IDsCreater.GetCreater().CreateProductModelID(dbm);
                                        pcm.Language       = Language;
                                        pcm.ProductID      = cp.ProductID;
                                        pcm.ProductModel   = item.ProductModel;
                                        pcm.CreateTime     = DateTime.Now;
                                        pcm.UpdateTime     = DateTime.Now;
                                        flag2 = Factory.GetExecution().Add <Model.ProductCenterModel>(pcm);
                                    }
                                }
                            }
                        }
                        bool flag = Factory.GetExecution().Update <Model.ProductCenter>(cp);
                        if (flag && flag2)
                        {
                            Common.MessageBox.ShowRedirect(this, "/ProductCenter/ServoDriver.aspx?ProductType=" + ProductType);
                        }
                    }
                }
                else
                {
                    List <Model.ProductCenter> pcList = Factory.GetExecution().GetByWhereSqlList <Model.ProductCenter>(" and ProductType=" + ProductType + " and Language=" + Language, " UpdateTime desc");
                    if (pcList != null && pcList.Count > 0)
                    {
                        Common.MessageBox.ShowLayer(this, "同一种语言只能新建一个产品分类!", 2);
                        return;
                    }
                    Model.ProductCenter cp = new Model.ProductCenter();
                    cp.ProductID    = RuleUtility.IDsCreater.GetCreater().CreateProductID(dbm);
                    cp.Language     = Language;
                    cp.ProductType  = ProductType;
                    cp.ProductTitle = txtTitle.Text;
                    cp.CreatePeople = txtCreatePeople.Text;
                    cp.LogoUrl      = HomePageUploadFileName.Text;
                    cp.CreatePeople = txtCreatePeople.Text;
                    cp.UpdateTime   = DateTime.Now;
                    cp.CreateTime   = DateTime.Now;
                    cp.Keywords     = txtKeywords.Text.Trim();
                    cp.Description  = txtDescription.Text.Trim();
                    bool flag1 = Factory.GetExecution().Add <Model.ProductCenter>(cp);
                    bool flag2 = true;
                    if (!string.IsNullOrEmpty(hfArrList.Value))
                    {
                        List <Prm> list = JsonConvert.DeserializeObject <List <Prm> >(hfArrList.Value);
                        foreach (Prm item in list)
                        {
                            if (!string.IsNullOrEmpty(item.ProductModel))
                            {
                                Model.ProductCenterModel pcm = new Model.ProductCenterModel();
                                pcm.ProductModelID = RuleUtility.IDsCreater.GetCreater().CreateProductModelID(dbm);
                                pcm.Language       = Language;
                                pcm.ProductID      = cp.ProductID;
                                pcm.ProductModel   = item.ProductModel;
                                pcm.CreateTime     = DateTime.Now;
                                pcm.UpdateTime     = DateTime.Now;
                                flag2 = Factory.GetExecution().Add <Model.ProductCenterModel>(pcm);
                            }
                        }
                    }
                    if (flag1 && flag2)
                    {
                        Common.MessageBox.ShowRedirect(this, "/ProductCenter/ServoDriver.aspx?ProductType=" + ProductType);
                    }
                }
            }
            catch (Exception ex)
            {
                Common.MessageBox.ShowLayer(this, "添加失败!" + ex.Message, 2);
            }
            finally
            {
                dbm.Close();
                BindData();
            }
        }
Example #13
0
        protected void btnSave_Click(object sender, EventArgs e)
        {
            int ProductType = Convert.ToInt32(Request["ProductType"]);

            DBOperation.DBOperationManagment dbm = new DBOperation.DBOperationManagment();
            try
            {
                MoveFile();
                string code       = "";
                var    photo_list = UpdateLogo(out code);
                dbm.Open();
                Advantage          = hfAdvantage.Value;
                TechnicalParameter = hfTechnicalParameter.Value;
                if (string.IsNullOrEmpty(Advantage))
                {
                    Common.MessageBox.ShowLayer(this, "特点和优点不能为空", 2);
                    return;
                }
                if (string.IsNullOrEmpty(TechnicalParameter))
                {
                    Common.MessageBox.ShowLayer(this, "技术参数不能为空", 2);
                    return;
                }
                if (string.IsNullOrEmpty(photo_list[0]))
                {
                    Common.MessageBox.ShowLayer(this, "附件不能为空", 2);
                    return;
                }
                if (string.IsNullOrEmpty(ddlProductModel.SelectedValue))
                {
                    Common.MessageBox.ShowLayer(this, "产品型号不能为空", 2);
                    return;
                }
                if (view_action == "notify")
                {
                    Model.ProductCenterDetail cp = Factory.GetExecution().SelectByID <Model.ProductCenterDetail>(requestID);
                    if (cp != null)
                    {
                        cp.Language           = Convert.ToInt32(Request.Form["language"]);
                        cp.Title              = txtTitle.Text;
                        cp.ProductModelID     = ddlProductModel.SelectedValue;
                        cp.Series             = txtSeries.Text;
                        cp.ClothAngle         = txtClothAngle.Text;
                        cp.Advantage          = Advantage;
                        cp.FileName           = ProductFile;
                        cp.TechnicalParameter = TechnicalParameter;
                        cp.CreatePeople       = txtCreatePeople.Text;
                        cp.LogoUrl            = HomePageUploadFileName.Text;
                        cp.CreatePeople       = txtCreatePeople.Text;
                        cp.UpdateTime         = DateTime.Now;
                        cp.Keywords           = txtKeywords.Text.Trim();
                        cp.Description        = txtDescription.Text.Trim();
                        if (!string.IsNullOrEmpty(photo_list[0]))
                        {
                            cp.FileName = photo_list[0].Trim(',');
                        }
                        bool flag = Factory.GetExecution().Update <Model.ProductCenterDetail>(cp);

                        bool prFlag   = true;
                        bool isDelete = DAL.GetDataTable.DeleteProductRelation <Model.ProductRelation>(cp.ProductDetailID);
                        if (lbMemberGroupID.Items.Count > 0)
                        {
                            foreach (ListItem item in lbMemberGroupID.Items)
                            {
                                if (!string.IsNullOrEmpty(item.Value))
                                {
                                    Model.ProductRelation pr = new Model.ProductRelation();
                                    pr.ProductDetailID        = cp.ProductDetailID;
                                    pr.RelatinProductDetailID = item.Value;
                                    prFlag = Factory.GetExecution().Add <Model.ProductRelation>(pr);
                                }
                            }
                        }

                        if (flag && prFlag)
                        {
                            Common.MessageBox.ShowRedirect(this, "/ProductCenter/ServoDriver.aspx?ProductType=" + ProductType);
                        }
                    }
                }
                else
                {
                    Model.ProductCenterDetail cp = new Model.ProductCenterDetail();
                    cp.ProductDetailID    = RuleUtility.IDsCreater.GetCreater().CreateProductDetailID(dbm);
                    cp.Language           = Convert.ToInt32(Request.Form["language"]);
                    cp.Title              = txtTitle.Text;
                    cp.ProductModelID     = ddlProductModel.SelectedValue;
                    cp.Series             = txtSeries.Text;
                    cp.ClothAngle         = txtClothAngle.Text;
                    cp.Advantage          = Advantage;
                    cp.TechnicalParameter = TechnicalParameter;
                    cp.CreatePeople       = txtCreatePeople.Text;
                    cp.LogoUrl            = HomePageUploadFileName.Text;
                    cp.CreatePeople       = txtCreatePeople.Text;
                    cp.UpdateTime         = DateTime.Now;
                    cp.CreateTime         = DateTime.Now;
                    cp.Keywords           = txtKeywords.Text.Trim();
                    cp.Description        = txtDescription.Text.Trim();
                    if (!string.IsNullOrEmpty(photo_list[0]))
                    {
                        cp.FileName = photo_list[0].Trim(',');
                    }
                    else
                    {
                        cp.FileName = "";
                    }
                    bool flag   = Factory.GetExecution().Add <Model.ProductCenterDetail>(cp);
                    bool prFlag = true;
                    if (lbMemberGroupID.Items.Count > 0)
                    {
                        foreach (ListItem item in lbMemberGroupID.Items)
                        {
                            if (!string.IsNullOrEmpty(item.Value))
                            {
                                Model.ProductRelation pr = new Model.ProductRelation();
                                pr.ProductDetailID        = cp.ProductDetailID;
                                pr.RelatinProductDetailID = item.Value;
                                prFlag = Factory.GetExecution().Add <Model.ProductRelation>(pr);
                            }
                        }
                    }
                    if (flag && prFlag)
                    {
                        Common.MessageBox.ShowRedirect(this, "/ProductCenter/ServoDriver.aspx?ProductType=" + ProductType);
                    }
                }
            }
            catch (Exception ex)
            {
                Common.MessageBox.ShowLayer(this, "添加失败!" + ex.Message, 2);
            }
            finally
            {
                //if (English.Checked)
                //{
                //    Chinese.Checked = false;
                //    Chinese.AutoPostBack = true;
                //    Traditional.Checked = false;
                //}
                //else if (Traditional.Checked)
                //{
                //    Chinese.Checked = false;
                //    Chinese.AutoPostBack = true;
                //    English.Checked = false;
                //}
                dbm.Close();
                //BindData();//这句话不能加,加了之后会把checkbox重新赋值。如果我选择了英文语言,那么就会有两种语言。这时候就冲突了。
            }
        }
Example #14
0
        public void BindData()
        {
            DBOperation.DBOperationManagment dbm = new DBOperation.DBOperationManagment();
            try
            {
                if (dbm.Open())
                {
                    Model.ProductCenterDetail cp = Factory.GetExecution().SelectByID <Model.ProductCenterDetail>(requestID);
                    if (view_action == "notify")
                    {
                        if (cp != null)
                        {
                            if (cp.Language == 1)
                            {
                                Chinese.Checked = true;
                            }
                            else if (cp.Language == 3)
                            {
                                English.Checked = true;
                            }
                            else if (cp.Language == 2)
                            {
                                Traditional.Checked = true;
                            }
                            txtTitle.Text = cp.Title;
                            ddlProductModel.SelectedValue = cp.ProductModelID;
                            txtSeries.Text              = cp.Series;
                            txtClothAngle.Text          = cp.ClothAngle;
                            Advantage                   = cp.Advantage;
                            TechnicalParameter          = cp.TechnicalParameter;
                            txtCreatePeople.Text        = cp.CreatePeople;
                            HomePageUploadImg.ImageUrl  = WebSite.IMAGESERVER_WEBPATH + photoPath + cp.LogoUrl;
                            HomePageUploadFileName.Text = cp.LogoUrl;
                            txtKeywords.Text            = cp.Keywords;
                            txtDescription.Text         = cp.Description;
                            //修改过
                            List <string> sp        = new List <string>();
                            var           photolist = cp.FileName;
                            if (!string.IsNullOrEmpty(photolist))
                            {
                                for (int i = 0; i < photolist.Split(',').Length; i++)
                                {
                                    sp.Add(WebSite.IMAGESERVER_WEBPATH + FilePath + photolist.Split(',')[i]);
                                }
                            }
                            //如果是只读状态,不需要显示默认图片
                            if (sp.Count < ProductShowMaxCount)
                            {
                                sp.Add(defaultPhoto);
                            }
                            rptShowPhotoes.DataSource = sp;
                            rptShowPhotoes.DataBind();

                            #region 绑定关联产品
                            DataTable dt = DAL.GetDataTable.GetProductDetailRelation(cp.ProductDetailID, dbm);
                            if (dt != null)
                            {
                                foreach (System.Data.DataRow dr in dt.Rows)
                                {
                                    ListItem li = new ListItem(dr["Title"].ToString(), dr["RelatinProductDetailID"].ToString());
                                    lbMemberGroupID.Items.Add(li);
                                    lbMemberGroupID.ToolTip = li.Text;
                                }
                            }
                            #endregion
                        }
                    }
                    else
                    {
                        List <string> showPhotos = new List <string>();
                        showPhotos.Add(defaultPhoto);
                        rptShowPhotoes.DataSource = showPhotos;
                        rptShowPhotoes.DataBind();
                    }
                }
            }
            catch (Exception ex)
            {
                Common.MessageBox.ShowLayer(this, "添加失败!" + ex.Message, 2);
            }
            finally
            {
                dbm.Close();
            }
        }