Example #1
0
        protected void GridGoods_AfterEdit(object sender, FineUIPro.GridAfterEditEventArgs e)
        {
            //int[] intCell = GridGoods.SelectedCell;
            //List<Dictionary<string, object>> newDict = GridGoods.GetNewAddedList();
            //if (newDict.Count == 0) return;
            //if (e.ColumnID == "BZSL" || e.ColumnID == "HSJJ")
            //{
            //    string cell = string.Format("[{0},{1}]", e.RowIndex, intCell[1]);
            //    PageContext.RegisterStartupScript(GridGoods.GetUpdateCellValueReference(GetJObject(newDict[e.RowIndex]), cell));

            //    if (e.RowIndex != intCell[0])
            //    {
            //        PageContext.RegisterStartupScript(GridGoods.GetUpdateCellValueReference(GetJObject(newDict[intCell[0]]), string.Format("[{0},{1}]", intCell[0], intCell[1])));
            //    }
            //    //计算合计数量
            //    decimal bzslTotal = 0, feeTotal = 0;
            //    foreach (Dictionary<string, object> dic in newDict)
            //    {
            //        bzslTotal += Convert.ToDecimal(dic["BZSL"]);
            //        feeTotal += Convert.ToDecimal(dic["HSJJ"]) * Convert.ToDecimal(dic["BZHL"]);
            //    }
            //    JObject summary = new JObject();
            //    summary.Add("GDNAME", "本页合计");
            //    summary.Add("BZSL", bzslTotal.ToString());
            //    summary.Add("HSJE", feeTotal.ToString("F2"));
            //    GridGoods.SummaryData = summary;
            //}
        }
Example #2
0
 protected void GridGoods_AfterEdit(object sender, FineUIPro.GridAfterEditEventArgs e)
 {
     if (e.ColumnID == "BARCODE")
     {
         PageContext.RegisterStartupScript(Window1.GetSaveStateReference(hfdValue.ClientID) + Window1.GetShowReference("~/ERPQuery/GoodsWindow.aspx", "商品信息查询"));
     }
 }
Example #3
0
        protected void GridGoods_AfterEdit(object sender, FineUIPro.GridAfterEditEventArgs e)
        {
            string[] strCell = GridGoods.SelectedCell;
            List <Dictionary <string, object> > newDict = GridGoods.GetNewAddedList();

            if (newDict.Count == 0)
            {
                return;
            }
            if (e.ColumnID == "BZSL" || e.ColumnID == "HSJJ")
            {
                PageContext.RegisterStartupScript(GridGoods.GetUpdateCellValueReference(strCell[0], strCell[1], GetJObject(newDict[e.RowIndex]).ToString()));

                if (e.RowIndex != Convert.ToInt32(strCell[0]))
                {
                    PageContext.RegisterStartupScript(GridGoods.GetUpdateCellValueReference(strCell[0], strCell[1], GetJObject(newDict[Convert.ToInt32(strCell[0])]).ToString()));
                }
                //计算合计数量
                decimal bzslTotal = 0, feeTotal = 0;
                foreach (Dictionary <string, object> dic in newDict)
                {
                    bzslTotal += Convert.ToDecimal(dic["BZSL"]);
                    feeTotal  += Convert.ToDecimal(dic["HSJJ"]) * Convert.ToDecimal(dic["BZSL"]) * Convert.ToDecimal(dic["BZHL"]);
                }
                JObject summary = new JObject();
                summary.Add("GDNAME", "本页合计");
                summary.Add("BZSL", bzslTotal.ToString());
                summary.Add("HSJE", feeTotal.ToString("F2"));
                GridGoods.SummaryData = summary;
            }
        }
