Beispiel #1
0
        protected override void billSave()
        {
            #region 数据有效性验证
            if (ddlFLAG.SelectedValue != "M")
            {
                Alert.Show("非新单不能保存!", "消息提示", MessageBoxIcon.Warning);
                return;
            }
            List <Dictionary <string, object> > newDict = GridGoods.GetNewAddedList().OrderBy(x => x["MEMOGOODS"]).ToList();
            if (newDict.Count == 0)
            {
                Alert.Show("请输入【需求说明】", "消息提示", MessageBoxIcon.Warning);
                return;
            }
            if (PubFunc.FormDataCheck(FormDoc).Length > 0)
            {
                return;
            }
            List <Dictionary <string, object> > goodsData = new List <Dictionary <string, object> >();
            //判断是否有空行、批号填写是否符合要求
            for (int i = 0; i < newDict.Count; i++)
            {
                if (!string.IsNullOrWhiteSpace(newDict[i]["MEMOGOODS"].ToString()))
                {
                    if (newDict[i]["SL"] != null && string.IsNullOrWhiteSpace(newDict[i]["SL"].ToString()))
                    {
                        Alert.Show("请填写【数量】", "消息提示", MessageBoxIcon.Warning);
                        return;
                    }
                    goodsData.Add(newDict[i]);
                }
            }

            if (goodsData.Count == 0)//所有Gird行都为空行时
            {
                Alert.Show("至少填写一条【需求说明】", "消息提示", MessageBoxIcon.Warning);
                return;
            }
            //验证单据信息
            if (DbHelperOra.Exists("SELECT 1 FROM DAT_GOODSNEW_DOC where seqno = '" + tbxBILLNO.Text + "'") && tbxBILLNO.Enabled)
            {
                Alert.Show("您输入的单号已存在,请检查!");
                return;
            }


            #endregion

            if (PubFunc.StrIsEmpty(tbxBILLNO.Text))
            {
                tbxSEQNO.Text     = BillSeqGet();
                tbxBILLNO.Text    = tbxSEQNO.Text;
                tbxBILLNO.Enabled = false;
            }
            else
            {
                string flg = (string)DbHelperOra.GetSingle(string.Format("SELECT NVL(FLAG,'M') FROM DAT_GOODSNEW_DOC WHERE SEQNO='{0}'", tbxBILLNO.Text));
                if (!string.IsNullOrWhiteSpace(flg) && (",M,R").IndexOf(flg) < 0)
                {
                    Alert.Show("您输入的单据号存在重复信息,请重新输入或置空!", "消息提示", MessageBoxIcon.Warning);
                    return;
                }
                else
                {
                    tbxSEQNO.Text     = tbxBILLNO.Text;
                    tbxBILLNO.Enabled = false;
                }
            }

            MyTable mtType = new MyTable("DAT_GOODSNEW_DOC");
            mtType.ColRow          = PubFunc.FormDataHT(FormDoc);
            mtType.ColRow["SEQNO"] = tbxBILLNO.Text;
            mtType.ColRow.Add("BILLTYPE", BillType);
            mtType.ColRow.Add("SUBNUM", goodsData.Count);
            List <CommandInfo> cmdList  = new List <CommandInfo>();
            MyTable            mtTypeMx = new MyTable("DAT_GOODSNEW_COM");
            //先删除单据信息在插入
            cmdList.Add(new CommandInfo("delete DAT_GOODSNEW_DOC where seqno='" + tbxBILLNO.Text + "'", null)); //删除单据台头
            cmdList.Add(new CommandInfo("delete DAT_GOODSNEW_COM where seqno='" + tbxBILLNO.Text + "'", null)); //删除单据明细
            cmdList.AddRange(mtType.InsertCommand());
            for (int i = 0; i < goodsData.Count; i++)
            {
                mtTypeMx.ColRow = PubFunc.GridDataGet(goodsData[i]);


                if (PubFunc.StrIsEmpty(mtTypeMx.ColRow["MEMOGOODS"].ToString()))
                {
                    Alert.Show("【需求说明】为空,无法进行【商品新增管理】操作。");
                    return;
                }

                mtTypeMx.ColRow.Add("SEQNO", tbxBILLNO.Text);
                mtTypeMx.ColRow.Add("ROWNO", i + 1);

                //if (PubFunc.StrIsEmpty(mtTypeMx.ColRow["HSJE"].ToString()) || mtTypeMx.ColRow["HSJE"].ToString() == "0")
                //{
                //    string strSL = "0";
                //    string strHSJJ = "0";
                //    if (mtTypeMx.ColRow["SL"] != null && !string.IsNullOrWhiteSpace(mtTypeMx.ColRow["SL"].ToString()))
                //    {
                //        strSL = mtTypeMx.ColRow["SL"].ToString();
                //    }
                //    if (mtTypeMx.ColRow["HSJJ"] != null && !string.IsNullOrWhiteSpace(mtTypeMx.ColRow["HSJJ"].ToString()))
                //    {
                //        strSL = mtTypeMx.ColRow["HSJJ"].ToString();
                //    }
                //    mtTypeMx.ColRow["HSJE"] = decimal.Parse(strSL) * decimal.Parse(strHSJJ);
                //}

                cmdList.Add(mtTypeMx.Insert());
            }

            if (DbHelperOra.ExecuteSqlTran(cmdList))
            {
                Alert.Show("商品新增信息保存成功!");
                //OperLog("商品新增管理", "修改单据【" + tbxBILLNO.Text + "】");
                billOpen(tbxBILLNO.Text);

                //billNew();
                //billLockDoc(true);
            }
        }
Beispiel #2
0
 private void save(string flag = "N")
 {
     #region 检查有效性
     if (("NR").IndexOf(ddlFLAG.SelectedValue) < 0)
     {
         Alert.Show("非新单不能保存!", "消息提示", MessageBoxIcon.Warning);
         return;
     }
     if (Convert.ToDateTime(dpkPDRQ.Text) < Convert.ToDateTime(DateTime.Now.ToShortDateString()))
     {
         Alert.Show("盘点日期不能小于当前日期");
         return;
     }
     List <Dictionary <string, object> > newDict   = GridGoods.GetNewAddedList().OrderBy(x => x["CODE"]).ToList();
     List <Dictionary <string, object> > goodsData = new List <Dictionary <string, object> >();
     //判断是否有空行
     if (newDict.Count > 0)
     {
         for (int i = 0; i < newDict.Count; i++)
         {
             if (!string.IsNullOrWhiteSpace(newDict[i]["CODE"].ToString()) && !string.IsNullOrWhiteSpace(newDict[i]["NAME"].ToString()))
             {
                 goodsData.Add(newDict[i]);
             }
         }
     }
     else
     {
         Alert.Show("请追加盘点部门!", "消息提示", MessageBoxIcon.Warning);
         return;
     }
     #endregion
     if (PubFunc.StrIsEmpty(tbxBILLNO.Text))
     {
         tbxBILLNO.Text = BillSeqGet();
     }
     MyTable mtType = new MyTable("dat_pdplan_doc");
     mtType.ColRow          = PubFunc.FormDataHT(FormDoc);
     mtType.ColRow["SEQNO"] = tbxBILLNO.Text;
     mtType.ColRow["FLAG"]  = "N";//所有单据在保存时单据状态一律为新增N
     mtType.ColRow.Add("BILLTYPE", BillType);
     mtType.ColRow.Add("SUBNUM", goodsData.Count);
     //mtType.ColRow.Add("XSTYPE", "1");
     List <CommandInfo> cmdList  = new List <CommandInfo>();
     MyTable            mtTypeMx = new MyTable("dat_pdplan_com");
     //先删除单据信息在插入
     cmdList.Add(mtType.DeleteCommand(""));                                                            //删除单据台头
     cmdList.Add(new CommandInfo("delete dat_pdplan_com where seqno='" + tbxBILLNO.Text + "'", null)); //删除单据明细
     cmdList.AddRange(mtType.InsertCommand());
     for (int i = 0; i < goodsData.Count; i++)
     {
         mtTypeMx.ColRow = PubFunc.GridDataGet(goodsData[i]);
         mtTypeMx.ColRow.Add("SEQNO", tbxBILLNO.Text);
         mtTypeMx.ColRow["ROWNO"] = i + 1;
         mtTypeMx.ColRow.Remove("KSWC");
         mtTypeMx.ColRow.Remove("FLAGNAME");
         cmdList.Add(mtTypeMx.Insert());
     }
     DbHelperOra.ExecuteSqlTran(cmdList);
     tbxBILLNO.Enabled = false;
     if (flag == "N")
     {
         Alert.Show("单据保存成功");
     }
     billOpen(tbxBILLNO.Text);
     OperLog("盘点计划", "修改单据【" + tbxBILLNO.Text + "】");
     SaveSuccess = true;
 }
Beispiel #3
0
        protected override void billAudit()
        {
            #region 数据有效性验证
            if (ddlFLAG.SelectedValue == "Y")
            {
                Alert.Show("本条使用信息已经审核确认,不需要再次审核!", "消息提示", MessageBoxIcon.Warning);
                return;
            }
            List <Dictionary <string, object> > newDict = GridGoods.GetNewAddedList().OrderBy(x => x["MEMOGOODS"]).ToList();
            //if (newDict.Count == 0)
            //{
            //    Alert.Show("请输入【审批意见】", "消息提示", MessageBoxIcon.Warning);
            //    return;
            //}
            if (PubFunc.FormDataCheck(FormDoc).Length > 0)
            {
                return;
            }
            List <Dictionary <string, object> > goodsData = new List <Dictionary <string, object> >();

            #endregion

            MyTable mtType = new MyTable("DAT_GOODSNEW_DOC");
            mtType.ColRow         = PubFunc.FormDataHT(FormDoc);
            mtType.ColRow["FLAG"] = "Y";
            mtType.ColRow.Add("BILLTYPE", BillType);
            mtType.ColRow["SHR"]  = UserAction.UserID;
            mtType.ColRow["SHRQ"] = dpkSHRQ.SelectedDate;
            //mtType.ColRow.Add("SUBNUM", goodsData.Count);

            int    isNum     = 0;
            string strSUBSUM = "";
            //判断是否有空行、批号填写是否符合要求
            for (int i = 0; i < newDict.Count; i++)
            {
                if (newDict[i]["ISPASS"] != null && newDict[i]["ISPASS"].ToString() == "R")
                {
                    if (string.IsNullOrWhiteSpace(newDict[i]["MEMOPASS"].ToString()))
                    {
                        Alert.Show("第【" + (i + 1) + "】行请填写【审批意见】", "消息提示", MessageBoxIcon.Warning);
                        return;
                    }
                    isNum++;
                }
                else if (newDict[i]["ISPASS"] != null && newDict[i]["ISPASS"].ToString() == "Y")
                {
                    newDict[i]["MEMOPASS"] = "";
                }
                strSUBSUM += newDict[i]["HSJE"];
                goodsData.Add(newDict[i]);
            }
            if (isNum > 0)
            {
                mtType.ColRow["FLAG"] = "R";
            }

            mtType.ColRow["SUBNUM"] = goodsData.Count;
            mtType.ColRow["SUBSUM"] = strSUBSUM;

            List <CommandInfo> cmdList  = new List <CommandInfo>();
            MyTable            mtTypeMx = new MyTable("DAT_GOODSNEW_COM");
            //先删除单据信息在插入
            cmdList.Add(new CommandInfo("delete DAT_GOODSNEW_DOC where seqno='" + tbxBILLNO.Text + "'", null)); //删除单据台头
            cmdList.Add(new CommandInfo("delete DAT_GOODSNEW_COM where seqno='" + tbxBILLNO.Text + "'", null)); //删除单据明细
            cmdList.AddRange(mtType.InsertCommand());
            for (int i = 0; i < goodsData.Count; i++)
            {
                mtTypeMx.ColRow = PubFunc.GridDataGet(goodsData[i]);


                if (PubFunc.StrIsEmpty(mtTypeMx.ColRow["MEMOGOODS"].ToString()))
                {
                    Alert.Show("【需求说明】为空,无法进行【商品新增管理】操作。");
                    return;
                }

                mtTypeMx.ColRow.Add("SEQNO", tbxBILLNO.Text);
                mtTypeMx.ColRow.Add("ROWNO", i + 1);

                cmdList.Add(mtTypeMx.Insert());
            }

            if (DbHelperOra.ExecuteSqlTran(cmdList))
            {
                Alert.Show("商品新增信息审核成功!");
                OperLog("商品新增管理", "修改单据【" + tbxBILLNO.Text + "】");
                billOpen(tbxBILLNO.Text);
            }
        }
