コード例 #1
0
        protected void grdXMDeliveryDetailsManage_RowDataBound(object sender, GridViewRowEventArgs e)
        {
            HozestERP.BusinessLogic.ManageProject.XMDelivery xMDelivery = new BusinessLogic.ManageProject.XMDelivery();

            if (e.Row.RowType == DataControlRowType.DataRow)
            {
                //编辑按钮
                ImageButton imgBtnEdit = e.Row.FindControl("imgBtnEdit") as ImageButton;
                //删除按钮
                ImageButton imgBtnDelete = e.Row.FindControl("imgBtnDelete") as ImageButton;

                //财务审核通过 不显示编辑按钮、删除按钮

                if (xMDelivery != null)
                {
                    if (xMDelivery.IsDelivery == true)
                    {
                        if (imgBtnEdit != null && imgBtnDelete != null)
                        {
                            imgBtnEdit.Visible   = false;
                            imgBtnDelete.Visible = false;
                        }
                    }
                    else
                    {
                        if (imgBtnEdit != null && imgBtnDelete != null)
                        {
                            imgBtnEdit.Visible   = true;
                            imgBtnDelete.Visible = true;
                        }
                    }
                }
                else
                {
                    if (imgBtnEdit != null && imgBtnDelete != null)
                    {
                        imgBtnEdit.Visible   = false;
                        imgBtnDelete.Visible = false;
                    }
                }
            }


            if (e.Row.RowState == DataControlRowState.Edit ||
                (e.Row.RowState == (DataControlRowState.Alternate | DataControlRowState.Edit)))
            {
                SimpleTextBox txtProductNum = e.Row.FindControl("txtProductNum") as SimpleTextBox;
                if (txtProductNum != null)
                {
                    if (txtProductNum.Text == "")
                    {
                        txtProductNum.Text = "1";
                    }
                }
            }
        }
コード例 #2
0
        protected void gvAdvanceApplicationDetail_RowUpdating(object sender, GridViewUpdateEventArgs e)
        {
            var           row                = this.gvAdvanceApplicationDetail.Rows[e.RowIndex];
            decimal       d                  = 0;
            var           ccAdvanceTypeId    = row.FindControl("ccAdvanceTypeId") as CodeControl;
            var           ccPayTypeId        = row.FindControl("ccPayTypeId") as CodeControl;
            SimpleTextBox txtTheAdvanceMoney = row.FindControl("txtTheAdvanceMoney") as SimpleTextBox;

            if (txtTheAdvanceMoney.Text.Trim() != "")
            {
                if (!decimal.TryParse(txtTheAdvanceMoney.Text.Trim(), out d))
                {
                    base.ShowMessage("您输入的暂支金额不正确!");
                    return;
                }
            }

            var txtRecipientsId = row.FindControl("txtRecipientsId") as SelectSingleCustomerControl;
            var RecipientsId    = txtRecipientsId.SelectSingleCustomer.CustomerID;

            int QID = Convert.ToInt32(gvAdvanceApplicationDetail.DataKeys[e.RowIndex].Value.ToString());
            AdvanceApplicationDetail advanceApplicationDetail = new AdvanceApplicationDetail();

            if (QID == 0) //新增
            {
                advanceApplicationDetail.AdvanceId       = this.AdvanceId;
                advanceApplicationDetail.AdvanceTypeId   = ccAdvanceTypeId.SelectedValue;
                advanceApplicationDetail.PayTypeId       = ccPayTypeId.SelectedValue;
                advanceApplicationDetail.TheAdvanceMoney = Convert.ToDecimal(txtTheAdvanceMoney.Text);
                advanceApplicationDetail.RecipientsId    = RecipientsId;
                advanceApplicationDetail.IsEnable        = false;
                advanceApplicationDetail.CreatorID       = HozestERPContext.Current.User.CustomerID;
                advanceApplicationDetail.CreateTime      = DateTime.Now;
                advanceApplicationDetail.UpdatorID       = HozestERPContext.Current.User.CustomerID;
                advanceApplicationDetail.UpdateTime      = DateTime.Now;

                base.AdvanceApplicationDetailService.InsertAdvanceApplicationDetail(advanceApplicationDetail);
            }
            else //修改
            {
                advanceApplicationDetail.AdvanceTypeId   = ccAdvanceTypeId.SelectedValue;
                advanceApplicationDetail.PayTypeId       = ccPayTypeId.SelectedValue;
                advanceApplicationDetail.TheAdvanceMoney = Convert.ToDecimal(txtTheAdvanceMoney.Text);
                advanceApplicationDetail.RecipientsId    = RecipientsId;
                advanceApplicationDetail.UpdatorID       = HozestERPContext.Current.User.CustomerID;
                advanceApplicationDetail.UpdateTime      = DateTime.Now;
                base.AdvanceApplicationDetailService.UpdateAdvanceApplicationDetail(advanceApplicationDetail);
            }
            //重新绑定
            this.RowEditIndex = -1;
            loadDate();
        }