Example #4
0
        protected void GridGoods_AfterEdit(object sender, FineUIPro.GridAfterEditEventArgs e)
        {
            string[] strCell          = GridGoods.SelectedCell;
            int      selectedRowIndex = GridGoods.SelectedRowIndex;
            List <Dictionary <string, object> > newDict = GridGoods.GetNewAddedList();

            if (newDict.Count == 0)
            {
                return;
            }
            if (e.ColumnID == "BZSL" || e.ColumnID == "HSJJ")
            {
                if (!PubFunc.isNumeric(Doc.GetGridInf(GridGoods, e.RowID, "BZHL")) || !PubFunc.isNumeric(Doc.GetGridInf(GridGoods, e.RowID, "BZSL")) || !PubFunc.isNumeric(Doc.GetGridInf(GridGoods, e.RowID, "HSJJ")))
                {
                    if (!PubFunc.isNumeric(newDict[e.RowIndex]["BZHL"].ToString()) || !PubFunc.isNumeric(newDict[e.RowIndex]["BZSL"].ToString()) || !PubFunc.isNumeric(newDict[e.RowIndex]["HSJJ"].ToString()))
                    {
                        Alert.Show("商品信息异常,请详细检查商品信息:包装含量或价格!", "异常信息", MessageBoxIcon.Warning);
                        return;
                    }
                }
                JObject defaultObj = Doc.GetJObject(GridGoods, e.RowID);
                //if (Convert.ToDecimal(Doc.GetGridInf(GridGoods, e.RowID, "BZSL")) > Convert.ToDecimal(Doc.GetGridInf(GridGoods, e.RowID, "NUM1")))
                //{

                //    defaultObj["BZSL"] = "0";
                //    PageContext.RegisterStartupScript(GridGoods.GetUpdateCellValueReference(e.RowID, defaultObj));
                //    Alert.Show("申请数不能大于库存数量", "异常信息", MessageBoxIcon.Warning);
                //    return;
                //}
                decimal hl = 0, rs = 0, jg = 0;
                decimal.TryParse((defaultObj["BZHL"] ?? "0").ToString(), out hl);
                decimal.TryParse((defaultObj["BZSL"] ?? "0").ToString(), out rs);
                decimal.TryParse((defaultObj["HSJJ"] ?? "0").ToString(), out jg);
                defaultObj["DHSL"] = rs * hl;
                defaultObj["HSJE"] = Math.Round(rs * jg, 2).ToString("F2");
                PageContext.RegisterStartupScript(GridGoods.GetUpdateCellValueReference(e.RowID, defaultObj));

                //计算合计数量
                decimal bzslTotal = 0, feeTotal = 0;
                foreach (Dictionary <string, object> dic in newDict)
                {
                    if (dic["BZSL"].ToString().Length > 0 && dic["HSJJ"].ToString().Length > 0)
                    {
                        bzslTotal += Convert.ToDecimal(dic["BZSL"]);
                        feeTotal  += Convert.ToDecimal(dic["HSJJ"]) * Convert.ToDecimal(dic["BZSL"]) * Convert.ToDecimal(dic["BZHL"]);
                    }
                }
                JObject summary = new JObject();
                summary.Add("GDNAME", "本页合计");
                summary.Add("BZSL", bzslTotal.ToString());
                summary.Add("HSJE", feeTotal.ToString("F2"));
                GridGoods.SummaryData = summary;
            }
        }