Beispiel #4
0
        private bool DataSave()
        {
            #region 数据有效性验证
            if ((",A").IndexOf(docFLAG.SelectedValue) < 0)
            {
                Alert.Show("调拨申请单状态不正确,不能保存!", "消息提示", MessageBoxIcon.Warning);
                return(false);
            }
            List <Dictionary <string, object> > newDict = GridGoods.GetNewAddedList().OrderBy(x => x["HWID"]).ToList();
            if (newDict.Count == 0)
            {
                Alert.Show("请输入商品信息", "消息提示", MessageBoxIcon.Warning);
                return(false);
            }
            List <Dictionary <string, object> > goodsData = new List <Dictionary <string, object> >();
            //判断是否有空行
            for (int i = 0; i < newDict.Count; i++)
            {
                if (!string.IsNullOrWhiteSpace(newDict[i]["GDSEQ"].ToString()) && !string.IsNullOrWhiteSpace(newDict[i]["GDNAME"].ToString()))
                {
                    goodsData.Add(newDict[i]);
                }
            }

            if (goodsData.Count == 0)//所有Gird行都为空行时
            {
                Alert.Show("商品信息不能为空", "消息提示", MessageBoxIcon.Warning);
                return(false);
            }
            #endregion

            if (PubFunc.StrIsEmpty(docSEQNO.Text))
            {
                docSEQNO.Text     = BillSeqGet();
                docBILLNO.Text    = docSEQNO.Text;
                docBILLNO.Enabled = false;
            }
            else
            {
                string flg = (string)DbHelperOra.GetSingle(string.Format("SELECT NVL(FLAG,'N') FROM DAT_DB_DOC WHERE SEQNO='{0}'", docSEQNO.Text));
                if (!PubFunc.StrIsEmpty(flg) && (",A").IndexOf(flg) < 0)
                {
                    Alert.Show("您输入的单据号存在重复信息,请重新输入或置空!", "消息提示", MessageBoxIcon.Warning);
                    return(false);
                }
                else
                {
                    docBILLNO.Text   = docSEQNO.Text;
                    docSEQNO.Enabled = false;
                }
            }
            MyTable mtType = new MyTable("DAT_DB_DOC");
            mtType.ColRow          = PubFunc.FormDataHT(FormDoc);
            mtType.ColRow["SEQNO"] = docBILLNO.Text;
            mtType.ColRow["FLAG"]  = "A";//所有单据在保存时单据状态一律为新增N
            mtType.ColRow.Add("BILLTYPE", BillType);
            mtType.ColRow.Add("SUBNUM", goodsData.Count);
            mtType.ColRow.Add("XSTYPE", "1");
            List <CommandInfo> cmdList  = new List <CommandInfo>();
            MyTable            mtTypeMx = new MyTable("DAT_DB_COM");
            //先删除单据信息在插入
            cmdList.Add(new CommandInfo("delete DAT_DB_DOC where seqno='" + docBILLNO.Text + "'", null)); //删除单据台头
            cmdList.Add(new CommandInfo("delete DAT_DB_COM where seqno='" + docBILLNO.Text + "'", null)); //删除单据明细

            decimal subsum = 0;
            for (int i = 0; i < goodsData.Count; i++)
            {
                mtTypeMx.ColRow = PubFunc.GridDataGet(goodsData[i]);
                mtTypeMx.ColRow.Add("SEQNO", docBILLNO.Text);
                mtTypeMx.ColRow["ROWNO"] = i + 1;
                mtTypeMx.ColRow.Add("PHID", mtTypeMx.ColRow["PH"]);

                if (PubFunc.StrIsEmpty(mtTypeMx.ColRow["HSJE"].ToString()) || mtTypeMx.ColRow["HSJE"].ToString() == "0")
                {
                    mtTypeMx.ColRow["HSJE"] = decimal.Parse(mtTypeMx.ColRow["HSJJ"].ToString()) * decimal.Parse(mtTypeMx.ColRow["BZSL"].ToString());
                }
                mtTypeMx.ColRow.Add("BHSJJ", 0);
                mtTypeMx.ColRow.Add("BHSJE", 0);
                mtTypeMx.ColRow.Remove("UNITNAME");
                mtTypeMx.ColRow.Remove("PRODUCERNAME");
                if (mtTypeMx.ColRow["XSSL"].ToString() == "")
                {
                    subsum += decimal.Parse(mtTypeMx.ColRow["HSJJ"].ToString()) * decimal.Parse(mtTypeMx.ColRow["BZSL"].ToString());
                }
                else
                {
                    subsum += decimal.Parse(mtTypeMx.ColRow["HSJJ"].ToString()) * decimal.Parse(mtTypeMx.ColRow["XSSL"].ToString());
                }
                cmdList.Add(mtTypeMx.Insert());
            }
            mtType.ColRow["SUBSUM"] = subsum;
            cmdList.AddRange(mtType.InsertCommand());
            return(DbHelperOra.ExecuteSqlTran(cmdList));
        }
Beispiel #5
0
        /// <summary>
        /// 增加多条文件申请打印记录
        /// </summary>
        public bool AddListJL(List <EDRS.Model.YX_DZJZ_WJSQDYJL> sqdyjlList, EDRS.Model.YX_DZJZ_WJSQDY sqdyModel, string xh)
        {
            int count = 0;

            Dictionary <object, object> hash = new Dictionary <object, object>();


            StringBuilder strSql = new StringBuilder();

            // strSql.Append(" update YX_DZJZ_WJSQDYJL set SFSC='Y' where XH=:YJXH ");
            strSql.Append(" Delete YX_DZJZ_WJSQDY where XH=:YJXH ");
            OracleParameter[] parameters1 =
            {
                new OracleParameter(":YJXH", OracleType.VarChar, 50)
            };
            parameters1[0].Value = xh;
            hash.Add(strSql.ToString(), parameters1);


            #region 添加阅卷申请打印
            strSql.Clear();
            strSql.Append("insert into YX_DZJZ_WJSQDY(");
            strSql.Append("LSZH,BMSAH,YJXH,JZWJBH,SQSJ,SQFS,DYSJ,DYFS,DYFY,DYR,DYRGH,DYBMBM,DYBMMC,DYDWBM,DYDWMC,SFSC,DYSQDH)");
            strSql.Append(" values (");
            strSql.Append(":LSZH,:BMSAH,:YJXH,:JZWJBH,:SQSJ,:SQFS,:DYSJ,:DYFS,:DYFY,:DYR,:DYRGH,:DYBMBM,:DYBMMC,:DYDWBM,:DYDWMC,:SFSC,:DYSQDH)");
            OracleParameter[] parameters =
            {
                new OracleParameter(":LSZH",   OracleType.VarChar,   100),
                new OracleParameter(":BMSAH",  OracleType.VarChar,   100),
                new OracleParameter(":YJXH",   OracleType.VarChar,    50),
                new OracleParameter(":JZWJBH", OracleType.VarChar,    50),
                new OracleParameter(":SQSJ",   OracleType.DateTime),
                new OracleParameter(":SQFS",   OracleType.Number,      4),
                new OracleParameter(":DYSJ",   OracleType.DateTime),
                new OracleParameter(":DYFS",   OracleType.Number,      4),
                new OracleParameter(":DYFY",   OracleType.Number,      8),
                new OracleParameter(":DYR",    OracleType.VarChar,    60),
                new OracleParameter(":DYRGH",  OracleType.Char,        4),
                new OracleParameter(":DYBMBM", OracleType.Char,        4),
                new OracleParameter(":DYBMMC", OracleType.VarChar,   300),
                new OracleParameter(":DYDWBM", OracleType.VarChar,    50),
                new OracleParameter(":DYDWMC", OracleType.VarChar,   300),
                new OracleParameter(":SFSC",   OracleType.Char,        1),
                new OracleParameter(":DYSQDH", OracleType.VarChar, 50)
            };
            parameters[0].Value  = sqdyModel.LSZH ?? "";
            parameters[1].Value  = sqdyModel.BMSAH ?? "";
            parameters[2].Value  = sqdyModel.YJXH ?? "";
            parameters[3].Value  = sqdyModel.JZWJBH ?? "";
            parameters[4].Value  = sqdyModel.SQSJ ?? (object)DBNull.Value;
            parameters[5].Value  = sqdyModel.SQFS ?? (object)DBNull.Value;
            parameters[6].Value  = sqdyModel.DYSJ ?? (object)DBNull.Value;
            parameters[7].Value  = sqdyModel.DYFS ?? (object)DBNull.Value;
            parameters[8].Value  = sqdyModel.DYFY ?? (object)DBNull.Value;
            parameters[9].Value  = sqdyModel.DYR ?? "";
            parameters[10].Value = sqdyModel.DYRGH ?? "";
            parameters[11].Value = sqdyModel.DYBMBM ?? "";
            parameters[12].Value = sqdyModel.DYBMMC ?? "";
            parameters[13].Value = sqdyModel.DYDWBM ?? "";
            parameters[14].Value = sqdyModel.DYDWMC ?? "";
            parameters[15].Value = sqdyModel.SFSC ?? "";
            parameters[16].Value = sqdyModel.DYSQDH ?? "";

            hash.Add(strSql.ToString(), parameters);
            #endregion

            #region 阅卷申请记录
            foreach (EDRS.Model.YX_DZJZ_WJSQDYJL model in sqdyjlList)
            {
                strSql.Clear();
                strSql.Append(" insert into YX_DZJZ_WJSQDYJL(");
                strSql.Append("XH,YJXH,WJXH,SFSC,ADDTIME)");
                strSql.Append(" values (");
                strSql.Append(":XH" + count + ",:YJXH" + count + ",:WJXH" + count + ",:SFSC" + count + ",:ADDTIME" + count + ")");
                OracleParameter[] parameters2 =
                {
                    new OracleParameter(":XH" + count,      OracleType.VarChar,  50),
                    new OracleParameter(":YJXH" + count,    OracleType.VarChar,  50),
                    new OracleParameter(":WJXH" + count,    OracleType.VarChar, 100),
                    new OracleParameter(":SFSC" + count,    OracleType.Char,      1),
                    new OracleParameter(":ADDTIME" + count, OracleType.DateTime)
                };
                parameters2[0].Value = xh;
                parameters2[1].Value = model.YJXH;
                parameters2[2].Value = model.WJXH;
                parameters2[3].Value = "N";
                parameters2[4].Value = model.ADDTIME;

                hash.Add(strSql.ToString(), parameters2);
                count++;
            }
            #endregion
            try
            {
                return(DbHelperOra.ExecuteSqlTran(hash));
            }
            catch (Exception ex)
            {
                EDRS.Common.LogHelper.LogError(this.context, "Exception", ex.Message, "public bool AddListJL(List<EDRS.Model.YX_DZJZ_WJSQDYJL> sqdyjlList, EDRS.Model.YX_DZJZ_WJSQDY sqdyModel, string xh)", "EDRS.OracleDAL.YX_DZJZ_WJSQDYJL");
            }
            return(false);
        }
Beispiel #6
0
        protected void btnSave_Click(object sender, EventArgs e)
        {
            if (tbxTITLE.Text.Trim().Length == 0)
            {
                Alert.Show("请输入【提醒标题】!");
                return;
            }
            if (tbxTITLE.Text.Trim().Length > 50)
            {
                Alert.Show("请输入有效主题,【提醒标题】字数不能超过50!");
                return;
            }
            if (dptWARINGRQ.SelectedDate == null)
            {
                Alert.Show("请输入【提醒时间】!");
                return;
            }
            if (dptWARINGRQ.SelectedDate < DateTime.Now.Date)
            {
                Alert.Show("【提醒时间】不能早于当前日期!");
                return;
            }
            if (rblISPRIVATE.SelectedValue != "N" && GridPerson.Rows.Count < 1)
            {
                Alert.Show("请选择可以查看信息的人员!", "错误提示", MessageBoxIcon.Warning);
                return;
            }

            string strTitle     = tbxTITLE.Text.Trim();
            string strWaringRQ  = Convert.ToDateTime(dptWARINGRQ.SelectedDate).ToString("yyyy-MM-dd");
            string strIsPrivate = rblISPRIVATE.SelectedValue;
            string strLookPer   = hfdLOOKPER.Text;
            string strMemo      = taxMEMO.Text;

            List <CommandInfo> cmdList = new List <CommandInfo>();

            if (hfdIsNew.Text == "" || hfdIsNew.Text == "Y")
            {
                hfdSeqno.Text = DbHelperOra.GetSingle("SELECT SEQ_PUBLIC.NEXTVAL FROM DUAL").ToString();
            }
            else
            {
                cmdList.Add(new CommandInfo("DELETE FROM SYS_MYMEMO_USER WHERE SEQNO='" + hfdSeqno.Text + "'", null));
            }

            if (rblISPRIVATE.SelectedValue != "N" && GridPerson.Rows.Count > 0)
            {
                string sql = string.Empty;
                //string[] users = hfdLOOKPER.Text.Split(',');
                //foreach (string item in users)
                string lrrq   = string.Empty;
                string lookrq = string.Empty;
                foreach (GridRow row in GridPerson.Rows)
                {
                    if (string.IsNullOrWhiteSpace(Convert.ToString(row.DataKeys[5])))
                    {
                        lookrq = "NULL";
                    }
                    else
                    {
                        lookrq = string.Format("TO_DATE('{0}','YYYY-MM-DD HH24:MI:SS')", row.DataKeys[5].ToString());
                    }
                    if (string.IsNullOrWhiteSpace(row.DataKeys[4].ToString()))
                    {
                        lrrq = "SYSDATE";
                    }
                    else
                    {
                        lrrq = string.Format("TO_DATE('{0}','YYYY-MM-DD HH24:MI:SS')", row.DataKeys[4].ToString());
                    }
                    sql = "INSERT INTO SYS_MYMEMO_USER(SEQNO,FLAG,LRRQ,ISPRIVATE,LOOKPER,LOOKRQ) VALUES(" + hfdSeqno.Text + ",'" + row.DataKeys[3].ToString() + "'," + lrrq + ",'" + rblISPRIVATE.SelectedValue + "','" + row.DataKeys[0].ToString() + "'," + lookrq + ")";
                    cmdList.Add(new CommandInfo(sql, null));
                }
            }
            else
            {
                strLookPer = UserAction.UserID;
            }

            if (hfdIsNew.Text == "" || hfdIsNew.Text == "Y")
            {
                cmdList.Add(new CommandInfo("INSERT INTO  SYS_MyMEMO (SEQNO,FLAG,ISPRIVATE,LRR,LRRQ,TITLE,MEMO,WARINGRQ,LOOKPER) VALUES(" + hfdSeqno.Text + ",'N','" + strIsPrivate + "','" + UserAction.UserID + "', to_date('" + DateTime.Now.ToString("yyyy-MM-dd") + "','yyyy-mm-dd'),'" + strTitle + "','" + strMemo + "',to_date('" + strWaringRQ + "','yyyy-mm-dd'),'" + strLookPer + "')", null));
                if (DbHelperOra.ExecuteSqlTran(cmdList))
                {
                    Alert.Show("数据保存成功!");
                    btnSave.Enabled = false;
                }
            }
            else
            {
                cmdList.Add(new CommandInfo("Update SYS_MYMEMO SET ISPRIVATE='" + strIsPrivate + "',TITLE='" + strTitle + "',MEMO='" + strMemo + "',WARINGRQ=to_date('" + strWaringRQ + "','yyyy-mm-dd'),LOOKPER='" + strLookPer + "' WHERE SEQNO=" + hfdSeqno.Text, null));
                if (DbHelperOra.ExecuteSqlTran(cmdList))
                {
                    Alert.Show("数据更新成功!");
                }
                else
                {
                    Alert.Show("该条数据不允许修改!");
                }
            }
            btnSearch();
            btnSave.EnablePostBack    = true;
            btnSave.Enabled           = true;
            btnSave.EnableAjax        = true;
            btnSave.EnableAjaxLoading = true;
            tbxTITLE.Text             = "";
            dptWARINGRQ.SelectedDate  = DateTime.Now.AddDays(1);
            hfdLOOKPER.Text           = "";;
            taxMEMO.Text          = "";
            hfdIsNew.Text         = "Y";
            GridPerson.DataSource = null;
            GridPerson.DataBind();
        }