コード例 #3
0
        /// <summary>
        /// Adds simple text box to shape collection
        /// </summary>
        /// <param name="region">region of the  text box </param>
        /// <param name="penColor">Color of the pen</param>
        /// <param name="fillColor">Fill color</param>
        /// <param name="penWidth">Width of the pen</param>
        /// <param name="isFilled">Is  text box  filled</param>
        /// <param name="textBox">TextBox that contains data of textbox</param>
        public void AddSimpleTextBox(Region region, TextBox textBox, Color penColor,
                                     Color fillColor, float penWidth, bool isFilled)
        {
            region.FixSize(MinimumSize);
            this.DeSelect();
            SimpleTextBox stextbox = new SimpleTextBox();

            stextbox.Region      = region;
            stextbox.Text        = textBox.Text;
            stextbox.Font        = textBox.Font;
            stextbox.PenColor    = penColor;
            stextbox.PenWidth    = penWidth;
            stextbox.FillEnabled = isFilled;
            stextbox.FillColor   = fillColor;

            this.shapes.Add(stextbox);
            StoreInBuffer(BufferOperation.Insert, stextbox);
            handlerCol           = new ShapeHandlerCollection(stextbox);
            this.selectedElement = stextbox;
            this.selectedElement.Select();
        }
コード例 #4
0
        /// <summary>Adds a text box to the form.</summary>
        /// <param name="caption">The caption for the text box.</param>
        /// <param name="inputHandler">The event handler for text input.</param>
        public SimpleTextBox AddTextBox(string caption, MultiControlTextEventHandler inputHandler)
        {
            var lbl = new Label() {
                Text = caption,
                AutoSize = true,
                Dock = DockStyle.Fill,
                TextAlign = ContentAlignment.MiddleLeft
            };
            var txt = new TextBox() { Dock = DockStyle.Fill };
            this.Form.AddToControls(lbl, txt);

            var stb = new SimpleTextBox(lbl, txt);
            if (inputHandler != null)
                txt.KeyDown += (o, e) => {
                    if (e.KeyCode == Keys.Enter) inputHandler.Invoke(stb, txt.Text);
                };

            return stb;
        }