Example #5
0
        protected void GridGoods_AfterEdit(object sender, FineUIPro.GridAfterEditEventArgs e)
        {
            if (hdfOper.Text == "audit" || (",M,N").IndexOf(docFLAG.SelectedValue) < 0)
            {
                return;
            }
            string[] strCell = GridGoods.SelectedCell;
            List <Dictionary <string, object> > newDict = GridGoods.GetNewAddedList();

            if (newDict.Count == 0)
            {
                return;
            }
            #region 取消其他计算列
            if (e.ColumnID == "BZSL")
            {
                if (!PubFunc.isNumeric(Doc.GetGridInf(GridGoods, e.RowID, "BZHL")) || !PubFunc.isNumeric(Doc.GetGridInf(GridGoods, e.RowID, "BZSL")) || !PubFunc.isNumeric(Doc.GetGridInf(GridGoods, e.RowID, "HSJJ")))
                {
                    Alert.Show("商品信息异常,请详细检查商品信息:包装含量、价格或数量!", "异常信息", MessageBoxIcon.Warning);
                    return;
                }
                JObject defaultObj = Doc.GetJObject(GridGoods, e.RowID);
                decimal hl = 0, rs = 0, jg = 0;
                decimal.TryParse((defaultObj["BZHL"] ?? "0").ToString(), out hl);
                decimal.TryParse((defaultObj["BZSL"] ?? "0").ToString(), out rs);
                decimal.TryParse((defaultObj["HSJJ"] ?? "0").ToString(), out jg);
                defaultObj["DHSL"] = rs * hl;
                defaultObj["HSJE"] = Math.Round(rs * jg, 2).ToString("F2");
                PageContext.RegisterStartupScript(GridGoods.GetUpdateCellValueReference(e.RowID, defaultObj));

                //计算合计数量
                decimal bzslTotal = 0, feeTotal = 0, dhslTotal = 0;
                foreach (Dictionary <string, object> dic in newDict)
                {
                    if (dic["BZSL"] != null)
                    {
                        if (!PubFunc.StrIsEmpty(dic["BZSL"].ToString()))
                        {
                            bzslTotal += Convert.ToDecimal(dic["BZSL"]);
                            feeTotal  += Convert.ToDecimal(dic["HSJJ"]) * Convert.ToDecimal(dic["BZSL"]);
                            dhslTotal += Convert.ToDecimal(dic["BZHL"]) * Convert.ToDecimal(dic["BZSL"]);
                        }
                    }
                }
                JObject summary = new JObject();
                summary.Add("GDNAME", "本页合计");
                summary.Add("BZSL", bzslTotal.ToString());
                summary.Add("HSJE", feeTotal.ToString("F2"));
                summary.Add("DHSL", dhslTotal.ToString());
                GridGoods.SummaryData = summary;
            }
            #endregion
        }
Example #6
0
 protected void GridGoods_AfterEdit(object sender, FineUIPro.GridAfterEditEventArgs e)
 {
     if (e.ColumnID == "HSJJ")
     {
         JObject defaultObj = Doc.GetJObject(GridGoods, e.RowID);
         decimal hl = 0, jg = 0;
         decimal.TryParse((defaultObj["SL"] ?? "0").ToString(), out hl);
         decimal.TryParse((defaultObj["HSJJ"] ?? "0").ToString(), out jg);
         defaultObj["HSJE"] = Math.Round(hl * jg, 2).ToString("F2");
         PageContext.RegisterStartupScript(GridGoods.GetUpdateCellValueReference(e.RowID, defaultObj));
     }
 }
Example #7
0
        protected void GridGoods_AfterEdit(object sender, FineUIPro.GridAfterEditEventArgs e)
        {
            List <Dictionary <string, object> > newDict = GridGoods.GetNewAddedList();

            if (newDict.Count == 0)
            {
                return;
            }
            if (e.ColumnID == "DHS")
            {
                string[] strCell = GridGoods.SelectedCell;
                if (!PubFunc.isNumeric(Doc.GetGridInf(GridGoods, e.RowID, "DHS")))
                {
                    Alert.Show("商品信息异常,请详细检查采购值!", "异常信息", MessageBoxIcon.Warning);
                    return;
                }
                JObject defaultObj = Doc.GetJObject(GridGoods, e.RowID);
                decimal hl = 0, jg = 0;
                decimal.TryParse((defaultObj["DHS"] ?? "0").ToString(), out hl);
                decimal.TryParse((defaultObj["HSJJ"] ?? "0").ToString(), out jg);
                defaultObj["HSJE"] = Math.Round(hl * jg, 2).ToString("F2");

                PageContext.RegisterStartupScript(GridGoods.GetUpdateCellValueReference(e.RowID, defaultObj));
                //计算合计数量
                decimal bzslTotal = 0, feeTotal = 0;
                foreach (Dictionary <string, object> dic in newDict)
                {
                    if ((dic["DHS"] ?? "0").ToString().Length > 0 && (dic["HSJJ"] ?? "0").ToString().Length > 0)
                    {
                        bzslTotal += Convert.ToDecimal(dic["DHS"] ?? "0");
                        feeTotal  += Convert.ToDecimal(dic["HSJJ"] ?? "0") * Convert.ToDecimal(dic["DHS"] ?? "0");
                    }
                }
                JObject summary = new JObject();
                summary.Add("GDNAME", "本页合计");
                summary.Add("DHS", bzslTotal.ToString());
                summary.Add("HSJE", feeTotal.ToString("F2"));
                GridGoods.SummaryData = summary;
            }
        }