Beispiel #7
0
        private void save(string flag = "N")
        {
            #region 数据有效性验证
            if (docFLAG.SelectedValue != "M")
            {
                Alert.Show("非新单不能保存!", "消息提示", MessageBoxIcon.Warning);
                return;
            }
            string strBillno = docSEQNO.Text;
            if (!Doc.getFlag(strBillno, "M", BillType))
            {
                Alert.Show("此单据已被其他人处理,请刷新页面更新单据状态!", "警告提示", MessageBoxIcon.Warning);
                return;
            }
            List <Dictionary <string, object> > newDict = GridGoods.GetNewAddedList().ToList();
            if (newDict.Count == 0)
            {
                Alert.Show("请输入商品信息", "消息提示", MessageBoxIcon.Warning);
                return;
            }
            List <Dictionary <string, object> > goodsData = new List <Dictionary <string, object> >();
            //判断是否有空行
            for (int i = 0; i < newDict.Count; i++)
            {
                if (!string.IsNullOrWhiteSpace(newDict[i]["GDSEQ"].ToString()))
                {
                    goodsData.Add(newDict[i]);
                }
            }

            if (goodsData.Count == 0)//所有Gird行都为空行时
            {
                Alert.Show("商品信息不能为空", "消息提示", MessageBoxIcon.Warning);
                return;
            }
            //验证单据信息
            if (DbHelperOra.Exists("SELECT 1 FROM dat_ck_doc where seqno = '" + docBILLNO.Text + "'") && docBILLNO.Enabled)
            {
                Alert.Show("您输入的单号已存在,请检查!");
                return;
            }
            #endregion

            if (PubFunc.StrIsEmpty(docBILLNO.Text))
            {
                docSEQNO.Text = BillSeqGet();
                //处理单号前缀
                docSEQNO.Text     = "DSC" + docSEQNO.Text.Substring(3, docSEQNO.Text.Length - 3);
                docBILLNO.Text    = docSEQNO.Text;
                docBILLNO.Enabled = false;
            }
            MyTable mtType = new MyTable("DAT_CK_DOC");
            mtType.ColRow          = PubFunc.FormDataHT(FormDoc);
            mtType.ColRow["SEQNO"] = docBILLNO.Text;
            mtType.ColRow.Add("BILLTYPE", "DSC");
            mtType.ColRow.Add("SUBNUM", goodsData.Count);
            mtType.ColRow.Add("XSTYPE", "1");
            mtType.ColRow.Remove("SHRQ");
            decimal            subNum   = 0;//总金额
            List <CommandInfo> cmdList  = new List <CommandInfo>();
            MyTable            mtTypeMx = new MyTable("DAT_CK_COM");
            //先删除单据信息在插入
            cmdList.Add(mtType.DeleteCommand(""));                                                        //删除单据台头
            cmdList.Add(new CommandInfo("delete dat_ck_com where seqno='" + docBILLNO.Text + "'", null)); //删除单据明细
            for (int i = 0; i < goodsData.Count; i++)
            {
                mtTypeMx.ColRow = PubFunc.GridDataGet(goodsData[i]);

                mtTypeMx.ColRow.Add("SEQNO", docBILLNO.Text);
                mtTypeMx.ColRow["ROWNO"] = i + 1;
                mtTypeMx.ColRow.Add("PHID", mtTypeMx.ColRow["PH"]);
                mtTypeMx.ColRow.Add("XSSL", mtTypeMx.ColRow["BZHL"]);
                mtTypeMx.ColRow.Add("BHSJJ", 0);
                mtTypeMx.ColRow.Add("BHSJE", 0);
                mtTypeMx.ColRow.Remove("UNITNAME");
                mtTypeMx.ColRow.Remove("PRODUCERNAME");
                subNum = subNum + decimal.Parse(mtTypeMx.ColRow["HSJE"].ToString());
                cmdList.Add(mtTypeMx.Insert());
            }
            mtType.ColRow.Add("SUBSUM", subNum);
            cmdList.AddRange(mtType.InsertCommand());
            DbHelperOra.ExecuteSqlTran(cmdList);
            if (flag == "N")
            {
                Alert.Show("定数出库信息保存成功!");
            }
            OperLog("定数出库", "修改单据【" + docBILLNO.Text + "】");
            billOpen(docBILLNO.Text);
            btnDel.Enabled = true;
            billLockDoc(true);
            SaveSuccess = true;
        }