コード例 #5
0
        protected void gvAdvanceApplicationDetail_RowUpdating(object sender, GridViewUpdateEventArgs e)
        {
            var           row = this.gvAdvanceApplicationDetail.Rows[e.RowIndex];
            decimal       d   = 0;
            var           ccPlatformTypeId        = row.FindControl("ccPlatformTypeId") as CodeControl;
            SimpleTextBox txtPlatformMerchantCode = row.FindControl("txtPlatformMerchantCode") as SimpleTextBox;
            var           hfPlatformMerchantCode  = row.FindControl("hfPlatformMerchantCode") as HiddenField;

            var           ccProductTypeId        = row.FindControl("ccProductTypeId") as CodeControl;
            TextBox       txtPlatformInventory   = row.FindControl("txtPlatformInventory") as TextBox;
            SimpleTextBox txtstrUrl              = row.FindControl("txtstrUrl") as SimpleTextBox;
            SimpleTextBox txtCostprice           = row.FindControl("txtCostprice") as SimpleTextBox;
            SimpleTextBox txtSaleprice           = row.FindControl("txtSaleprice") as SimpleTextBox;
            var           txtTCostprice          = row.FindControl("txtTCostprice") as TextBox;
            var           lblTCostpriceVaule     = row.FindControl("lblTCostpriceVaule") as Label;
            var           txtTDateTimeStart      = row.FindControl("txtTDateTimeStart") as HtmlInputText;
            var           txtTDateTimeEnd        = row.FindControl("txtTDateTimeEnd") as HtmlInputText;
            var           lblTDateTimeStartValue = row.FindControl("lblTDateTimeStartValue") as Label;
            var           lblTDateTimeEndValue   = row.FindControl("lblTDateTimeEndValue") as Label;

            lblTDateTimeStartValue.Text = "";
            lblTDateTimeEndValue.Text   = "";
            lblTCostpriceVaule.Text     = "";
            if (!decimal.TryParse(txtTCostprice.Text.Trim(), out d))
            {
                if (txtTCostprice.Text.Trim() != "")
                {
                    lblTCostpriceVaule.Text = "请输入正确的数值";
                }
            }
            if (txtTCostprice.Text != "")
            {
                if (txtTDateTimeStart.Value.ToString() == "" || txtTDateTimeEnd.Value.ToString() == "")
                {
                    lblTDateTimeStartValue.Text = "请输入开始日期";
                    lblTDateTimeEndValue.Text   = "请输入结束日期";
                }
            }
            var chkIsMainPush = row.FindControl("chkIsMainPush") as CheckBox;

            if (lblTDateTimeStartValue.Text != "" || lblTDateTimeEndValue.Text != "")
            {
                return;
            }

            int QID = Convert.ToInt32(gvAdvanceApplicationDetail.DataKeys[e.RowIndex].Value.ToString());
            XMCombinationDetails xMProductDetails = base.XMCombinationDetailsService.GetXMProductDetailsById(QID);


            List <XMCombinationDetails> xMProductDetailsCodeList = null;

            if (txtPlatformMerchantCode.Text.Trim() != "")
            {
                xMProductDetailsCodeList = base.XMCombinationDetailsService.GetXMProductDetailsByPlatformMerchantCode(txtPlatformMerchantCode.Text.Trim(), ccPlatformTypeId.SelectedValue);
            }

            if (xMProductDetails == null) //新增
            {
                if (xMProductDetailsCodeList != null)
                {
                    if (xMProductDetailsCodeList.Count > 0)
                    {
                        base.ShowMessage("商品编码已存在");
                        return;
                    }
                }

                XMCombinationDetails xMProductDetailsNew = new XMCombinationDetails();

                xMProductDetailsNew.ProductId            = this.ProductId;
                xMProductDetailsNew.PlatformTypeId       = ccPlatformTypeId.SelectedValue;
                xMProductDetailsNew.PlatformMerchantCode = txtPlatformMerchantCode.Text.Trim();
                xMProductDetailsNew.ProductTypeId        = ccProductTypeId.SelectedValue;

                if (txtPlatformInventory.Text != "")
                {
                    xMProductDetailsNew.PlatformInventory = Convert.ToInt32(txtPlatformInventory.Text.Trim());
                }
                xMProductDetailsNew.strUrl = txtstrUrl.Text.Trim();

                decimal paramparse1 = 0;
                if (decimal.TryParse(txtCostprice.Text.Trim(), out paramparse1))
                {
                    xMProductDetailsNew.Costprice = Convert.ToDecimal(txtCostprice.Text.Trim());
                }
                else
                {
                    xMProductDetailsNew.Costprice = 0;
                }
                if (decimal.TryParse(txtSaleprice.Text.Trim(), out paramparse1))
                {
                    xMProductDetailsNew.Saleprice = Convert.ToDecimal(txtSaleprice.Text.Trim());
                }
                else
                {
                    xMProductDetailsNew.Saleprice = 0;
                }
                if (txtTCostprice.Text != "")
                {
                    if (txtTDateTimeStart.Value.ToString() != "" || txtTDateTimeEnd.Value.ToString() != "")
                    {
                        xMProductDetailsNew.TCostprice     = Convert.ToDecimal(txtTCostprice.Text.Trim());
                        xMProductDetailsNew.TDateTimeStart = Convert.ToDateTime(txtTDateTimeStart.Value);
                        xMProductDetailsNew.TDateTimeEnd   = Convert.ToDateTime(txtTDateTimeEnd.Value).AddDays(+1).AddMinutes(-1);
                    }
                }
                xMProductDetailsNew.IsMainPush = chkIsMainPush.Checked;
                xMProductDetailsNew.IsEnable   = false;
                xMProductDetailsNew.CreateID   = HozestERPContext.Current.User.CustomerID;
                xMProductDetailsNew.CreateDate = DateTime.Now;
                xMProductDetailsNew.UpdateID   = HozestERPContext.Current.User.CustomerID;
                xMProductDetailsNew.UpdateDate = DateTime.Now;

                base.XMCombinationDetailsService.InsertXMCombinationDetails(xMProductDetailsNew);
            }
            else //修改
            {
                if (xMProductDetailsCodeList != null)
                {
                    if (xMProductDetailsCodeList.Count > 0)
                    {
                        if (!txtPlatformMerchantCode.Text.Trim().Equals(hfPlatformMerchantCode.Value))
                        {
                            base.ShowMessage("商品编码已存在");
                            return;
                        }
                    }
                }

                xMProductDetails.PlatformTypeId       = ccPlatformTypeId.SelectedValue;
                xMProductDetails.PlatformMerchantCode = txtPlatformMerchantCode.Text.Trim();
                xMProductDetails.ProductTypeId        = ccProductTypeId.SelectedValue;
                if (txtPlatformInventory.Text != "")
                {
                    xMProductDetails.PlatformInventory = Convert.ToInt32(txtPlatformInventory.Text.Trim());
                }
                xMProductDetails.strUrl = txtstrUrl.Text.Trim();

                decimal paramparse1 = 0;
                if (decimal.TryParse(txtCostprice.Text.Trim(), out paramparse1))
                {
                    xMProductDetails.Costprice = Convert.ToDecimal(txtCostprice.Text.Trim());
                }
                else
                {
                    xMProductDetails.Costprice = 0;
                }
                if (decimal.TryParse(txtSaleprice.Text.Trim(), out paramparse1))
                {
                    xMProductDetails.Saleprice = Convert.ToDecimal(txtSaleprice.Text.Trim());
                }
                else
                {
                    xMProductDetails.Saleprice = 0;
                }
                if (txtTCostprice.Text != "")
                {
                    if (txtTDateTimeStart.Value.ToString() != "" || txtTDateTimeEnd.Value.ToString() != "")
                    {
                        xMProductDetails.TCostprice     = Convert.ToDecimal(txtTCostprice.Text.Trim());
                        xMProductDetails.TDateTimeStart = Convert.ToDateTime(txtTDateTimeStart.Value);
                        xMProductDetails.TDateTimeEnd   = Convert.ToDateTime(txtTDateTimeEnd.Value).AddDays(+1).AddMinutes(-1);
                    }
                }

                xMProductDetails.IsMainPush = chkIsMainPush.Checked;
                xMProductDetails.UpdateID   = HozestERPContext.Current.User.CustomerID;
                xMProductDetails.UpdateDate = DateTime.Now;
                base.XMCombinationDetailsService.UpdateXMCombinationDetails(xMProductDetails);
            }
            //重新绑定
            this.RowEditIndex = -1;
            BindGrid();
        }