Example #8
0
        protected void GridGoods_AfterEdit(object sender, FineUIPro.GridAfterEditEventArgs e)
        {
            string[] strCell = GridGoods.SelectedCell;
            List <Dictionary <string, object> > newDict = GridGoods.GetNewAddedList();

            if (newDict.Count == 0)
            {
                return;
            }
            if (e.ColumnID == "BZSL")
            {
                if (!PubFunc.isNumeric(Doc.GetGridInf(GridGoods, e.RowID, "BZHL")) || !PubFunc.isNumeric(Doc.GetGridInf(GridGoods, e.RowID, "BZSL")) || !PubFunc.isNumeric(Doc.GetGridInf(GridGoods, e.RowID, "HSJJ")))
                {
                    Alert.Show("商品信息异常,请详细检查商品信息:包装含量、价格或数量!", "异常信息", MessageBoxIcon.Warning);
                    return;
                }
                JObject defaultObj = Doc.GetJObject(GridGoods, e.RowID);
                decimal hl = 0, rs = 0, jg = 0;
                decimal.TryParse((defaultObj["BZHL"] ?? "0").ToString(), out hl);
                decimal.TryParse((defaultObj["BZSL"] ?? "0").ToString(), out rs);
                decimal.TryParse((defaultObj["HSJJ"] ?? "0").ToString(), out jg);
                defaultObj["DHSL"] = rs * hl;
                defaultObj["HSJE"] = Math.Round(rs * jg, 2).ToString("F2");
                PageContext.RegisterStartupScript(GridGoods.GetUpdateCellValueReference(e.RowID, defaultObj));

                //计算合计数量
                decimal bzslTotal = 0, feeTotal = 0;
                foreach (Dictionary <string, object> dic in newDict)
                {
                    bzslTotal += Convert.ToDecimal(dic["BZSL"]);
                    feeTotal  += Convert.ToDecimal(dic["HSJJ"]) * Convert.ToDecimal(dic["BZSL"]);
                }
                JObject summary = new JObject();
                summary.Add("GDNAME", "本页合计");
                summary.Add("BZSL", bzslTotal.ToString());
                summary.Add("HSJE", feeTotal.ToString("F2"));
                GridGoods.SummaryData = summary;
            }
            else if (e.ColumnID == "PH")
            {
                String gdseq = Doc.GetGridInf(GridGoods, e.RowID, "GDSEQ");
                if (gdseq.Length < 1)
                {
                    Alert.Show("请先选择商品信息!", "异常信息", MessageBoxIcon.Question);
                    return;
                }
                String ph = Doc.GetGridInf(GridGoods, e.RowID, "PH");
                if (ph.Length < 1 && DbHelperOra.Exists(string.Format("SELECT 1 FROM DOC_GOODS WHERE GDSEQ = '{0}' AND ISLOT = '2'", gdseq)))
                {
                    Alert.Show("请填写商品[" + gdseq + "]批次信息!", "异常信息", MessageBoxIcon.Warning);
                    return;
                }

                if (ph.ToString() == "\\")
                {
                    DataTable dtPH = Doc.GetGoodsPH_New(gdseq, docDEPTID.SelectedValue);
                    if (dtPH != null && dtPH.Rows.Count > 0)
                    {
                        hfdRowIndex.Text   = GridGoods.SelectedRowIndex.ToString();
                        GridLot.DataSource = dtPH;
                        GridLot.DataBind();
                        WindowLot.Hidden = false;
                    }
                    else
                    {
                        Alert.Show("商品[" + gdseq + "]已无库存,请检查!", MessageBoxIcon.Warning);
                    }
                }
            }
        }