Beispiel #8
0
        protected void btnSave_Click(object sender, EventArgs e)
        {
            //非换证直接保存的情况
            if (isChange.Text.Equals("N"))
            {
                string sqtype = "";
                if (chkisLR.Checked)
                {
                    sqtype = "厂家直接授权";
                }
                else
                {
                    sqtype = "代理商授权";
                }

                DateTime beginsqrq = Convert.ToDateTime(dpkBEGRQ.Text);
                DateTime endsqrq   = Convert.ToDateTime(dpkENDRQ.Text);

                List <CommandInfo> liscmd = new List <CommandInfo>();
                string             sb     = string.Empty;
                for (int i = 0; i < GridList.SelectedRowIndexArray.Length; i++)
                {
                    sb = sb + GridList.SelectedRowIndexArray[i].ToString() + ",";
                }
                sb = sb.Remove(sb.Length - 1, 1);

                if (!sb.Equals(hfdGoodsIndex.Text))
                {
                    for (int i = 0; i < GridList.SelectedRowIndexArray.Length; i++)
                    {
                        int    rowIndex = GridList.SelectedRowIndexArray[i];
                        string gdseq    = GridList.DataKeys[rowIndex][0].ToString();
                        string gdname   = GridList.DataKeys[rowIndex][1].ToString();
                        string gdspec   = GridList.DataKeys[rowIndex][2].ToString();
                        liscmd.Add(new CommandInfo(@"insert into doc_license_grantgoods(GRANTID,FLAG,GDSEQ,GDNAME,SPEC,SUPPLIER,UPTIME,SUPBETO,ISCUR)
                                    values('" + hfdGrantid.Text + "','N','" + gdseq + "','" + gdname + "','" + gdspec + "','" + trgPRODUCER.Text + "',sysdate,'" + hfdbesup.Text + "','Y')", null));
                    }
                    liscmd.Add(new CommandInfo("UPDATE DOC_LICENSE_GRANT SET FLAG='N',SQTYPE='" + sqtype + "',SUPAGENT='" + hfdagent.Text + "',SUPTOID='" + hfdbesup.Text + "',BEGINSQRQ=to_date('" + dpkBEGRQ.Text + "','yyyy/mm/dd'),ENDSQRQ=to_date('" + dpkENDRQ.Text + "','yyyy/mm/dd'),SQREGION='" + tbxSQREGION.Text + "',DOCID='" + tbxDOCID.Text + "',MEMO='" + tbxMEMO.Text + "',GOODSINDEX='" + sb.ToString() + "' where grantid='" + hfdGrantid.Text + "' and suptoid='" + hfdSuptoid.Text + "'", null));
                }
                else
                {
                    liscmd.Add(new CommandInfo("UPDATE DOC_LICENSE_GRANT SET FLAG='N',SQTYPE='" + sqtype + "',SUPAGENT='" + hfdagent.Text + "',SUPTOID='" + hfdbesup.Text + "',BEGINSQRQ=to_date('" + dpkBEGRQ.Text + "','yyyy/mm/dd'),ENDSQRQ=to_date('" + dpkENDRQ.Text + "','yyyy/mm/dd'),SQREGION='" + tbxSQREGION.Text + "',DOCID='" + tbxDOCID.Text + "',MEMO='" + tbxMEMO.Text + "' where grantid='" + hfdGrantid.Text + "' and suptoid='" + hfdSuptoid.Text + "'", null));
                }
                if (DbHelperOra.ExecuteSqlTran(liscmd))
                {
                    Alert.Show("保存成功!");
                    flagLbl1.Hidden = true;
                    flagLbl.Hidden  = false;
                    flagLbl.Text    = "当前状态:已保存";
                    PageContext.RegisterStartupScript(ActiveWindow.GetHideRefreshReference());
                }
                else
                {
                    Alert.Show("保存失败!");
                }
            }
            else //执行换证操作后保存
            {
                if (dpkBEGRQ.Text.Length <= 0)
                {
                    Alert.Show("请为 授权日期* 提供有效值!");
                    return;
                }
                if (dpkENDRQ.Text.Length <= 0)
                {
                    Alert.Show("请为 截止日期* 提供有效值!");
                    return;
                }
                DateTime dtBEGRQ = Convert.ToDateTime(dpkBEGRQ.Text);
                DateTime dtENDRQ = Convert.ToDateTime(dpkENDRQ.Text);
                if (dtBEGRQ > dtENDRQ)
                {
                    Alert.Show("授权日期不能大于截止日期!");
                    return;
                }
                if (GridList.SelectedRowIndexArray.Length <= 0)
                {
                    Alert.Show("必须选择授权的商品!");
                    return;
                }

                PageContext.RegisterStartupScript("save();");
            }
        }
Beispiel #9
0
        protected void PageManager1_CustomEvent(object sender, CustomEventArgs e)
        {
            string picurl = @"";

            if (e.EventArgument.IndexOf("mysave") >= 0)
            {
                //获取上传的授权书图片并和授权书相关数据一起保存
                JArray jaResult = JsonConvert.DeserializeObject <JArray>(hfdURL.Text);
                foreach (JToken jt in jaResult)
                {
                    picurl += jt["_raw"].ToString() + ",";
                }
                if (picurl.Length <= 0)
                {
                    Alert.Show("请传入授权书证照图片!");
                    return;
                }
                picurl = picurl.Substring(0, picurl.Length - 1);
                string[] arrays = picurl.Split(',');

                StringBuilder sb = new StringBuilder();
                for (int i = 0; i < GridList.SelectedRowIndexArray.Length; i++)
                {
                    sb.Append(GridList.SelectedRowIndexArray[i].ToString() + ",");
                }
                sb = sb.Remove(sb.Length - 1, 1);
                string seqnostr = hfdGrantid.Text;

                List <CommandInfo> liscmd = new List <CommandInfo>();
                string             sqtype = "";
                if (chkisLR.Checked)
                {
                    sqtype = "厂家直接授权";
                }
                else
                {
                    sqtype = "代理商授权";
                }

                DataTable dtt      = DbHelperOra.Query(@"SELECT PRODUCER,F_GETSUPNAME(PRODUCER)PRODUCERNAME,SUPID,F_GETSUPNAME(SUPID)SUPNAME,SUPTOID,F_GETSUPNAME(SUPTOID)SUPTONAME,FLAG,SQREGION,BEGINSQRQ,ENDSQRQ,
                                                DECODE(FLAG,'N','已保存','S','已提交','Y','已审批','R','已驳回') FLAGNAME,DOCID,SUPAGENT,GOODSINDEX,F_GETSUPNAME(SUPAGENT)SUPAGENTNAME,MEMO,SQTYPE FROM DOC_LICENSE_GRANT T WHERE GRANTID='" + hfdGrantid.Text + "' AND SUPTOID='" + hfdbesup.Text + "'").Tables[0];
                string    supid    = dtt.Rows[0]["SUPID"].ToString();    //授权方
                string    producer = dtt.Rows[0]["PRODUCER"].ToString(); //生产厂商
                string    suptoid  = dtt.Rows[0]["SUPTOID"].ToString();  //被授权方
                string    flag     = dtt.Rows[0]["FLAG"].ToString();     //状态
                if (flag.Equals("N") || flag.Equals("R"))
                {
                    //如果证照是保存或撤回状态,直接删除掉已保存证照,再换上新证照
                    List <CommandInfo> delCmd = new List <CommandInfo>();
                    delCmd.Add(new CommandInfo("delete from doc_license_grant where grantid='" + hfdGrantid.Text + "' and suptoid='" + hfdbesup.Text + "' and iscur='Y'", null));
                    delCmd.Add(new CommandInfo("delete from doc_license_grantgoods where grantid='" + hfdGrantid.Text + "' and iscur='Y'", null));
                    delCmd.Add(new CommandInfo("delete from doc_license_sqimg where seqno='" + hfdGrantid.Text + "' and str2='" + hfdbesup.Text + "' and iscur='Y'", null));
                    DbHelperOra.ExecuteSqlTran(delCmd);
                }
                else
                {
                    //如果证照状态不是N或R的话,直接将现有证照变成老证照,ISCUR='N'(将状态直接变成N)
                    List <CommandInfo> liscommand = new List <CommandInfo>();
                    liscommand.Add(new CommandInfo("update doc_license_grant set iscur='N' where grantid='" + hfdGrantid.Text + "' and suptoid='" + hfdbesup.Text + "' and iscur='Y'", null));
                    liscommand.Add(new CommandInfo("update doc_license_grantgoods set iscur='N' where grantid='" + hfdGrantid.Text + "' and supbeto='" + hfdbesup.Text + "' and iscur='Y'", null));
                    liscommand.Add(new CommandInfo("update doc_license_sqimg SET ISCUR='N' where seqno='" + hfdGrantid.Text + "' and str2='" + hfdbesup.Text + "' and iscur='Y'", null));
                    DbHelperOra.ExecuteSqlTran(liscommand);
                }

                //换证之后,更新新录入的证照流水,其他老流水保持不变。插入本次换证的新证照
                string seqnostrnew = DbHelperOra.GetSingle("SELECT SEQ_LICENSE_PIC.NEXTVAL FROM DUAL").ToString();
                string myseq       = "LIS" + producer + seqnostrnew;

                for (int i = 0; i < GridList.SelectedRowIndexArray.Length; i++)
                {
                    int    rowIndex = GridList.SelectedRowIndexArray[i];
                    string gdseq    = GridList.DataKeys[rowIndex][0].ToString();
                    string gdname   = GridList.DataKeys[rowIndex][1].ToString();
                    string gdspec   = GridList.DataKeys[rowIndex][2].ToString();
                    liscmd.Add(new CommandInfo(@"insert into doc_license_grantgoods(GRANTID,FLAG,GDSEQ,GDNAME,SPEC,SUPPLIER,UPTIME,SUPBETO,ISCUR)
                                    values('" + myseq + "','N','" + gdseq + "','" + gdname + "','" + gdspec + "','" + producer + "',sysdate,'" + hfdbesup.Text + "','Y')", null));
                }

                if (sqtype.Equals("厂家直接授权"))
                {
                    //如果是厂家直接授权,则生产商和授权方都是生产商
                    liscmd.Add(new CommandInfo(@"insert into doc_license_grant(GRANTID,PRODUCER,SUPID,SUPTOID,SUPAGENT,FLAG,SQREGION,BEGINSQRQ,ENDSQRQ,OPERTIME,LRY,MEMO,GOODSINDEX,DOCID,SQTYPE,ISCUR,ISCHANGE)
                                    values('" + myseq + "','" + producer + "','" + supid + "','" + hfdbesup.Text + "','" + hfdagent.Text + "','N','" + tbxSQREGION.Text + "',to_date('" + dpkBEGRQ.Text + "','yyyy/mm/dd'),to_date('" + dpkENDRQ.Text + "','yyyy/mm/dd'),SYSDATE,'" + UserAction.UserID + "','" + tbxMEMO.Text + "','" + sb.ToString() + "','" + tbxDOCID.Text + "','" + sqtype + "','Y','Y')", null));
                }
                else
                {
                    //如果是代理商授权,则授权方是代理商
                    liscmd.Add(new CommandInfo(@"insert into doc_license_grant(GRANTID,PRODUCER,SUPID,SUPTOID,SUPAGENT,FLAG,SQREGION,BEGINSQRQ,ENDSQRQ,OPERTIME,LRY,MEMO,GOODSINDEX,DOCID,SQTYPE,ISCUR,ISCHANGE)
                                    values('" + myseq + "','" + producer + "','" + hfdagent.Text + "','" + hfdbesup.Text + "','" + hfdagent.Text + "','N','" + tbxSQREGION.Text + "',to_date('" + dpkBEGRQ.Text + "','yyyy/mm/dd'),to_date('" + dpkENDRQ.Text + "','yyyy/mm/dd'),SYSDATE,'" + UserAction.UserID + "','" + tbxMEMO.Text + "','" + sb.ToString() + "','" + tbxDOCID.Text + "','" + sqtype + "','Y','Y')", null));
                }

                //授权链中有一个换证,那么将整个层级授权的流水更改成换证后的新流水,并且将层级中其他证照一并更换流水及授权商品、状态
                liscmd.Add(new CommandInfo("update doc_license_grant set grantid='" + myseq + "',flag='N',goodsindex='" + sb.ToString() + "' where grantid='" + hfdGrantid.Text + "' and iscur='Y'", null));
                liscmd.Add(new CommandInfo("update doc_license_grantgoods set grantid='" + myseq + "',flag='N' where grantid='" + hfdGrantid.Text + "' and iscur='Y'", null));
                liscmd.Add(new CommandInfo("update doc_license_sqimg set seqno='" + myseq + "' where seqno='" + hfdGrantid.Text + "' and iscur='Y'", null));

                //换证更新首级代理商
                DataTable chkddt = DbHelperOra.Query("select supid,suptoid from doc_license_grantdoc where grantid='" + hfdGrantid.Text + "'").Tables[0];
                if (chkddt.Rows[0][0].ToString().Equals(hfdbesup.Text) && chkddt.Rows[0][1].ToString().Equals(hfdsupid.Text))
                {
                    liscmd.Add(new CommandInfo("update doc_license_grantdoc set sqregion='" + tbxSQREGION.Text + "',beginsqrq=to_date('" + dpkBEGRQ.Text + "','yyyy/mm/dd'),endsqrq=to_date('" + dpkENDRQ.Text + "','yyyy/mm/dd'),grantid='" + myseq + "',flag='N',ischange='Y',goodsindex='" + sb.ToString() + "' where grantid='" + hfdGrantid.Text + "' and iscur='Y'", null));
                }
                else
                {
                    liscmd.Add(new CommandInfo("update doc_license_grantdoc set grantid='" + myseq + "',flag='N',ischange='Y' where grantid='" + hfdGrantid.Text + "' and iscur='Y'", null));
                }

                for (int i = 1; i < arrays.Length + 1; i++)
                {
                    liscmd.Add(new CommandInfo(@"insert into DOC_LICENSE_SQIMG(SEQNO,ROWNO,IMGPATH,UPTTIME,LICENSEID,ISCUR,STR1,STR2)values('" + myseq + "','" + i + "','" + arrays[i - 1] + "',sysdate,'" + "SQ" + "','Y','" + producer + "','" + hfdbesup.Text + "')", null));
                }

                if (DbHelperOra.ExecuteSqlTran(liscmd))
                {
                    Alert.Show("证照上传成功!");
                    flagLbl.Text = "当前状态:已保存";
                    //DataSearch();
                    PageContext.RegisterStartupScript(ActiveWindow.GetHideRefreshReference());
                }
                else
                {
                    Alert.Show("证照上传失败!");
                }
            }
        }
Beispiel #10
0
        public Boolean UploadFile(HttpContext context, string licenseid)
        {
            message = "";
            int    rowno = 1;//存放图片的行数
            string pic_path = "", seqn = "";

            result = false;
            context.Response.CacheControl = "no-cache";
            string s_rpath = FileHelper.GetUploadPath();//@"E:\My Documents\Visual Studio 2008\WebSites\SWFUpload\demos\applicationdemo.net";

            List <CommandInfo> cmdList = new List <CommandInfo>();

            string Datedir = DateTime.Now.ToString("yy-MM-dd");
            string updir   = s_rpath + "\\" + Datedir;

            FileHelper.CreateDir(updir);
            string extname  = string.Empty;
            string fullname = string.Empty;
            string filename = string.Empty;

            if (context.Request.Files.Count > 0)
            {
                try
                {
                    for (int j = 0; j < context.Request.Files.Count; j++)
                    {
                        HttpPostedFile uploadFile = context.Request.Files[j];
                        int            offset     = Convert.ToInt32(context.Request["chunk"]);  //当前分块
                        int            total      = Convert.ToInt32(context.Request["chunks"]); //总的分块数量
                        string         name       = context.Request["name"];
                        //文件没有分块
                        if (total == 1)
                        {
                            if (uploadFile.ContentLength > 0)
                            {
                                if (!System.IO.Directory.Exists(updir))
                                {
                                    System.IO.Directory.CreateDirectory(updir);
                                }
                                extname  = System.IO.Path.GetExtension(uploadFile.FileName);
                                fullname = DateTime.Now.Year.ToString() + DateTime.Now.Month.ToString() + DateTime.Now.Day.ToString() + DateTime.Now.Hour.ToString() + DateTime.Now.Minute.ToString() + DateTime.Now.Second.ToString();
                                filename = uploadFile.FileName;

                                uploadFile.SaveAs(string.Format("{0}\\{1}", updir, filename));
                                result = true;
                            }
                        }
                        else
                        {
                            //文件 分成多块上传
                            fullname = WriteTempFile(uploadFile, offset);
                            if (total - offset == 1 || total == 0)
                            {
                                //如果是最后一个分块文件 ,则把文件从临时文件夹中移到上传文件夹中
                                System.IO.FileInfo fi          = new System.IO.FileInfo(fullname);
                                string             oldFullName = string.Format("{0}\\{1}", updir, uploadFile.FileName);
                                string             mypath      = "";
                                System.IO.FileInfo oldFi       = new System.IO.FileInfo(oldFullName);
                                if (oldFi.Exists)
                                {
                                    //文件名存在则删除旧文件
                                    oldFi.Delete();
                                }
                                string pathMain = ApiUtil.GetConfigCont("UPLOADDIR");
                                //fi.MoveTo(oldFullName);
                                string spath = "SupCert\\" + Datedir + "\\";
                                //string spath = oldFullName.Substring(10);
                                DataTable dt = DbHelperOra.Query("select max(rowno) from DOC_GOODSPICTURE where gdseq='" + licenseid + "' nvl(str2,'N') = 'N'").Tables[0];
                                if (dt != null && dt.Rows.Count != 0)
                                {
                                    string oldnum = dt.Rows[0][0].ToString();
                                    if (!String.IsNullOrWhiteSpace(oldnum))
                                    {
                                        rowno    = Convert.ToInt32(oldnum) + 1;
                                        mypath   = "~/" + ("ERPUpload\\" + spath).Replace("\\", "/");
                                        pic_path = mypath;    //pathMain + "SupCert\\" + Datedir + "\\";//mypath.Substring(0, oldFullName.LastIndexOf("\\") + 1);
                                        seqn     = licenseid + "_" + rowno;
                                        pic_path = pic_path + seqn + ".jpg";
                                    }
                                    else
                                    {
                                        mypath   = "~/" + ("ERPUpload\\" + spath).Replace("\\", "/");
                                        pic_path = mypath;    //.Substring(0, oldFullName.LastIndexOf("\\") + 1);
                                        seqn     = licenseid + "_" + rowno;
                                        pic_path = pic_path + seqn + ".jpg";
                                    }
                                }
                                string             thePicPath = pathMain + spath + seqn + ".jpg";
                                System.IO.FileInfo oldFi1     = new System.IO.FileInfo(thePicPath);
                                if (oldFi1.Exists)
                                {
                                    //文件名存在则删除旧文件
                                    oldFi1.Delete();
                                }
                                fi.MoveTo(thePicPath);
                                //E:\UPLOAD\SupCert\15-04-17\1-120Q0092042.jpg   --->oldFullName
                                //E:\\UPLOAD\\SupCert\15-05-03\授权设计.xlsx
                                cmdList.Add(new CommandInfo(string.Format("update doc_goods set ISFLAG4 = 'Y' where gdseq='{0}'", licenseid), null));
                                cmdList.Add(new CommandInfo("insert into DOC_GOODSPICTURE(GDSEQ,ROWNO,GDPICT,PICPATH,FLAG,STR1) values('" + licenseid + "','" + rowno + "','" + seqn + "','" + pic_path + "','N','" + seqn + "')", null));
                                result = true;
                                DbHelperOra.ExecuteSqlTran(cmdList);
                            }
                        }
                    }
                }
                catch (Exception ex)
                {
                    message = ex.ToString();
                    //context.Response.Write("Message" + ex.ToString());
                }
            }
            return(result);
        }
        protected override void billSave()
        {
            #region 数据有效性验证
            if (ddlFLAG.SelectedValue != "N")
            {
                Alert.Show("非新单不能保存!", "消息提示", MessageBoxIcon.Warning);
                return;
            }
            if (ddlKCTYPE.SelectedValue.Length < 1)
            {
                Alert.Show("请选择【损益类别】");
                return;
            }
            if (PubFunc.FormDataCheck(FormDoc).Length > 0)
            {
                return;
            }

            List <Dictionary <string, object> > newDict = GridGoods.GetNewAddedList().OrderBy(x => x["GDSEQ"]).ToList();
            if (newDict.Count == 0)
            {
                Alert.Show("请输入商品信息", "消息提示", MessageBoxIcon.Warning);
                return;
            }
            List <Dictionary <string, object> > goodsData = new List <Dictionary <string, object> >();
            //判断是否有空行、批号填写是否符合要求
            for (int i = 0; i < newDict.Count; i++)
            {
                if (!string.IsNullOrWhiteSpace(newDict[i]["GDSEQ"].ToString()) && !string.IsNullOrWhiteSpace(newDict[i]["GDNAME"].ToString()))
                {
                    goodsData.Add(newDict[i]);
                }
                if (string.IsNullOrWhiteSpace(newDict[i]["BZHL"].ToString()) || string.IsNullOrWhiteSpace(newDict[i]["UNIT"].ToString()))
                {
                    Alert.Show("商品包装单位信息错误,请联系管理员进行维护!", "消息提示", MessageBoxIcon.Warning);
                    return;
                }
                if (string.IsNullOrWhiteSpace(newDict[i]["SYSL"].ToString()))
                {
                    Alert.Show("请填写正确的损益数量", "消息提示", MessageBoxIcon.Warning);
                    return;
                }
            }
            if (goodsData.Count == 0)//所有Gird行都为空行时
            {
                Alert.Show("商品信息不能为空", "消息提示", MessageBoxIcon.Warning);
                return;
            }
            #endregion

            if (PubFunc.StrIsEmpty(tbxBILLNO.Text))
            {
                tbxBILLNO.Text    = BillSeqGet();
                tbxBILLNO.Enabled = false;
            }
            MyTable mtType = new MyTable("DAT_SY_DOC");
            mtType.ColRow          = PubFunc.FormDataHT(FormDoc);
            mtType.ColRow["SEQNO"] = tbxBILLNO.Text;
            mtType.ColRow.Add("BILLTYPE", BillType);
            mtType.ColRow.Add("SUBNUM", goodsData.Count);
            //如果是代管商品,把发送标志设为G-即不发送
            if (isDg())
            {
                mtType.ColRow.Add("ISSEND", "G");
            }

            List <CommandInfo> cmdList  = new List <CommandInfo>();
            MyTable            mtTypeMx = new MyTable("DAT_SY_COM");
            decimal            subNum   = 0;                                                              //总金额
            //先删除单据信息在插入
            cmdList.Add(mtType.DeleteCommand(""));                                                        //删除单据台头
            cmdList.Add(new CommandInfo("delete DAT_SY_COM where seqno='" + tbxBILLNO.Text + "'", null)); //删除单据明细
            for (int i = 0; i < goodsData.Count; i++)
            {
                mtTypeMx.ColRow = PubFunc.GridDataGet(goodsData[i]);

                //判断含税进价,为0时不能保存
                string isJiFei = string.Format("select 1 from DOC_GOODS t where iscf = 'N' and gdseq = '{0}'", mtTypeMx.ColRow["GDSEQ"].ToString());
                if (DbHelperOra.Exists(isJiFei))
                {
                    if (PubFunc.StrIsEmpty(mtTypeMx.ColRow["HSJJ"].ToString()) || mtTypeMx.ColRow["HSJJ"].ToString() == "0")
                    {
                        Alert.Show("商品【含税进价】为0或空,无法进行【商品损益管理】操作。");
                        return;
                    }
                }

                //重新计算金额
                mtTypeMx.ColRow["HSJE"]  = Convert.ToDecimal(mtTypeMx.ColRow["SYSL"]) * Convert.ToDecimal(mtTypeMx.ColRow["HSJJ"]);
                mtTypeMx.ColRow["BHSJE"] = Convert.ToDecimal(mtTypeMx.ColRow["SYSL"]) * Convert.ToDecimal(mtTypeMx.ColRow["BHSJJ"]);
                mtTypeMx.ColRow["LSJE"]  = Convert.ToDecimal(mtTypeMx.ColRow["SYSL"]) * Convert.ToDecimal(mtTypeMx.ColRow["LSJ"]);
                subNum = subNum + decimal.Parse(mtTypeMx.ColRow["HSJE"].ToString());
                mtTypeMx.ColRow.Add("SEQNO", tbxBILLNO.Text);
                mtTypeMx.ColRow["BZSL"]  = mtTypeMx.ColRow["SYSL"];
                mtTypeMx.ColRow["ROWNO"] = i + 1;
                mtTypeMx.ColRow.Add("PHID", mtTypeMx.ColRow["PH"]);
                mtTypeMx.ColRow.Remove("UNITNAME");
                cmdList.Add(mtTypeMx.Insert());
            }
            mtType.ColRow["SUBSUM"] = subNum;
            //mtType.ColRow.Add("SUBSUM", subNum);
            cmdList.AddRange(mtType.InsertCommand());


            DbHelperOra.ExecuteSqlTran(cmdList);
            Alert.Show("损益单信息保存成功!");
            //billNew();
            OperLog("商品损益", "修改单据【" + tbxBILLNO.Text + "】");
            billOpen(tbxBILLNO.Text);
            billLockDoc(true);
        }
Beispiel #12
0
        /// <summary>
        /// 创建门诊预存订单
        /// </summary>
        /// <param name="openid">用户标识</param>
        /// <param name="patientname">病人姓名</param>
        /// <param name="patientidcardno">病人身份证号</param>
        /// <param name="cardno">就诊卡卡号</param>
        /// <param name="subject">标题</param>
        /// <param name="money">金额</param>
        /// <param name="tradeno">订单号</param>
        /// <param name="msg">出错信息</param>
        /// <returns>0:成功  大于0:出错  小于0:异常</returns>
        public int DB_CreateOrder(string openid, string patientname, string patientidcardno, string cardno, string patientid, string subject,
                                  double money, double tkje, string patienttype, out long tradeno, out string msg)
        {
            msg     = "";
            tradeno = -1;
            int ret = 99;

            if (patienttype == "1")
            {
                if (!IsValidCardno(patientid, cardno, out msg))
                {
                    return(ret);
                }
            }

            if (!IsSupportPayment(patienttype))
            {
                msg = "医院暂时不支持该功能的使用";
                ret = 18;
                return(ret);
            }

            if (!IsAmountAbnormal(patienttype, money))
            {
                msg = "充值金额异常或超过限定额度";
                return(19);
            }

            //产生日期
            DateTime _cssj;

            if (DB_Sysdate(out _cssj) == false)
            {
                msg = "读取服务器系统时间出错";
                return(20);
            }


            //产生医院订单流水号
            tradeno = YylshSeq();
            if (tradeno <= 0)
            {
                msg = "订单流水号产生失败";
                return(21);
            }


            string logMsg = " yylsh : " + tradeno + " czje : " + money + " tkje : " + tkje + " ddzt : " + 0 + " jyfs : " + 10 +
                            " bkhm : " + cardno + " brid : " + patientid + " cssj : " + _cssj.ToString("yyyy-MM-dd HH:mm:ss") +
                            " czsj : " + _cssj.ToString("yyyy-MM-dd HH:mm:ss") + " brlx : " + patienttype + " 。";

            UtilLog.GetInstance().WriteOrderLog("创建订单成功: ", logMsg);

            OracleConnection connection = new OracleConnection(WebConfigParameter.ConnectionHisString);

            try
            {
                string insertSql = _builder.CreateOrderforAlipaySql(tradeno, money, tkje, patienttype, cardno, patientid,
                                                                    _cssj, patientidcardno, "", patientname, subject, openid);

                ArrayList listSql = new ArrayList();
                listSql.Add(insertSql);
                DbHelperOra.ExecuteSqlTran(listSql, connection);

                msg = "订单已经成功创建";
                ret = 00;
            }
            catch (Exception ex)
            {
                UtilLog.GetInstance().WriteProgramLog(System.Reflection.MethodBase.GetCurrentMethod().Name, ex);

                msg = GetExceptionInfo(ex);

                logMsg += " , 异常信息: " + msg + " 。";
                UtilLog.GetInstance().WriteOrderLog("创建订单失败: ", logMsg);

                return(-1);
            }
            finally
            {
                connection.Close();
            }

            return(ret);
        }
Beispiel #13
0
        protected void Bill_create_Click(object sender, EventArgs e)
        {
            //将选中行生成一张结算单
            int[] selections = GridGoods.SelectedRowIndexArray;
            if (selections.Count() < 1)
            {
                return;
            }
            string             deptid_old = "";
            string             deptid     = "";
            string             str_bill   = "";
            decimal            Hjje       = 0;
            List <CommandInfo> cmdList    = new List <CommandInfo>();

            foreach (int rowIndex in selections)
            {
                if (deptid_old == "")
                {
                    deptid_old = GridGoods.DataKeys[rowIndex][1].ToString();
                }
                deptid = GridGoods.DataKeys[rowIndex][1].ToString();
                if (deptid != deptid_old)
                {
                    Alert.Show("第【" + (rowIndex + 1).ToString() + "】行,单据【" + GridGoods.DataKeys[rowIndex][0].ToString() + "】结算科室与其他单据结算科室不一致,请检查!");
                    return;
                }
                str_bill += "'" + GridGoods.DataKeys[rowIndex][0].ToString() + "'" + ",";
                Hjje     += decimal.Parse(GridGoods.DataKeys[rowIndex][2].ToString());
            }
            docSEQNO.Text = BillSeqGet();
            string SqlInsJsd = @"INSERT INTO DAT_JSD_DOC(CUSTID,SEQNO,DEPTID,FLAG,SUPID,SUPNAME,GATFUNDCORP,GATFUNDBANK,GATACCNTNO,LINKMAN,LINKTEL,CWLINKMAN,CWLINKTEL,BEGRQ,ENDRQ,SYJE,XSJE,THJE,YJJJ,LRY,LRRQ,UPTTIME,MEMO)
            select (select VALUE from sys_para WHERE CODE = 'USERCODE'),'{0}','{1}','N','{2}',supname,SUPNAME,GATFUNDBANK,GATACCNTNO,LINKMAN,LINKTEL,CWLINKMAN,CWLINKTEL,SYSDATE,SYSDATE,0,{3},0,{3},'{4}',sysdate,sysdate,'{5}'
            from doc_supplier where supid = '{2}'";
            string beizhu    = "";

            if (PubFunc.StrIsEmpty(tbxMEMO.Text))
            {
                if (ddlNUM2.SelectedValue == "G")
                {
                    beizhu = "高值结算单";
                }
                else
                {
                    beizhu = "普通结算单";
                }
            }
            cmdList.Add(new CommandInfo(string.Format(SqlInsJsd, docSEQNO.Text, deptid_old, ddlSUPID.SelectedValue, Hjje, UserAction.UserID, beizhu), null));
            string SqlInsBill = @"INSERT INTO DAT_JSD_BILL(CUSTID,SEQNO,BILLNO,BILLTYPE,FLAG,DEPTOUT,DEPTID,XSTYPE,XSRQ,LRY,LRRQ,SHR,SHRQ,SUBNUM,PRICE_HSJE,PRICE_RTN,PRICE,MEMO)
              SELECT (select VALUE from sys_para WHERE CODE = 'USERCODE'),'{1}',SEQNO,BILLTYPE,FLAG,DEPTOUT,DEPTID,XSTYPE,XSRQ,LRY,LRRQ,SHR,SHRQ,SUBNUM,DECODE(XSTYPE,'1',SUBSUM,0),DECODE(XSTYPE,'1',0,SUBSUM),SUBSUM,'高值结算单'
              FROM DAT_XS_DOC WHERE DEPTID = '{0}' AND SEQNO IN ({2})";

            cmdList.Add(new CommandInfo(string.Format(SqlInsBill, deptid_old, docSEQNO.Text, str_bill.TrimEnd(',')), null));
            cmdList.Add(new CommandInfo("UPDATE DAT_XS_DOC SET FLAG = 'D' WHERE SEQNO IN (" + str_bill.TrimEnd(',') + ")", null));
            cmdList.Add(new CommandInfo("UPDATE DAT_GOODSJXC SET STR1='" + docSEQNO.Text + "' WHERE BILLNO IN (" + str_bill.TrimEnd(',') + ") AND NVL(STR1,'#') = '#'", null));
            cmdList.Add(new CommandInfo("UPDATE DAT_XS_DOC A SET FLAG = 'G' , STR3='" + docSEQNO.Text + "' WHERE NOT EXISTS (SELECT 1 FROM DAT_GOODSJXC B WHERE B.BILLNO = A.SEQNO AND NVL(STR1,'#') = '#') AND SEQNO IN (" + str_bill.TrimEnd(',') + ")", null));
            if (DbHelperOra.ExecuteSqlTran(cmdList))
            {
                Alert.Show("结算单据【" + docSEQNO.Text + "】生成成功!");
                billOpen(docSEQNO.Text, deptid_old);
            }
            else
            {
                Alert.Show("因系统调度原因审核失败,请联系管理员!");
            }
        }
Beispiel #14
0
        private void save(string flag = "N")
        {
            #region 数据有效性验证
            if (docFLAG.SelectedValue != "N")
            {
                Alert.Show("非新单不能保存!", "消息提示", MessageBoxIcon.Warning);
                return;
            }
            List <Dictionary <string, object> > newDict = GridGoods.GetNewAddedList().ToList();
            if (newDict.Count == 0)
            {
                Alert.Show("请输入商品信息", "消息提示", MessageBoxIcon.Warning);
                return;
            }
            if (PubFunc.FormDataCheck(FormDoc).Length > 0)
            {
                return;
            }
            decimal subsum = 0;
            List <Dictionary <string, object> > goodsData = new List <Dictionary <string, object> >();
            //判断是否有空行、批号填写是否符合要求
            for (int i = 0; i < newDict.Count; i++)
            {
                if (!string.IsNullOrWhiteSpace(newDict[i]["GDSEQ"].ToString()) && !string.IsNullOrWhiteSpace(newDict[i]["GDNAME"].ToString()))
                {
                    //if (newDict[i]["ISLOT"].ToString() == "1" || newDict[i]["ISLOT"].ToString() == "2")
                    //{
                    //    if (string.IsNullOrWhiteSpace(newDict[i]["PH"].ToString()) || newDict[i]["PH"].ToString() == "\\")
                    //    {
                    //        //GridGoods.SelectedCell = new int[] { i, 8 };
                    //        string[] selectedCell = GridGoods.SelectedCell;
                    //        PageContext.RegisterStartupScript(String.Format("F('{0}').selectCell('{1}','{2}');", GridGoods.ClientID, selectedCell[0], "KCSL"));
                    //        Alert.Show("商品【" + newDict[i]["GDNAME"].ToString() + "】批号不能为空!!!", "消息提示", MessageBoxIcon.Warning);
                    //        return;
                    //    }
                    //}

                    //if (newDict[i].ContainsKey("STR1")&&goodsData.Count > 0 && goodsData.Where(x => x["STR1"].ToString() == newDict[i]["STR1"].ToString()).Count() > 0)
                    //{
                    //    Alert.Show("条码[" + newDict[i]["STR1"] + "]扫描重复!", "消息提示", MessageBoxIcon.Warning);
                    //    return;

                    if (!string.IsNullOrWhiteSpace(newDict[i]["STR1"].ToString()))
                    {
                        for (int k = 1 + i; k < newDict.Count; k++)
                        {
                            if ((newDict[i]["STR1"].ToString()) == (newDict[k]["STR1"].ToString()))
                            {
                                Alert.Show("商品『" + newDict[k]["GDNAME"].ToString() + "』条码『" + newDict[k]["STR1"].ToString() + "』重复,请维护!", "消息提示", MessageBoxIcon.Warning);
                                return;
                            }
                        }
                    }
                    if (newDict[i]["BZSL"].ToString() == "0" || string.IsNullOrWhiteSpace(newDict[i]["BZSL"].ToString()))
                    {
                        Alert.Show("商品【" + newDict[i]["GDNAME"].ToString() + "】使用数填写不正确!", "消息提示", MessageBoxIcon.Warning);
                        return;
                    }
                    if (decimal.Parse(newDict[i]["KCSL"].ToString()) < decimal.Parse(newDict[i]["BZSL"].ToString()))
                    {
                        Alert.Show("商品【" + newDict[i]["GDNAME"].ToString() + "】使用数大于库存数,请重新输入!", "消息提示", MessageBoxIcon.Warning);
                        return;
                    }
                    //当商品中含有贵重商品信息,即需要赋唯一码时
                    if (newDict[i]["ISGZ"].ToString() == "Y" && newDict[i]["ONECODE"].ToString() == "")
                    {
                        Alert.Show("商品【" + newDict[i]["GDNAME"].ToString() + "】为贵重商品,请先进行扫描赋码!", "消息提示", MessageBoxIcon.Warning);
                        return;
                    }
                    goodsData.Add(newDict[i]);
                    subsum += Convert.ToDecimal(newDict[i]["HSJJ"].ToString()) * Convert.ToDecimal(newDict[i]["BZHL"].ToString());
                }
            }

            if (goodsData.Count == 0)//所有Gird行都为空行时
            {
                Alert.Show("商品信息不能为空", "消息提示", MessageBoxIcon.Warning);
                return;
            }
            //验证单据信息
            if (DbHelperOra.Exists("SELECT 1 FROM DAT_XS_DOC where seqno = '" + docBILLNO.Text + "'") && docBILLNO.Enabled)
            {
                Alert.Show("您输入的单号已存在,请检查!");
                return;
            }
            #endregion

            if (PubFunc.StrIsEmpty(docBILLNO.Text))
            {
                docSEQNO.Text     = BillSeqGet();
                docBILLNO.Text    = docSEQNO.Text;
                docBILLNO.Enabled = false;
            }
            else
            {
                string flg = (string)DbHelperOra.GetSingle(string.Format("SELECT NVL(FLAG,'N') FROM DAT_XS_DOC WHERE SEQNO='{0}'", docBILLNO.Text));
                if (!string.IsNullOrWhiteSpace(flg) && (",N,R").IndexOf(flg) < 0)
                {
                    Alert.Show("您输入的单据号存在重复信息,请重新输入或置空!", "消息提示", MessageBoxIcon.Warning);
                    return;
                }
                else
                {
                    docSEQNO.Text     = docBILLNO.Text;
                    docBILLNO.Enabled = false;
                }
            }

            MyTable mtType = new MyTable("DAT_XS_DOC");
            mtType.ColRow          = PubFunc.FormDataHT(FormDoc);
            mtType.ColRow["SEQNO"] = docBILLNO.Text;
            mtType.ColRow.Add("BILLTYPE", BillType);
            mtType.ColRow.Add("SUBNUM", goodsData.Count);
            mtType.ColRow.Add("XSTYPE", "1");

            List <CommandInfo> cmdList  = new List <CommandInfo>();
            MyTable            mtTypeMx = new MyTable("DAT_XS_COM");
            //先删除单据信息在插入
            cmdList.Add(new CommandInfo("delete DAT_XS_DOC where seqno='" + docBILLNO.Text + "'", null)); //删除单据台头
            cmdList.Add(new CommandInfo("delete DAT_XS_COM where seqno='" + docBILLNO.Text + "'", null)); //删除单据明细
            decimal subNum = 0;
            for (int i = 0; i < goodsData.Count; i++)
            {
                mtTypeMx.ColRow = PubFunc.GridDataGet(goodsData[i]);
                if (PubFunc.StrIsEmpty(mtTypeMx.ColRow["BZSL"].ToString()) || mtTypeMx.ColRow["BZSL"].ToString() == "0")
                {
                    Alert.Show("商品【" + mtTypeMx.ColRow["GDSEQ"] + " | " + mtTypeMx.ColRow["GDNAME"] + "】【使用数】为0或空,无法进行【使用信息管理】操作。");
                    return;
                }
                mtTypeMx.ColRow.Add("SEQNO", docBILLNO.Text);
                mtTypeMx.ColRow["ROWNO"] = i + 1;
                mtTypeMx.ColRow.Add("PHID", mtTypeMx.ColRow["PH"]);
                mtTypeMx.ColRow["DHSL"] = decimal.Parse(mtTypeMx.ColRow["BZHL"].ToString()) * decimal.Parse(mtTypeMx.ColRow["BZSL"].ToString());
                mtTypeMx.ColRow["HSJE"] = decimal.Parse(mtTypeMx.ColRow["HSJJ"].ToString()) * decimal.Parse(mtTypeMx.ColRow["BZSL"].ToString()) * decimal.Parse(mtTypeMx.ColRow["BZHL"].ToString());
                //mtTypeMx.ColRow["XSSL"] = goodsData[i]["DHSL"].ToString();
                mtTypeMx.ColRow["XSSL"] = mtTypeMx.ColRow["DHSL"];
                mtTypeMx.ColRow.Add("BHSJJ", 0);
                mtTypeMx.ColRow.Add("BHSJE", 0);
                mtTypeMx.ColRow.Remove("UNITNAME");
                mtTypeMx.ColRow.Remove("PRODUCERNAME");
                subNum = subNum + decimal.Parse(mtTypeMx.ColRow["HSJE"].ToString());
                cmdList.Add(mtTypeMx.Insert());
            }
            mtType.ColRow.Add("SUBSUM", subNum);
            cmdList.AddRange(mtType.InsertCommand());
            if (DbHelperOra.ExecuteSqlTran(cmdList))
            {
                if (flag == "N")
                {
                    Alert.Show("商品使用信息保存成功!");
                }
                OperLog("使用管理", "修改单据【" + docBILLNO.Text + "】");
                billOpen(docBILLNO.Text);
            }
            SaveSuccess = true;
        }
Beispiel #15
0
        protected void btnSaveFa_Click(object sender, EventArgs e)
        {
            #region 数据有效性验证
            if ((",N,R").IndexOf(ddlFLAG.SelectedValue) < 0)
            {
                Alert.Show("非【已提交】单据不能保存!", "消息提示", MessageBoxIcon.Warning);
                return;
            }
            List <Dictionary <string, object> > newDict = GridGoods.GetNewAddedList().OrderBy(x => x["MEMOGOODS"]).ToList();
            if (newDict.Count == 0)
            {
                Alert.Show("请输入【采购方案】", "消息提示", MessageBoxIcon.Warning);
                return;
            }
            if (PubFunc.FormDataCheck(FormDoc).Length > 0)
            {
                return;
            }
            List <Dictionary <string, object> > goodsData = new List <Dictionary <string, object> >();
            string strSUBSUM = "";
            //判断是否有空行、批号填写是否符合要求
            for (int i = 0; i < newDict.Count; i++)
            {
                string strSL   = "0";
                string strHSJJ = "0";
                if (newDict[i]["SL"] != null && !string.IsNullOrWhiteSpace(newDict[i]["SL"].ToString()))
                {
                    strSL = newDict[i]["SL"].ToString();
                }
                if (newDict[i]["HSJJ"] != null && !string.IsNullOrWhiteSpace(newDict[i]["HSJJ"].ToString()))
                {
                    strHSJJ = newDict[i]["HSJJ"].ToString();
                }
                newDict[i]["HSJE"] = decimal.Parse(strSL) * decimal.Parse(strHSJJ);

                strSUBSUM += (newDict[i]["HSJE"] ?? "0").ToString();

                goodsData.Add(newDict[i]);
            }

            if (goodsData.Count == 0)//所有Gird行都为空行时
            {
                Alert.Show("当前单据无数据,无法进行【保存】", "消息提示", MessageBoxIcon.Warning);
                return;
            }

            #endregion


            MyTable mtType = new MyTable("DAT_GOODSNEW_DOC");
            mtType.ColRow          = PubFunc.FormDataHT(FormDoc);
            mtType.ColRow["SEQNO"] = tbxBILLNO.Text;
            mtType.ColRow["FLAG"]  = "N";
            mtType.ColRow["SPR"]   = UserAction.UserID;
            mtType.ColRow["SPRQ"]  = dpkLRRQ.SelectedDate;
            mtType.ColRow.Add("BILLTYPE", BillType);
            mtType.ColRow.Add("SUBNUM", goodsData.Count);
            mtType.ColRow.Add("SUBSUM", strSUBSUM);
            List <CommandInfo> cmdList  = new List <CommandInfo>();
            MyTable            mtTypeMx = new MyTable("DAT_GOODSNEW_COM");
            //先删除单据信息在插入
            cmdList.Add(new CommandInfo("delete DAT_GOODSNEW_DOC where seqno='" + tbxBILLNO.Text + "'", null)); //删除单据台头
            cmdList.Add(new CommandInfo("delete DAT_GOODSNEW_COM where seqno='" + tbxBILLNO.Text + "'", null)); //删除单据明细
            cmdList.AddRange(mtType.InsertCommand());
            for (int i = 0; i < goodsData.Count; i++)
            {
                mtTypeMx.ColRow = PubFunc.GridDataGet(goodsData[i]);

                mtTypeMx.ColRow.Add("SEQNO", tbxBILLNO.Text);
                mtTypeMx.ColRow.Add("ROWNO", i + 1);

                if ((newDict[i]["HSJE"] ?? "0").ToString() == "0")
                {
                    string strSL   = "0";
                    string strHSJJ = "0";
                    if (mtTypeMx.ColRow["SL"] != null && !string.IsNullOrWhiteSpace(mtTypeMx.ColRow["SL"].ToString()))
                    {
                        strSL = mtTypeMx.ColRow["SL"].ToString();
                    }
                    if (mtTypeMx.ColRow["HSJJ"] != null && !string.IsNullOrWhiteSpace(mtTypeMx.ColRow["HSJJ"].ToString()))
                    {
                        strHSJJ = mtTypeMx.ColRow["HSJJ"].ToString();
                    }
                    mtTypeMx.ColRow["HSJE"] = decimal.Parse(strSL) * decimal.Parse(strHSJJ);
                }
                cmdList.Add(mtTypeMx.Insert());
            }

            if (DbHelperOra.ExecuteSqlTran(cmdList))
            {
                Alert.Show("商品采购方案保存成功!");
                hfdISTJFA.Text = "Y";
                //OperLog("商品新增管理", "修改单据【" + tbxBILLNO.Text + "】");
                billOpen(tbxBILLNO.Text);
                //billNew();
                //billLockDoc(true);
            }
        }
Beispiel #16
0
        protected override void billSave()
        {
            #region 数据有效性验证
            if ((",M,R").IndexOf(docFLAG.SelectedValue) < 0)
            {
                Alert.Show("非新单不能保存!", "消息提示", MessageBoxIcon.Warning);
                return;
            }
            List <Dictionary <string, object> > newDict = GridGoods.GetNewAddedList();
            if (newDict.Count == 0)
            {
                Alert.Show("请输入商品信息", "消息提示", MessageBoxIcon.Warning);
                return;
            }
            if (PubFunc.FormDataCheck(FormDoc).Length > 0)
            {
                return;
            }
            List <Dictionary <string, object> > goodsData = new List <Dictionary <string, object> >();
            //判断是否有空行、批号填写是否符合要求
            for (int i = 0; i < newDict.Count; i++)
            {
                if (!string.IsNullOrWhiteSpace(newDict[i]["GDSEQ"].ToString()) && !string.IsNullOrWhiteSpace(newDict[i]["GDNAME"].ToString()))
                {
                    if ((newDict[i]["BZSL"] ?? "").ToString() == "" || (newDict[i]["BZSL"] ?? "").ToString() == "0")
                    {
                        Alert.Show("请填写商品[" + newDict[i]["GDSEQ"] + "]出库数!", "消息提示", MessageBoxIcon.Warning);
                        return;
                    }
                    if (string.IsNullOrWhiteSpace(newDict[i]["BZHL"].ToString()) || string.IsNullOrWhiteSpace(newDict[i]["UNIT"].ToString()))
                    {
                        Alert.Show("商品[" + newDict[i]["GDSEQ"] + "]包装单位信息错误,请联系管理员维护!", "消息提示", MessageBoxIcon.Warning);
                        return;
                    }
                    if (string.IsNullOrWhiteSpace(newDict[i]["HSJJ"].ToString()))
                    {
                        Alert.Show("商品【" + newDict[i]["GDNAME"].ToString() + "】含税进价不能为空!!!", "消息提示", MessageBoxIcon.Warning);
                        return;
                    }
                    if (string.IsNullOrWhiteSpace(newDict[i]["UNIT"].ToString()))
                    {
                        Alert.Show("商品【" + newDict[i]["GDNAME"].ToString() + "】出库包装未维护!!!", "消息提示", MessageBoxIcon.Warning);
                        return;
                    }
                    goodsData.Add(newDict[i]);
                }
            }

            if (goodsData.Count == 0)//所有Gird行都为空行时
            {
                Alert.Show("商品信息不能为空", "消息提示", MessageBoxIcon.Warning);
                return;
            }
            #endregion

            if (PubFunc.StrIsEmpty(docBILLNO.Text))
            {
                docSEQNO.Text     = BillSeqGet();
                docBILLNO.Text    = docSEQNO.Text;
                docBILLNO.Enabled = false;
            }
            else
            {
                string flg = (string)DbHelperOra.GetSingle(string.Format("SELECT NVL(FLAG,'N') FROM DAT_CK_DOC WHERE SEQNO='{0}'", docBILLNO.Text));
                if (!string.IsNullOrWhiteSpace(flg) && (",M,R").IndexOf(flg) < 0)
                {
                    Alert.Show("您输入的单据号存在重复信息,请重新输入或置空!", "消息提示", MessageBoxIcon.Warning);
                    return;
                }
                else
                {
                    docSEQNO.Text     = docBILLNO.Text;
                    docBILLNO.Enabled = false;
                }
            }
            MyTable mtType = new MyTable("DAT_CK_DOC");
            mtType.ColRow          = PubFunc.FormDataHT(FormDoc);
            mtType.ColRow["SEQNO"] = docBILLNO.Text;
            mtType.ColRow.Add("BILLTYPE", BillType);
            mtType.ColRow.Add("SUBNUM", goodsData.Count);
            mtType.ColRow.Add("XSTYPE", "G");
            List <CommandInfo> cmdList  = new List <CommandInfo>();
            MyTable            mtTypeMx = new MyTable("DAT_CK_COM");
            decimal            subNum   = 0;                                                                             //总金额
            //先删除单据信息在插入
            cmdList.Add(new CommandInfo("delete DAT_CK_DOC where seqno='" + docBILLNO.Text + "' and flag = 'M'", null)); //删除单据台头
            cmdList.Add(new CommandInfo("delete DAT_CK_COM where seqno='" + docBILLNO.Text + "'", null));                //删除单据明细
            for (int i = 0; i < goodsData.Count; i++)
            {
                mtTypeMx.ColRow = PubFunc.GridDataGet(goodsData[i]);

                //判断含税进价,为0时不能保存
                if (PubFunc.StrIsEmpty(mtTypeMx.ColRow["HSJJ"].ToString()) || mtTypeMx.ColRow["HSJJ"].ToString() == "0")
                {
                    Alert.Show("商品【含税进价】为0或空,无法进行【库房出库管理】操作。");
                    return;
                }
                mtTypeMx.ColRow.Add("SEQNO", docBILLNO.Text);
                mtTypeMx.ColRow["ROWNO"] = i + 1;
                mtTypeMx.ColRow.Add("PHID", mtTypeMx.ColRow["PH"]);
                mtTypeMx.ColRow["DHSL"] = decimal.Parse(mtTypeMx.ColRow["BZHL"].ToString()) * decimal.Parse(mtTypeMx.ColRow["BZSL"].ToString());
                mtTypeMx.ColRow["HSJE"] = decimal.Parse(mtTypeMx.ColRow["HSJJ"].ToString()) * decimal.Parse(mtTypeMx.ColRow["BZSL"].ToString());
                subNum = subNum + decimal.Parse(mtTypeMx.ColRow["HSJE"].ToString());
                mtTypeMx.ColRow.Add("XSSL", mtTypeMx.ColRow["DHSL"].ToString());
                mtTypeMx.ColRow.Add("BHSJJ", 0);
                mtTypeMx.ColRow.Add("BHSJE", 0);

                mtTypeMx.ColRow.Remove("UNITNAME");
                mtTypeMx.ColRow.Remove("PRODUCERNAME");
                cmdList.Add(mtTypeMx.Insert());
            }
            mtType.ColRow.Add("SUBSUM", subNum);
            //写入追溯码表
            cmdList.Add(new CommandInfo("DELETE DAT_CK_EXT WHERE BILLNO='" + docBILLNO.Text + "'", null));                                                           //删除单据明细
            cmdList.Add(new CommandInfo(String.Format(@"INSERT INTO DAT_CK_EXT(DEPTID,BILLNO,ROWNO,ONECODE,GDSEQ,GDNAME,BARCODE,UNIT,GDSPEC,DEPTCUR,BZHL,FLAG,PH,RQ_SC,YXQZ)
                        SELECT '{1}','{0}',ROWNUM,A.ONECODE,A.GDSEQ,A.GDNAME,A.BARCODE,A.UNIT,A.GDSPEC,A.DEPTCUR,A.BZHL,'N',A.PH,A.RQ_SC,A.YXQZ
                          FROM DAT_RK_EXT A,DAT_CK_COM B
                         WHERE A.GDSEQ = B.GDSEQ AND B.SEQNO = '{0}' AND (A.ONECODE = B.STR2 OR A.STR1 = B.STR2)", docBILLNO.Text, docDEPTID.SelectedValue), null)); //删除单据明细
            cmdList.AddRange(mtType.InsertCommand());
            if (DbHelperOra.ExecuteSqlTran(cmdList))
            {
                Alert.Show("商品出库信息保存成功!");
                billLockDoc(true);
                billOpen(docBILLNO.Text);
            }
        }
        private void xbbiImport_ItemClick(object sender, DevExpress.XtraBars.ItemClickEventArgs e)
        {
            SplashScreenManager.ShowDefaultWaitForm();
            var listCPCOfficialFile =
                xgvOfficialFile.GetSelectedRows()
                .Select(h => xgvOfficialFile.GetRow(h) as CPCOfficialFile)
                .Where(f => f != null)
                .ToList();

            listCPCOfficialFile.ForEach(f =>
            {
                var dtNow = DateTime.Now;
                f.Note    = string.Empty;
                Application.DoEvents();
                try
                {
                    if (f.SendDate == DateTime.MinValue)
                    {
                        f.Note += "官方发文日为空,该官文无法导入";
                        return;
                    }
                    if (string.IsNullOrWhiteSpace(f.CPCOfficialFileConfig.Dealer))
                    {
                        f.Note += "请填写处理人";
                        return;
                    }
                    if (!string.IsNullOrWhiteSpace(f.AppNo) && !f.AppNo.Contains('.'))
                    {
                        f.AppNo = f.AppNo.Insert(f.AppNo.Length - 1, ".");
                    }
                    var dtCase = ExistCase(f.AppNo, f.CPCSerial);
                    if (dtCase.Rows.Count < 1)
                    {
                        f.Note += "未找到案件";
                        return;
                    }
                    if (dtCase.Rows.Count > 1)
                    {
                        f.Note += "找到多个案件";
                        return;
                    }
                    f.CaseSerial = dtCase.Rows[0]["OURNO"].ToString();
                    f.ClientNo   = dtCase.Rows[0]["CLIENT"].ToString();
                    f.ClientName = dtCase.Rows[0]["CLIENT_NAME"].ToString();
                    f.WithDrew   = dtCase.Rows[0]["WITHDREW"].ToString();
                    if (!string.IsNullOrWhiteSpace(dtCase.Rows[0]["DIV_FILINGDATE"].ToString()))
                    {
                        f.DivFilingDate = Convert.ToDateTime(dtCase.Rows[0]["DIV_FILINGDATE"]);
                    }
                    f.Applicants = new Hashtable();
                    for (int i = 1; i <= 5; i++)
                    {
                        if (string.IsNullOrWhiteSpace(dtCase.Rows[0][$"APPL_CODE{i}"].ToString()))
                        {
                            continue;
                        }
                        f.Applicants.Add(dtCase.Rows[0][$"APPL_CODE{i}"].ToString(), !string.IsNullOrWhiteSpace(dtCase.Rows[0][$"APPLICANT{i}"].ToString()) ? dtCase.Rows[0][$"APPLICANT{i}"].ToString() : dtCase.Rows[0][$"APPLICANT_CH{i}"].ToString());
                    }
                    if (ExistFile(f.CaseSerial, f.AppNo, f.FileName, f.SendDate))
                    {
                        f.Note += "通知书已在系统中存在";
                        return;
                    }
                    var strSql = new List <string>();
                    if (!string.IsNullOrWhiteSpace(f.AppNo))
                    {
                        if (!string.IsNullOrWhiteSpace(dtCase.Rows[0]["APPLICATION_NO"].ToString()) &&
                            dtCase.Rows[0]["APPLICATION_NO"].ToString() != f.AppNo)
                        {
                            var dialogResult = XtraMessageBox.Show(
                                $"通知书申请号与PatentCase系统中的申请号不一致,请确认是否进行更新,\r\n系统内申请号:{dtCase.Rows[0]["APPLICATION_NO"].ToString()}\r\n通知书申请号:{f.AppNo}", "冲突提醒", MessageBoxButtons.YesNoCancel, MessageBoxIcon.Question);

                            if (dialogResult == DialogResult.Cancel)
                            {
                                f.Note += "存在冲突,已跳过";
                                return;
                            }
                            if (dialogResult == DialogResult.Yes)
                            {
                                strSql.Add($"update PATENTCASE set APPLICATION_NO = '{f.AppNo}' where OURNO = '{f.CaseSerial}'");
                            }
                        }
                        else
                        {
                            strSql.Add($"update PATENTCASE set APPLICATION_NO = '{f.AppNo}' where OURNO = '{f.CaseSerial}'");
                        }
                    }
                    if (f.FileCode == "210307" || f.FileCode == "210308")
                    {
                        strSql.Add($"update PATENTCASE set SE_INITIATED = 'Y', SE_DATE = to_date('{f.SendDate:yyyy/MM/dd HH:mm:ss}','yyyy/MM/dd hh24:mi:ss') where OURNO = '{f.CaseSerial}'");
                    }
                    strSql.Add($"insert into RECEIVINGLOG (PID,ISSUEDATE,RECEIVED,SENDERID,SENDER,OURNO,APPNO,CLIENTNO,CONTENT,COPIES,COMMENTS,STATUS,HANDLER) values ('{DateTime.Now:yyyyMMdd_HHmmss_ffffff_0}',to_date('{f.SendDate.Date:yyyy/MM/dd}','yyyy/MM/dd'),to_date('{DateTime.Now.Date:yyyy/MM/dd}','yyyy/MM/dd'),'SIPO','SIPO','{dtCase.Rows[0][0]}','{dtCase.Rows[0][1]}','{dtCase.Rows[0][2]}','other','1','{f.FileName}','P','{f.CPCOfficialFileConfig?.Dealer}')");

                    if (f.CPCOfficialFileConfig?.DeadlineFiledType != null)
                    {
                        switch (f.CPCOfficialFileConfig.DeadlineFiledType.Value)
                        {
                        case DeadlineFiledType.Case:
                            if (f.CPCOfficialFileConfig.DeadlineFiled == "GRANTNOTIC_DATE")
                            {
                                strSql.Add($"update PATENTCASE set GRANTNOTIC_DATE=to_date('{f.SendDate.Date:yyyy/MM/dd}','yyyy/MM/dd'),REGFEE_DL=to_date('{f.SendDate.Date.AddDays(15).AddMonths(2):yyyy/MM/dd}','yyyy/MM/dd') where OURNO = '{f.CaseSerial}'");    //更新办登信息
                            }
                            else if (f.CPCOfficialFileConfig.DeadlineFiled == "PRE_EXAM_PASSED")
                            {
                                strSql.Add($"update PATENTCASE set PRE_EXAM_PASSED=to_date('{f.SendDate.Date:yyyy/MM/dd}','yyyy/MM/dd') where OURNO = '{f.CaseSerial}'");    //更新初审合格日
                            }
                            break;

                        case DeadlineFiledType.OA:
                            strSql.Add(
                                $"insert into GENERALALERT (CREATED,TYPEID,OURNO,TRIGERDATE1,DUEDATE,OATYPE,COMMENTS) values (to_date('{DateTime.Now:yyyy/MM/dd HH:mm:ss}','yyyy/MM/dd hh24:mi:ss'),'invoa','{f.CaseSerial}',to_date('{f.SendDate.Date:yyyy/MM/dd}','yyyy/MM/dd'),to_date('{f.SendDate.Date.AddDays(f.CPCOfficialFileConfig.AddDays).AddMonths(f.CPCOfficialFileConfig.AddMonths):yyyy/MM/dd}','yyyy/MM/dd'),'{f.CPCOfficialFileConfig.DeadlineFiled}','{f.CPCOfficialFileConfig.DeadlineFiledNote}')");
                            break;

                        case DeadlineFiledType.Deadline:
                            if (f.FileCode == "200702" && !IsValidCase(f.AppNo))    //如果是专利权终止通知书且案件已届满
                            {
                                break;
                            }
                            strSql.Add(
                                $"insert into GENERALALERT (CREATED,TYPEID,OURNO,DUEDATE,COMMENTS) values (to_date('{DateTime.Now:yyyy/MM/dd HH:mm:ss}','yyyy/MM/dd hh24:mi:ss'),'{f.CPCOfficialFileConfig.DeadlineFiled}','{f.CaseSerial}',to_date('{f.SendDate.Date.AddDays(f.CPCOfficialFileConfig.AddDays).AddMonths(f.CPCOfficialFileConfig.AddMonths):yyyy/MM/dd}','yyyy/MM/dd'),'{f.CPCOfficialFileConfig.DeadlineFiledNote}')");
                            break;

                        case DeadlineFiledType.FCaseDeadline:
                            break;
                        }
                    }

                    SendEmail(f);
                    var array = new ArrayList();
                    array.AddRange(strSql);
                    DbHelperOra.ExecuteSqlTran(array);
                    f.Note = "已导入";
                }
                catch (Exception exception)
                {
                    f.Note += exception.ToString();
                }
                while (dtNow.AddSeconds(1) > DateTime.Now)
                {
                }
            });
            xgvOfficialFile.RefreshData();
            SplashScreenManager.CloseDefaultWaitForm();
        }
Beispiel #18
0
        /// <summary>
        /// 批量从ICE向本地数据库添加模板
        /// </summary>
        /// <param name="list"></param>
        /// <param name="dwbm"></param>
        /// <param name="ajlbmc"></param>
        /// <param name="sslbmc"></param>
        /// <returns></returns>
        public bool AddList(List <Dictionary <string, string> > list, string dwbm, string ajlbbm, string ajlbmc, string sslbbm, string sslbmc)
        {
            StringBuilder strSql0 = new StringBuilder();
            string        sslbs   = "";

            foreach (Dictionary <string, string> model in list)
            {
                sslbs += (sslbs == "" ? "" : ",") + "'" + model["id"] + "'";
            }
            //先删除数据
            strSql0.Append("DELETE XY_DZJZ_MBPZB WHERE UnitID = :UnitID AND CaseInfoTypeID=:CaseInfoTypeID AND SSLBBM in (" + sslbs + ")");
            OracleParameter[] parameters = new OracleParameter[] {
                new OracleParameter(":UnitID", OracleType.VarChar, 20),
                new OracleParameter(":CaseInfoTypeID", OracleType.VarChar, 20)
            };
            parameters[0].Value = dwbm;
            parameters[1].Value = ajlbbm;

            bool result = false;

            try
            {
                int row = DbHelperOra.ExecuteSql(strSql0.ToString(), parameters);
            }
            catch (Exception ex)
            {
                EDRS.Common.LogHelper.LogError(this.context, "Exception", ex.Message, "public bool Add(EDRS.Model.XY_DZJZ_MBPZB model)", "EDRS.OracleDAL.XY_DZJZ_MBPZB", strSql0.ToString(), parameters);
                return(false);
            }
            //获取自增编码
            string  number = "00000000";
            DataSet ds     = GetListByPage("", "DOSSIERTYPEVALUEMEMBER desc", 0, 1);

            if (ds != null && ds.Tables.Count > 0 && ds.Tables[0].Rows.Count > 0)
            {
                number = ds.Tables[0].Rows[0]["DOSSIERTYPEVALUEMEMBER"].ToString();
            }

            //先增加父级目录
            Hashtable sqlList = new Hashtable();
            //父级目录编码,所属类别对应关系
            Dictionary <string, string> keys = new Dictionary <string, string>();

            result = false;
            int i = 0;

            foreach (Dictionary <string, string> model in list)
            {
                StringBuilder strSql1 = new StringBuilder();
                if (model["parentId"] != "")
                {
                    continue;
                }
                //包含子级时自动设置父级菜单为自动生成
                foreach (Dictionary <string, string> modelChild in list)
                {
                    if (modelChild["parentId"] == "")
                    {
                        continue;
                    }
                    if (modelChild["auto"] == "Y")
                    {
                        model["auto"] = "Y";
                    }
                }
                strSql1.Clear();
                strSql1.Append("insert into XY_DZJZ_MBPZB(");
                strSql1.Append("DossierTypeValueMember,CaseInfoTypeID,CaseInfoTypeName,UnitID,DossierTypeDisplayMember,DossierParentMember,DossierEvidenceValueMember,SortIndex,Category,SSLBBM,SSLBMC,Auto)");
                strSql1.Append(" values (");
                strSql1.Append(":DossierTypeValueMember" + i + ",:CaseInfoTypeID" + i + ",:CaseInfoTypeName" + i + ",:UnitID" + i + ",:DossierTypeDisplayMember" + i + ",:DossierParentMember" + i + ",:DossierEvidenceValueMember" + i + ",:SortIndex" + i + ",:Category" + i + ",:SSLBBM" + i + ",:SSLBMC" + i + ",:Auto" + i + ")");
                parameters = new OracleParameter[] {
                    new OracleParameter(":DossierTypeValueMember" + i, OracleType.VarChar, 20),
                    new OracleParameter(":CaseInfoTypeID" + i, OracleType.VarChar, 20),
                    new OracleParameter(":CaseInfoTypeName" + i, OracleType.VarChar, 100),
                    new OracleParameter(":UnitID" + i, OracleType.VarChar, 20),
                    new OracleParameter(":DossierTypeDisplayMember" + i, OracleType.VarChar, 100),
                    new OracleParameter(":DossierParentMember" + i, OracleType.VarChar, 20),
                    new OracleParameter(":DossierEvidenceValueMember" + i, OracleType.VarChar, 100),
                    new OracleParameter(":SortIndex" + i, OracleType.Number, 18),
                    new OracleParameter(":Category" + i, OracleType.Char, 1),
                    new OracleParameter(":SSLBBM" + i, OracleType.VarChar, 20),
                    new OracleParameter(":SSLBMC" + i, OracleType.VarChar, 100),
                    new OracleParameter(":Auto" + i, OracleType.Char, 1)
                };
                number = (int.Parse(number) + 1).ToString().PadLeft(8, '0');
                //添加对应关系
                keys.Add(model["id"], number);

                parameters[0].Value  = number;
                parameters[1].Value  = ajlbbm;
                parameters[2].Value  = ajlbmc;
                parameters[3].Value  = dwbm;
                parameters[4].Value  = model["text"];
                parameters[5].Value  = "";
                parameters[6].Value  = "";
                parameters[7].Value  = model["SortIndex"];
                parameters[8].Value  = "J";
                parameters[9].Value  = model["id"];
                parameters[10].Value = model["text"];// model.SSLBMC;
                parameters[11].Value = model["auto"];
                sqlList.Add(strSql1.ToString(), parameters);
                i++;
            }
            //初始化子级模板
            for (int ii = 0; ii < list.Count; ii++)
            {
                StringBuilder strSql2             = new StringBuilder();
                Dictionary <string, string> model = list[ii];
                if (model["parentId"] == "")
                {
                    continue;
                }
                strSql2.Clear();
                strSql2.Append("insert into XY_DZJZ_MBPZB(");
                strSql2.Append("DossierTypeValueMember,CaseInfoTypeID,CaseInfoTypeName,UnitID,DossierTypeDisplayMember,DossierParentMember,DossierEvidenceValueMember,SortIndex,Category,SSLBBM,SSLBMC,Auto)");
                strSql2.Append(" values (");
                strSql2.Append(":DossierTypeValueMember" + i + ",:CaseInfoTypeID" + i + ",:CaseInfoTypeName" + i + ",:UnitID" + i + ",:DossierTypeDisplayMember" + i + ",:DossierParentMember" + i + ",:DossierEvidenceValueMember" + i + ",:SortIndex" + i + ",:Category" + i + ",:SSLBBM" + i + ",:SSLBMC" + i + ",:Auto" + i + ")");
                parameters = new OracleParameter[] {
                    new OracleParameter(":DossierTypeValueMember" + i, OracleType.VarChar, 20),
                    new OracleParameter(":CaseInfoTypeID" + i, OracleType.VarChar, 20),
                    new OracleParameter(":CaseInfoTypeName" + i, OracleType.VarChar, 100),
                    new OracleParameter(":UnitID" + i, OracleType.VarChar, 20),
                    new OracleParameter(":DossierTypeDisplayMember" + i, OracleType.VarChar, 100),
                    new OracleParameter(":DossierParentMember" + i, OracleType.VarChar, 20),
                    new OracleParameter(":DossierEvidenceValueMember" + i, OracleType.VarChar, 100),
                    new OracleParameter(":SortIndex" + i, OracleType.Number, 18),
                    new OracleParameter(":Category" + i, OracleType.Char, 1),
                    new OracleParameter(":SSLBBM" + i, OracleType.VarChar, 20),
                    new OracleParameter(":SSLBMC" + i, OracleType.VarChar, 100),
                    new OracleParameter(":Auto" + i, OracleType.Char, 1)
                };
                number = (int.Parse(number) + 1).ToString().PadLeft(8, '0');
                parameters[0].Value  = number;
                parameters[1].Value  = ajlbbm;
                parameters[2].Value  = ajlbmc;
                parameters[3].Value  = dwbm;
                parameters[4].Value  = model["text"];
                parameters[5].Value  = keys[model["parentId"]];
                parameters[6].Value  = "";
                parameters[7].Value  = model["SortIndex"];
                parameters[8].Value  = "W";
                parameters[9].Value  = model["id"];
                parameters[10].Value = model["text"];// model.SSLBMC;
                parameters[11].Value = model["auto"];
                sqlList.Add(strSql2.ToString(), parameters);
                i++;
            }
            try
            {
                result = DbHelperOra.ExecuteSqlTran(sqlList);
                return(result);
            }
            catch (Exception ex)
            {
                EDRS.Common.LogHelper.LogError(this.context, "Exception", ex.Message, "public bool AddLB(List<EDRS.Model.XT_DM_QX> list, string jsbm, string dwbm, string bmbm)", "EDRS.OracleDAL.XT_DM_QX", sqlList);
            }
            return(false);
        }