コード例 #6
0
        protected void gvAdvanceApplicationDetail_RowUpdating(object sender, GridViewUpdateEventArgs e)
        {
            int           id  = (int)this.gvAdvanceApplicationDetail.DataKeys[e.RowIndex].Value;
            var           row = this.gvAdvanceApplicationDetail.Rows[e.RowIndex];
            decimal       d   = 0;
            var           ccPlatformTypeId        = row.FindControl("ccPlatformTypeId") as CodeControl;
            SimpleTextBox txtPlatformMerchantCode = row.FindControl("txtPlatformMerchantCode") as SimpleTextBox;
            var           hfPlatformMerchantCode  = row.FindControl("hfPlatformMerchantCode") as HiddenField;

            var           ccProductTypeId        = row.FindControl("ccProductTypeId") as CodeControl;
            TextBox       txtPlatformInventory   = row.FindControl("txtPlatformInventory") as TextBox;
            TextBox       txtColor               = row.FindControl("txtColor") as TextBox;                      //颜色
            TextBox       txtTManufacturersCode  = row.FindControl("txtTemporaryManufacturersCode") as TextBox; //临时厂家编码
            SimpleTextBox txtstrUrl              = row.FindControl("txtstrUrl") as SimpleTextBox;
            SimpleTextBox txtCostprice           = row.FindControl("txtCostprice") as SimpleTextBox;
            SimpleTextBox txtSaleprice           = row.FindControl("txtSaleprice") as SimpleTextBox;
            var           txtUnauditMinPrice     = row.FindControl("txtUnauditMinPrice") as TextBox;
            var           txtTCostprice          = row.FindControl("txtTCostprice") as TextBox;
            var           lblTCostpriceVaule     = row.FindControl("lblTCostpriceVaule") as Label;
            var           txtTDateTimeStart      = row.FindControl("txtTDateTimeStart") as HtmlInputText;
            var           txtTDateTimeEnd        = row.FindControl("txtTDateTimeEnd") as HtmlInputText;
            var           lblTDateTimeStartValue = row.FindControl("lblTDateTimeStartValue") as Label;
            var           lblTDateTimeEndValue   = row.FindControl("lblTDateTimeEndValue") as Label;

            lblTDateTimeStartValue.Text = "";
            lblTDateTimeEndValue.Text   = "";
            lblTCostpriceVaule.Text     = "";

            if (!string.IsNullOrEmpty(txtTManufacturersCode.Text.Trim()))
            {
                var productList = base.XMProductDetailsService.GetXMProductListByManufacturersCode(txtTManufacturersCode.Text.Trim(), ccPlatformTypeId.SelectedValue);
                if (productList != null && productList.Count > 0)
                {
                    if (productList[0].Id != id)
                    {
                        base.ShowMessage("该厂家编码已存在!");
                        return;
                    }
                }
            }

            //同平台,同厂家编码只能有一条记录
            var XMProductDetailsList = base.XMProductDetailsService.GetXMProductDetailsByPlatformMerchantCode(txtPlatformMerchantCode.Text.Trim(), int.Parse(ccPlatformTypeId.SelectedValue.ToString()), "");

            if (XMProductDetailsList != null && XMProductDetailsList.Count > 0)
            {
                if (XMProductDetailsList.Count != 1 || id != XMProductDetailsList[0].Id)
                {
                    base.ShowMessage("该平台该商品编码已存在!");
                    return;
                }
            }

            if (!decimal.TryParse(txtTCostprice.Text.Trim(), out d))
            {
                if (txtTCostprice.Text.Trim() != "")
                {
                    lblTCostpriceVaule.Text = "请输入正确的数值!";
                }
            }
            if (txtTCostprice.Text != "")
            {
                if (txtTDateTimeStart.Value.ToString() == "" || txtTDateTimeEnd.Value.ToString() == "")
                {
                    lblTDateTimeStartValue.Text = "请输入开始日期!";
                    lblTDateTimeEndValue.Text   = "请输入结束日期!";
                }
            }
            var chkIsMainPush = row.FindControl("chkIsMainPush") as CheckBox;

            if (lblTDateTimeStartValue.Text != "" || lblTDateTimeEndValue.Text != "")
            {
                return;
            }

            int QID = Convert.ToInt32(gvAdvanceApplicationDetail.DataKeys[e.RowIndex].Value.ToString());
            XMProductDetails        xMProductDetails         = base.XMProductDetailsService.GetXMProductDetailsById(QID);
            List <XMProductDetails> xMProductDetailsCodeList = null;

            if (txtPlatformMerchantCode.Text.Trim() != "")
            {
                xMProductDetailsCodeList = base.XMProductDetailsService.GetXMProductDetailsByPlatformMerchantCode(txtPlatformMerchantCode.Text.Trim(), ccPlatformTypeId.SelectedValue, txtColor.Text.Trim());
            }

            if (xMProductDetails == null) //新增
            {
                if (xMProductDetailsCodeList != null)
                {
                    if (xMProductDetailsCodeList.Count > 0)
                    {
                        base.ShowMessage("商品编码已存在!");
                        return;
                    }
                }

                XMProductDetails xMProductDetailsNew = new XMProductDetails();

                xMProductDetailsNew.ProductId            = this.ProductId;
                xMProductDetailsNew.PlatformTypeId       = ccPlatformTypeId.SelectedValue;
                xMProductDetailsNew.PlatformMerchantCode = txtPlatformMerchantCode.Text.Trim();
                xMProductDetailsNew.ProductTypeId        = ccProductTypeId.SelectedValue;

                if (txtPlatformInventory.Text != "")
                {
                    xMProductDetailsNew.PlatformInventory = Convert.ToInt32(txtPlatformInventory.Text.Trim());
                }

                if (txtColor.Text != "")
                {
                    xMProductDetailsNew.Color = txtColor.Text.Trim();
                }

                xMProductDetailsNew.strUrl = txtstrUrl.Text.Trim();

                decimal paramparse1 = 0;
                if (decimal.TryParse(txtCostprice.Text.Trim(), out paramparse1))
                {
                    xMProductDetailsNew.Costprice = Convert.ToDecimal(txtCostprice.Text.Trim());
                }
                else
                {
                    xMProductDetailsNew.Costprice = 0;
                }
                if (decimal.TryParse(txtSaleprice.Text.Trim(), out paramparse1))
                {
                    xMProductDetailsNew.Saleprice = Convert.ToDecimal(txtSaleprice.Text.Trim());
                }
                else
                {
                    xMProductDetailsNew.Saleprice = 0;
                }
                if (decimal.TryParse(txtUnauditMinPrice.Text.Trim(), out paramparse1))
                {
                    xMProductDetailsNew.UnauditMinPrice = Convert.ToDecimal(txtUnauditMinPrice.Text.Trim());
                }
                else
                {
                    xMProductDetailsNew.UnauditMinPrice = 0;
                }
                if (txtTCostprice.Text != "" || txtTManufacturersCode.Text.Trim() != "")
                {
                    if (txtTDateTimeStart.Value.ToString() != "" && txtTDateTimeEnd.Value.ToString() != "")
                    {
                        if (txtTCostprice.Text != "")
                        {
                            xMProductDetailsNew.TCostprice = Convert.ToDecimal(txtTCostprice.Text.Trim());
                        }
                        else
                        {
                            xMProductDetailsNew.TCostprice = null;
                        }
                        if (txtTManufacturersCode.Text.Trim() != "")
                        {
                            xMProductDetailsNew.TemporaryManufacturersCode = txtTManufacturersCode.Text.Trim();//临时厂家编码
                        }
                        else
                        {
                            xMProductDetailsNew.TemporaryManufacturersCode = "";
                        }

                        xMProductDetailsNew.TDateTimeStart = Convert.ToDateTime(txtTDateTimeStart.Value);
                        xMProductDetailsNew.TDateTimeEnd   = Convert.ToDateTime(txtTDateTimeEnd.Value).AddDays(+1).AddMinutes(-1);
                    }
                    else
                    {
                        base.ShowMessage("开始时间或结束时间不能为空!");
                        return;
                    }
                }
                else
                {
                    xMProductDetailsNew.TCostprice = null;
                    xMProductDetailsNew.TemporaryManufacturersCode = "";
                    xMProductDetailsNew.TDateTimeStart             = null;
                    xMProductDetailsNew.TDateTimeEnd = null;
                }

                xMProductDetailsNew.IsMainPush = chkIsMainPush.Checked;
                xMProductDetailsNew.IsEnable   = false;
                xMProductDetailsNew.CreateID   = HozestERPContext.Current.User.CustomerID;
                xMProductDetailsNew.CreateDate = DateTime.Now;
                xMProductDetailsNew.UpdateID   = HozestERPContext.Current.User.CustomerID;
                xMProductDetailsNew.UpdateDate = DateTime.Now;

                base.XMProductDetailsService.InsertXMProductDetails(xMProductDetailsNew);

                if (xMProductDetails != null)
                {
                    decimal minPrice        = xMProductDetails.MinPrice == null ? 0 : (decimal)xMProductDetails.MinPrice;
                    decimal unauditMinPrice = xMProductDetails.UnauditMinPrice == null ? 0 : (decimal)xMProductDetails.UnauditMinPrice;
                    if (minPrice != unauditMinPrice)
                    {
                        sendMail(xMProductDetailsNew.ManufacturersCode, xMProductDetailsNew.PlatformTypeName.CodeName);
                    }
                }
            }
            else //修改
            {
                if (xMProductDetailsCodeList != null)
                {
                    if (xMProductDetailsCodeList.Count > 0)
                    {
                        if (xMProductDetailsCodeList[0].Id != QID)//if (!txtPlatformMerchantCode.Text.Trim().Equals(hfPlatformMerchantCode.Value))
                        {
                            base.ShowMessage("商品编码已存在!");
                            return;
                        }
                    }
                }

                xMProductDetails.PlatformTypeId       = ccPlatformTypeId.SelectedValue;
                xMProductDetails.PlatformMerchantCode = txtPlatformMerchantCode.Text.Trim();
                xMProductDetails.ProductTypeId        = ccProductTypeId.SelectedValue;
                if (txtPlatformInventory.Text != "")
                {
                    xMProductDetails.PlatformInventory = Convert.ToInt32(txtPlatformInventory.Text.Trim());
                }
                xMProductDetails.strUrl = txtstrUrl.Text.Trim();
                xMProductDetails.Color  = txtColor.Text.Trim();

                decimal paramparse1 = 0;
                if (decimal.TryParse(txtCostprice.Text.Trim(), out paramparse1))
                {
                    xMProductDetails.Costprice = Convert.ToDecimal(txtCostprice.Text.Trim());
                }
                else
                {
                    xMProductDetails.Costprice = 0;
                }
                if (decimal.TryParse(txtSaleprice.Text.Trim(), out paramparse1))
                {
                    xMProductDetails.Saleprice = Convert.ToDecimal(txtSaleprice.Text.Trim());
                }
                else
                {
                    xMProductDetails.Saleprice = 0;
                }
                if (decimal.TryParse(txtUnauditMinPrice.Text.Trim(), out paramparse1))
                {
                    xMProductDetails.UnauditMinPrice = Convert.ToDecimal(txtUnauditMinPrice.Text.Trim());
                }
                else
                {
                    xMProductDetails.UnauditMinPrice = 0;
                }
                if (txtTCostprice.Text != "" || txtTManufacturersCode.Text.Trim() != "")
                {
                    if (txtTDateTimeStart.Value.ToString() != "" || txtTDateTimeEnd.Value.ToString() != "")
                    {
                        if (txtTCostprice.Text != "")
                        {
                            xMProductDetails.TCostprice = Convert.ToDecimal(txtTCostprice.Text.Trim());
                        }
                        else
                        {
                            xMProductDetails.TCostprice = null;
                        }
                        if (txtTManufacturersCode.Text.Trim() != "")
                        {
                            xMProductDetails.TemporaryManufacturersCode = txtTManufacturersCode.Text.Trim();//临时厂家编码
                        }
                        else
                        {
                            xMProductDetails.TemporaryManufacturersCode = "";
                        }

                        xMProductDetails.TDateTimeStart = Convert.ToDateTime(txtTDateTimeStart.Value);
                        xMProductDetails.TDateTimeEnd   = Convert.ToDateTime(txtTDateTimeEnd.Value).AddDays(+1).AddMinutes(-1);
                    }
                    else
                    {
                        base.ShowMessage("开始时间或结束时间不能为空!");
                        return;
                    }
                }
                else
                {
                    xMProductDetails.TCostprice = null;
                    xMProductDetails.TemporaryManufacturersCode = "";
                    xMProductDetails.TDateTimeStart             = null;
                    xMProductDetails.TDateTimeEnd = null;
                }

                xMProductDetails.IsMainPush = chkIsMainPush.Checked;
                xMProductDetails.UpdateID   = HozestERPContext.Current.User.CustomerID;
                xMProductDetails.UpdateDate = DateTime.Now;
                base.XMProductDetailsService.UpdateXMProductDetails(xMProductDetails);

                decimal minPrice        = xMProductDetails.MinPrice == null ? 0 : (decimal)xMProductDetails.MinPrice;
                decimal unauditMinPrice = xMProductDetails.UnauditMinPrice == null ? 0 : (decimal)xMProductDetails.UnauditMinPrice;
                if (minPrice != unauditMinPrice)
                {
                    sendMail(xMProductDetails.ManufacturersCode, xMProductDetails.PlatformTypeName.CodeName);
                }
            }
            //重新绑定
            this.RowEditIndex = -1;
            BindGrid();
        }