Example #9
0
        protected void GridGoods_AfterEdit(object sender, FineUIPro.GridAfterEditEventArgs e)
        {
            string[] strCell = GridGoods.SelectedCell;
            List <Dictionary <string, object> > newDict = GridGoods.GetNewAddedList();

            if (e.ColumnID == "BZSL")
            {
                if (!PubFunc.isNumeric(Doc.GetGridInf(GridGoods, e.RowID, "BZHL")) || !PubFunc.isNumeric(Doc.GetGridInf(GridGoods, e.RowID, "BZSL")) || !PubFunc.isNumeric(Doc.GetGridInf(GridGoods, e.RowID, "HSJJ")))
                {
                    if (Doc.GetGridInf(GridGoods, e.RowID, "BZHL") == "非赠品")
                    {
                        Alert.Show("商品信息异常,请详细检查商品信息:包装含量、价格或数量!", "异常信息", MessageBoxIcon.Warning);
                        return;
                    }
                }
                //处理返回jobject
                JObject defaultObj = Doc.GetJObject(GridGoods, e.RowID);
                decimal hl = 0, rs = 0, jg = 0;
                decimal.TryParse((defaultObj["BZHL"] ?? "0").ToString(), out hl);
                decimal.TryParse((defaultObj["BZSL"] ?? "0").ToString(), out rs);
                decimal.TryParse((defaultObj["HSJJ"] ?? "0").ToString(), out jg);
                defaultObj["XSSL"] = rs * hl;
                defaultObj["HSJE"] = Math.Round(rs * jg, 2).ToString("F2");
                PageContext.RegisterStartupScript(GridGoods.GetUpdateCellValueReference(e.RowID, defaultObj));
                if (Convert.ToDecimal(Doc.GetGridInf(GridGoods, e.RowID, "BZSL")) * Convert.ToDecimal(Doc.GetGridInf(GridGoods, e.RowID, "BZHL")) > Convert.ToDecimal(Doc.GetGridInf(GridGoods, e.RowID, "DHSL")) && Doc.GetGridInf(GridGoods, e.RowID, "NUM1NAME") == "非赠品")
                {
                    Alert.Show("拣货数量不能大于申领数量!", "异常信息", MessageBoxIcon.Warning);
                    return;
                }
                //计算合计数量
                decimal bzslTotal = 0, feeTotal = 0, dhslTotal = 0;
                foreach (Dictionary <string, object> dic in newDict)
                {
                    bzslTotal += Convert.ToDecimal(dic["BZSL"] ?? "0");
                    feeTotal  += Convert.ToDecimal(dic["HSJJ"] ?? "0") * Convert.ToDecimal(dic["BZSL"] ?? "0");
                    dhslTotal += Convert.ToDecimal(dic["DHSL"] ?? "0");
                }
                JObject summary = new JObject();
                summary.Add("GDNAME", "本页合计");
                summary.Add("BZSL", bzslTotal.ToString());
                summary.Add("HSJE", feeTotal.ToString("F2"));
                summary.Add("DHSL", dhslTotal.ToString());
                GridGoods.SummaryData = summary;
            }
            else if (e.ColumnID == "PH")
            {
                String gdseq = Doc.GetGridInf(GridGoods, e.RowID, "GDSEQ");
                if (gdseq.Length < 1)
                {
                    Alert.Show("请先选择商品信息!", "异常信息", MessageBoxIcon.Warning);
                    return;
                }
                DataTable dtPH = Doc.GetGoodsPHKC(gdseq, docDEPTOUT.SelectedValue);
                if (dtPH != null && dtPH.Rows.Count > 0)
                {
                    if (dtPH.Rows.Count == 1)
                    {
                        JObject defaultObj = Doc.GetJObject(GridGoods, e.RowID);
                        defaultObj["PH"]    = dtPH.Rows[0]["PH"].ToString();
                        defaultObj["PZWH"]  = dtPH.Rows[0]["PZWH"].ToString();
                        defaultObj["RQ_SC"] = dtPH.Rows[0]["RQ_SC"].ToString();
                        defaultObj["YXQZ"]  = dtPH.Rows[0]["YXQZ"].ToString();
                        defaultObj["KCSL"]  = dtPH.Rows[0]["KCSL"].ToString();
                        defaultObj["HWID"]  = dtPH.Rows[0]["HWID"].ToString();
                        PageContext.RegisterStartupScript(GridGoods.GetUpdateCellValueReference(e.RowID, defaultObj));
                    }
                    else
                    {
                        GridLot.DataSource = dtPH;
                        GridLot.DataBind();
                        WindowLot.Hidden = false;
                    }
                }
                else
                {
                    Alert.Show("请先维护商品批号!", MessageBoxIcon.Warning);
                }
            }
        }
Example #10
0
        protected void GridGoods_AfterEdit(object sender, FineUIPro.GridAfterEditEventArgs e)
        {
            string[] strCell = GridGoods.SelectedCell;
            List <Dictionary <string, object> > newDict = GridGoods.GetNewAddedList();

            if (newDict.Count == 0)
            {
                return;
            }
            if (e.ColumnID == "BZSL")
            {
                JObject defaultObj = Doc.GetJObject(GridGoods, e.RowID);
                decimal hl = 0, rs = 0, jg = 0;
                decimal.TryParse((defaultObj["BZHL"] ?? "0").ToString(), out hl);
                decimal.TryParse((defaultObj["BZSL"] ?? "0").ToString(), out rs);
                decimal.TryParse((defaultObj["HSJJ"] ?? "0").ToString(), out jg);
                defaultObj["DHSL"] = rs * hl;
                defaultObj["HSJE"] = Math.Round(rs * jg, 2).ToString("F2");
                PageContext.RegisterStartupScript(GridGoods.GetUpdateCellValueReference(e.RowID, defaultObj));
                //计算合计数量
                decimal bzslTotal = 0, feeTotal = 0;
                foreach (Dictionary <string, object> dic in newDict)
                {
                    decimal.TryParse(dic["BZSL"].ToString(), out jg);
                    bzslTotal += jg;

                    feeTotal += Convert.ToDecimal(dic["HSJJ"] ?? "0") * Convert.ToDecimal(dic["BZSL"] ?? "0") * Convert.ToDecimal(dic["BZHL"]);
                }
                JObject summary = new JObject();
                summary.Add("GDNAME", "本页合计");
                summary.Add("BZSL", bzslTotal.ToString());
                summary.Add("HSJE", feeTotal.ToString("F2"));
                GridGoods.SummaryData = summary;
            }
            else if (e.ColumnID == "PH")
            {
                JObject defaultObj = Doc.GetJObject(GridGoods, e.RowID);
                String  Sql        = string.Format("SELECT SUM(A.KCSL),A.PH,A.YXQZ,A.RQ_SC,B.PIZNO PZWH FROM DAT_GOODSSTOCK A,DOC_GOODS B WHERE A.DEPTID = '{0}' AND A.GDSEQ ='{1}' AND A.GDSEQ=B.GDSEQ  AND KCSL > LOCKSL GROUP BY PH,YXQZ,B.PIZNO,A.RQ_SC ", docDEPTOUT.SelectedValue, defaultObj["GDSEQ"].ToString());
                if (defaultObj["PH"].ToString() != "\\")
                {
                    Sql = string.Format("SELECT SUM(A.KCSL),A.PH,A.YXQZ,A.RQ_SC FROM DAT_GOODSSTOCK A WHERE A.DEPTID = '{0}' AND A.GDSEQ ='{1}'AND PH = '{2}'  AND KCSL > LOCKSL GROUP BY PH,YXQZ,A.RQ_SC", docDEPTOUT.SelectedValue, defaultObj["GDSEQ"].ToString(), defaultObj["PH"]);
                }
                DataTable dtPH = DbHelperOra.Query(Sql).Tables[0];
                if (dtPH != null && dtPH.Rows.Count > 0)
                {
                    if (dtPH.Rows.Count == 1)
                    {
                        defaultObj["PH"]    = dtPH.Rows[0]["PH"].ToString();
                        defaultObj["YXQZ"]  = dtPH.Rows[0]["YXQZ"].ToString();
                        defaultObj["RQ_SC"] = dtPH.Rows[0]["RQ_SC"].ToString();
                        PageContext.RegisterStartupScript(GridGoods.GetUpdateCellValueReference(strCell[0], defaultObj));
                    }
                    else
                    {
                        GridLot.DataSource = dtPH;
                        GridLot.DataBind();
                        WindowLot.Hidden = false;
                    }
                }
                //else
                //{
                //    Alert.Show("科室无可调出库存!", "提示信息", MessageBoxIcon.Warning);
                //    return;
                //}
            }
        }
Example #11
0
        protected void GridGoods_AfterEdit(object sender, FineUIPro.GridAfterEditEventArgs e)
        {
            List <Dictionary <string, object> > newDict = GridGoods.GetNewAddedList();

            if (newDict.Count == 0)
            {
                return;
            }

            //处理返回jobject
            JObject defaultObj = Doc.GetJObject(GridGoods, e.RowID);

            //string cell = string.Format("[{0},{1}]", e.RowIndex, intCell[1]);
            if (e.ColumnID == "BZSL")
            {
                if (!PubFunc.isNumeric(Doc.GetGridInf(GridGoods, e.RowID, "BZHL")) || !PubFunc.isNumeric(Doc.GetGridInf(GridGoods, e.RowID, "BZSL")) || !PubFunc.isNumeric(Doc.GetGridInf(GridGoods, e.RowID, "HSJJ")))
                {
                    Alert.Show("商品信息异常,请详细检查商品信息:包装含量或价格!", "异常信息", MessageBoxIcon.Warning);
                    return;
                }

                if ((Convert.ToInt32(defaultObj["BZSL"]) > Convert.ToInt32(defaultObj["KCSL"])) ||
                    (Convert.ToInt32(defaultObj["BZSL"]) * Convert.ToInt32(defaultObj["BZHL"]) > Convert.ToInt32(defaultObj["KCSL"])))
                {
                    Alert.Show("退货数量(最小包装)不能大于库存数量!", "异常信息", MessageBoxIcon.Warning);
                    defaultObj["BZSL"] = "0";
                }

                decimal hl = 0, rs = 0, jg = 0;
                decimal.TryParse((defaultObj["BZHL"] ?? "0").ToString(), out hl);
                decimal.TryParse((defaultObj["BZSL"] ?? "0").ToString(), out rs);
                decimal.TryParse((defaultObj["HSJJ"] ?? "0").ToString(), out jg);
                defaultObj["THSL"] = rs * hl;
                defaultObj["HSJE"] = Math.Round(rs * jg, 2).ToString("F2");
                PageContext.RegisterStartupScript(GridGoods.GetUpdateCellValueReference(e.RowID, defaultObj));
                #region //计算合计数量
                decimal bzslTotal = 0, feeTotal = 0, thslTotal = 0;
                foreach (Dictionary <string, object> dic in newDict)
                {
                    if ((dic["BZSL"] ?? "0").ToString().Length > 0 && (dic["HSJJ"] ?? "0").ToString().Length > 0)
                    {
                        bzslTotal += Convert.ToDecimal(dic["BZSL"] ?? "0");
                        feeTotal  += Convert.ToDecimal(dic["HSJJ"] ?? "0") * Convert.ToDecimal(dic["BZSL"] ?? "0");
                        thslTotal += Convert.ToDecimal(dic["BZHL"] ?? "0") * Convert.ToDecimal(dic["BZSL"] ?? "0");
                    }

                    object objISFLAG5 = DbHelperOra.GetSingle(string.Format("SELECT ISFLAG5 FROM DOC_GOODS WHERE GDSEQ = '{0}'", dic["GDSEQ"]));

                    if (objISFLAG5.ToString() == "N")
                    {
                        string str = Convert.ToString(Convert.ToDecimal(dic["BZSL"] ?? "0"));
                        if (Convert.ToDecimal(dic["BZSL"]) != (int)Convert.ToDecimal(dic["BZSL"]) && Convert.ToDecimal(dic["BZHL"] ?? "0") == 1)
                        {
                            Alert.Show("当前商品不支持申领数为小数,请调整", "消息提示", MessageBoxIcon.Warning);
                        }
                    }
                }

                JObject summary = new JObject();
                summary.Add("GDNAME", "本页合计");
                summary.Add("BZSL", bzslTotal.ToString());
                summary.Add("HSJE", feeTotal.ToString("F2"));
                summary.Add("THSL", thslTotal.ToString("F2"));

                GridGoods.SummaryData = summary;
                #endregion
            }
        }
Example #12
0
        protected void GridGoods_AfterEdit(object sender, FineUIPro.GridAfterEditEventArgs e)
        {
            string[] strCell = GridGoods.SelectedCell;
            List <Dictionary <string, object> > newDict = GridGoods.GetNewAddedList();

            if (newDict.Count == 0)
            {
                return;
            }
            if (e.ColumnID == "BZSL")
            {
                if (!PubFunc.isNumeric(Doc.GetGridInf(GridGoods, e.RowID, "BZHL")) || !PubFunc.isNumeric(Doc.GetGridInf(GridGoods, e.RowID, "BZSL")) || !PubFunc.isNumeric(Doc.GetGridInf(GridGoods, e.RowID, "HSJJ")))
                {
                    Alert.Show("商品信息异常,请详细检查商品信息:包装含量、价格或数量!", "异常信息", MessageBoxIcon.Warning);
                    return;
                }
                JObject defaultObj = Doc.GetJObject(GridGoods, e.RowID);
                decimal hl = 0, rs = 0, jg = 0;
                decimal.TryParse((defaultObj["BZHL"] ?? "0").ToString(), out hl);
                decimal.TryParse((defaultObj["BZSL"] ?? "0").ToString(), out rs);
                decimal.TryParse((defaultObj["HSJJ"] ?? "0").ToString(), out jg);
                defaultObj["DHSL"] = rs * hl;
                defaultObj["HSJE"] = Math.Round(rs * jg, 2).ToString("F2");
                PageContext.RegisterStartupScript(GridGoods.GetUpdateCellValueReference(e.RowID, defaultObj));
                //计算合计数量
                decimal bzslTotal = 0, feeTotal = 0;
                foreach (Dictionary <string, object> dic in newDict)
                {
                    bzslTotal += Convert.ToDecimal(dic["BZSL"]);
                    feeTotal  += Convert.ToDecimal(dic["HSJJ"]) * Convert.ToDecimal(dic["BZSL"]);
                }
                JObject summary = new JObject();
                summary.Add("GDNAME", "本页合计");
                summary.Add("BZSL", bzslTotal.ToString());
                summary.Add("HSJE", feeTotal.ToString("F2"));
                GridGoods.SummaryData = summary;
            }
            else if (e.ColumnID == "PH")
            {
                //校验批次是否存在
                JObject defaultObj = Doc.GetJObject(GridGoods, e.RowID);
                if (defaultObj["PH"].ToString().Length > 0)
                {
                    DataTable dt = DbHelperOra.Query(String.Format(@"SELECT A.PH,A.YXQZ,A.RQ_SC
                            FROM DAT_GOODSJXC A
                            WHERE GDSEQ = '{0}' AND DEPTID = '{1}' AND PH = '{2}'", defaultObj["GDSEQ"], docDEPTID.Text, defaultObj["PH"])).Tables[0];
                    if (dt.Rows.Count > 0)
                    {
                        defaultObj["YXQZ"]  = dt.Rows[0]["YXQZ"].ToString();
                        defaultObj["RQ_SC"] = dt.Rows[0]["RQ_SC"].ToString();
                        PageContext.RegisterStartupScript(GridGoods.GetUpdateCellValueReference(e.RowID, defaultObj));
                    }
                    else
                    {
                        defaultObj["PH"]    = "";
                        defaultObj["YXQZ"]  = "";
                        defaultObj["RQ_SC"] = "";
                        PageContext.RegisterStartupScript(GridGoods.GetUpdateCellValueReference(e.RowID, defaultObj));
                        Alert.Show("输入的批次信息错误!", "提示信息", MessageBoxIcon.Warning);
                        return;
                    }
                }
            }
        }
Example #13
0
 protected void GridGoods_AfterEdit(object sender, FineUIPro.GridAfterEditEventArgs e)
 {
 }