Ejemplo n.º 1
0
        //计算消息摘要
        public static String getMessageDigest(String str, String encName)
        {
            //  IsNullOrWhiteSpace
            byte[] digest = null;
            //  if (String.IsNullOrWhiteSpace(encName))
            if (ClsSystem.gnvl(encName, "") == "")
            {
                encName = "SHA-1";
            }
            try
            {
                switch (encName)
                {
                case "SHA-1":
                    digest = SHA_1(str);
                    break;

                default:
                    digest = SHA_1(str);
                    break;
                }
            }
            catch (Exception e)
            {
                Console.Write(e.Message);
            }
            return(byteArrayToHex(digest));
        }
Ejemplo n.º 2
0
        private void dgv2_CellDoubleClick(object sender, DataGridViewCellEventArgs e)
        {
            int              i             = e.RowIndex;
            string           sql           = "";
            DataGridViewCell dgc           = dgv2.CurrentCell;
            decimal          iTaxUnitPrice = 0;
            decimal          iDisRate      = 0;

            if (dgc.OwningColumn.Name == "ZXSPBM")
            {
                frmQueryYP HW = new frmQueryYP();
                //frmQueryHW.strmdcode = mdcode;

                HW.ShowDialog();

                if (frmQueryYP.hwID != "")
                {
                    this.dgv2.Rows[i].Cells["xh"].Value     = dgv2.Rows.Count + 1;
                    this.dgv2.Rows[i].Cells["ZXSPBM"].Value = frmQueryYP.hwID;
                    this.dgv2.Rows[i].Cells["YQBM"].Value   = "ZDYC0001";
                    sql = @"select  c.cComUnitName from inventory inv left join ComputationUnit  c on c.cComunitCode =inv.cComunitCode  where inv.cInvCode='" + frmQueryYP.hwCode + "'";
                    this.dgv2.Rows[i].Cells["CGJLDW"].Value = ClsSystem.gnvl(SqlAccess.ExecuteScalar(sql, Program.ConnectionString), "");
                }
            }
        }
Ejemplo n.º 3
0
        private void dgv1_CellEndEdit(object sender, DataGridViewCellEventArgs e)
        {
            int row = e.RowIndex;

            cSBVCodeNew = ClsSystem.gnvl(this.dgv1.Rows[row].Cells["cSBVCode"].Value, "");
            dgv1.EndEdit();

            //    DataGridViewCell dgc = dgv1.CurrentCell;
            //if (dgc.OwningColumn.Name == "check")
            //{
            //dgv1.RefreshEdit();


            for (int i = 0; i <= dgv1.Rows.Count - 1; i++)
            {
                if (ClsSystem.gnvl(this.dgv1.Rows[i].Cells["check"].Value, "").ToUpper() == "TRUE")
                {
                    if (ClsSystem.gnvl(dgv1.Rows[i].Cells["cSBVCode"].Value, "") == cSBVCodeNew)
                    {
                        dgv1.Rows[i].Cells["check"].Value = true;
                    }
                }
                else
                {
                    if (ClsSystem.gnvl(dgv1.Rows[i].Cells["cSBVCode"].Value, "") == cSBVCodeNew)
                    {
                        dgv1.Rows[i].Cells["check"].Value = false;
                    }
                }
            }
            //dgv1.EndEdit();
            // dgv1.Refresh();
            //  }
        }
Ejemplo n.º 4
0
        private void dgv1_CellEndEdit(object sender, DataGridViewCellEventArgs e)
        {
            //   int row = e.RowIndex;

            dgv1.EndEdit();


            Boolean isTrue = false;
            int     row    = dgv1.CurrentRow.Index;

            cSBVCodeNew = ClsSystem.gnvl(this.dgv1.Rows[row].Cells["cSBVCode"].Value, "");


            if (ClsSystem.gnvl(this.dgv1.Rows[row].Cells["check"].Value, "").ToUpper() == "TRUE")
            {
                isTrue = true;
            }
            else
            {
                isTrue = false;
            }

            for (int i = 0; i <= dgv1.Rows.Count - 1; i++)
            {
                if (ClsSystem.gnvl(dgv1.Rows[i].Cells["cSBVCode"].Value, "") == cSBVCodeNew)
                {
                    dgv1.Rows[i].Cells["check"].Value = isTrue;
                }
            }


            dgv1.EndEdit();
            dgv1.RefreshEdit();
        }
Ejemplo n.º 5
0
        private void btnexport_Click(object sender, EventArgs e)
        {
            string xmlData   = "";
            string resultXMl = "";
            string sql       = "";

            this.Cursor = Cursors.WaitCursor;
            if (dgv2.Rows.Count > 0)
            {
                for (int i = 0; i < dgv2.Rows.Count; i++)
                {
                    xmlData = "";
                    xmlData = xmlData + @"<?xml version=""1.0""  encoding=""utf-8""?>";
                    xmlData = xmlData + "<XMLDATA>";
                    xmlData = xmlData + "<HEAD>";
                    xmlData = xmlData + "<IP>" + SendMessage.GetIP() + "</IP> ";
                    xmlData = xmlData + "<MAC>" + SendMessage.GetMAC() + "</MAC> ";
                    xmlData = xmlData + "<BZXX></BZXX> ";
                    xmlData = xmlData + "</HEAD> ";
                    xmlData = xmlData + "<MAIN>";
                    xmlData = xmlData + "<CZLX>1</CZLX> ";
                    xmlData = xmlData + "<SPLX>1</SPLX> ";
                    xmlData = xmlData + "<YPLX>1</YPLX> ";
                    xmlData = xmlData + "<TYM>" + ClsSystem.gnvl(dgv2.Rows[i].Cells["cCurrencyName"].Value, "") + "</TYM> ";
                    xmlData = xmlData + "<CPM>" + ClsSystem.gnvl(dgv2.Rows[i].Cells["cInvName"].Value, "") + "</CPM> ";
                    xmlData = xmlData + "<YWM>" + ClsSystem.gnvl(dgv2.Rows[i].Cells["cEnglishName"].Value, "") + "</YWM> ";
                    xmlData = xmlData + "<SPM>" + ClsSystem.gnvl(dgv2.Rows[i].Cells["cInvName"].Value, "") + "</SPM> ";
                    xmlData = xmlData + "<YPSPTXM>" + ClsSystem.gnvl(dgv2.Rows[i].Cells["cidefine8"].Value, "") + "</YPSPTXM> ";
                    xmlData = xmlData + "<YPJX>1</YPJX> ";
                    xmlData = xmlData + "<GG>" + ClsSystem.gnvl(dgv2.Rows[i].Cells["cInvStd"].Value, "") + "</GG> ";
                    xmlData = xmlData + "<SCQYMC>" + ClsSystem.gnvl(dgv2.Rows[i].Cells["cEnterprise"].Value, "") + "</SCQYMC> ";
                    xmlData = xmlData + "<CPLB>" + ClsSystem.gnvl(dgv2.Rows[i].Cells["cInvStd"].Value, "") + "</CPLB> ";
                    xmlData = xmlData + "<YPBWM>" + ClsSystem.gnvl(dgv2.Rows[i].Cells["cidefine2"].Value, "") + "</YPBWM> ";
                    xmlData = xmlData + "<YPPZWH>" + ClsSystem.gnvl(dgv2.Rows[i].Cells["cFile"].Value, "") + "</YPPZWH> ";
                    xmlData = xmlData + "<BZCZ>" + ClsSystem.gnvl(dgv2.Rows[i].Cells["cidefine3"].Value, "") + "</BZCZ> ";
                    xmlData = xmlData + "<BZDW>" + ClsSystem.gnvl(dgv2.Rows[i].Cells["cComUnitName"].Value, "") + "</BZDW> ";
                    xmlData = xmlData + "<CGYYDW>" + ClsSystem.gnvl(dgv2.Rows[i].Cells["cComUnitName"].Value, "") + "</CGYYDW> ";
                    xmlData = xmlData + "<BZSL>1</BZSL> ";
                    xmlData = xmlData + "<BZFS>" + ClsSystem.gnvl(dgv2.Rows[i].Cells["cidefine4"].Value, "") + "</BZFS> ";
                    xmlData = xmlData + "<TZMS>" + ClsSystem.gnvl(dgv2.Rows[i].Cells["cComUnitName"].Value, "") + "</TZMS> ";
                    xmlData = xmlData + "</MAIN>";
                    xmlData = xmlData + "</XMLDATA>";

                    resultXMl = SendMessage.SetMessage("YQ001", xmlData);


                    string result = SendMessage.ReadXMl(resultXMl, "HEAD", "ZTCLJG");

                    if (result == "00000")
                    {
                        sql = @" update inventory set cInvDefine10='00000' where cinvcode='" + ClsSystem.gnvl(dgv2.Rows[i].Cells["cinvcode"].Value, "") + "'";
                        SqlAccess.ExecuteSql(sql, Program.ConnectionString);
                    }
                    dgv2.Rows[i].Cells["resultXMl"].Value = ClsSystem.gnvl(result, "");
                }
            }

            this.Cursor = Cursors.Default;
        }
Ejemplo n.º 6
0
        private void btnexport_Click(object sender, EventArgs e)
        {
            string xmlData   = "";
            string resultXMl = "";
            string sql       = "";

            this.Cursor = Cursors.WaitCursor;
            if (dgv2.Rows.Count > 0)
            {
                xmlData = "";
                xmlData = xmlData + @"<?xml version=""1.0""  encoding=""utf-8""?>";
                xmlData = xmlData + "<XMLDATA>";
                xmlData = xmlData + "<HEAD>";
                xmlData = xmlData + "<IP>" + SendMessage.GetIP() + "</IP> ";
                xmlData = xmlData + "<MAC>" + SendMessage.GetMAC() + "</MAC> ";
                xmlData = xmlData + "<BZXX></BZXX> ";
                xmlData = xmlData + "</HEAD> ";
                xmlData = xmlData + "<MAIN>";
                xmlData = xmlData + "<KCCBSJ>" + DateTime.Today.Year.ToString("0000") + DateTime.Today.Month.ToString("00") + DateTime.Today.Day.ToString("00") + "/" + DateTime.Today.Hour.ToString("00") + DateTime.Today.Minute.ToString("00") + DateTime.Today.Second.ToString("00") + "/" + "</KCCBSJ> ";
                xmlData = xmlData + "<JLS>" + dgv2.Rows.Count.ToString() + "</JLS> ";

                xmlData = xmlData + "</MAIN>";
                xmlData = xmlData + "<DETAIL>";
                for (int i = 0; i < dgv2.Rows.Count; i++)
                {
                    xmlData = xmlData + "<STRUCT>";
                    xmlData = xmlData + "<SPLX>1</SPLX> ";
                    xmlData = xmlData + "<ZXSPBM>" + ClsSystem.gnvl(dgv2.Rows[i].Cells["ZXSPBM"].Value, "") + "</ZXSPBM> ";
                    xmlData = xmlData + "<YPKCL>1</YPKCL> ";
                    xmlData = xmlData + "<KCSL>" + ClsSystem.gnvl(Public.ChinaRound(Public.GetNum(dgv2.Rows[i].Cells["KCSL"].Value), 0), "0") + "</KCSL> ";
                    xmlData = xmlData + "<KCDW>" + ClsSystem.gnvl(dgv2.Rows[i].Cells["KCDW"].Value, "") + "</KCDW> ";
                    xmlData = xmlData + "</STRUCT>";
                }
                xmlData = xmlData + "</DETAIL>";
                xmlData = xmlData + "</XMLDATA>";

                resultXMl = SendMessage.SetMessage("YQ002", xmlData);


                //string result = SendMessage.ReadXMl(resultXMl, "HEAD", "ZTCLJG");

                //if (result == "00000")
                //{
                ////    sql = @" update inventory set cInvDefine10='00000' where cinvcode='" + ClsSystem.gnvl(dgv2.Rows[i].Cells["cinvcode"].Value, "") + "'";
                ////    SqlAccess.ExecuteSql(sql, Program.ConnectionString);
                //     dgv2.Rows[i].Cells["resultXMl"].Value = ClsSystem.gnvl(result, "");
                //}
            }

            this.Cursor = Cursors.Default;
        }
Ejemplo n.º 7
0
        public static bool GetPass(string caccid, string ddate)
        {
            string   sql     = "";
            DateTime dt1     = DateTime.Now;
            DateTime dt2     = Convert.ToDateTime(ddate);
            TimeSpan span    = dt1.Subtract(dt2);
            int      dayDiff = span.Days + 1;

            if (dayDiff >= 30)
            {
                sql = @" update UA_Account_Ex set cFinKind='2' where cAcc_Id='" + caccid + "'";
                SqlAccess.ExecuteSql(sql, Program.ConnectionString);
            }

            sql = @" select cFinKind from UA_Account_Ex where cAcc_Id='" + caccid + "'";
            string result = ClsSystem.gnvl(SqlAccess.ExecuteScalar(sql, Program.ConnectionString), "");

            if (result == "2")
            {
                return(true);
            }
            return(false);
        }
Ejemplo n.º 8
0
        private void button5_Click(object sender, EventArgs e)
        {
            DataRow   newrow = null;
            DataTable db     = new DataTable();

            db.Columns.Add("DataColumn1");
            db.Columns.Add("DataColumn2");
            db.Columns.Add("DataColumn3");
            db.Columns.Add("DataColumn4");
            db.Columns.Add("DataColumn5");
            db.Columns.Add("DataColumn6");
            db.Columns.Add("DataColumn7");
            db.Columns.Add("DataColumn8");
            db.Columns.Add("DataColumn9");
            db.Columns.Add("DataColumn10");


            for (int i = 0; i < dgv1.Rows.Count; i++)
            {
                if (ClsSystem.gnvl(this.dgv1.Rows[i].Cells["check"].Value, "").ToUpper() == "TRUE")
                {
                    newrow = db.Rows.Add();
                    newrow["DataColumn1"] = ClsSystem.gnvl(dgv1.Rows[i].Cells["cSBVCode"].Value, "");

                    newrow["DataColumn2"] = ClsSystem.gnvl(dgv1.Rows[i].Cells["cinvname"].Value, "");

                    newrow["DataColumn3"] = ClsSystem.gnvl(dgv1.Rows[i].Cells["cInvStd"].Value, "");
                    if (ClsSystem.gnvl(dgv1.Rows[i].Cells["cAddress"].Value, "").Length >= 13)
                    {
                        if (Public.GetPass(Program.cacc_id, "2015-07-15"))
                        {
                            newrow["DataColumn4"] = "   " + ClsSystem.gnvl(dgv1.Rows[i].Cells["cAddress"].Value, "").Substring(0, 13) + "                                    ";
                        }
                        else

                        {
                            newrow["DataColumn4"] = ClsSystem.gnvl(dgv1.Rows[i].Cells["cAddress"].Value, "").Substring(0, 13);
                        }
                    }
                    else
                    {
                        newrow["DataColumn4"] = ClsSystem.gnvl(dgv1.Rows[i].Cells["cAddress"].Value, "");
                    }
                    newrow["DataColumn5"] = ClsSystem.gnvl(dgv1.Rows[i].Cells["PSDTM"].Value, "");
                    newrow["DataColumn6"] = ClsSystem.gnvl(dgv1.Rows[i].Cells["cExpirationdate"].Value, "");
                    newrow["DataColumn7"] = ClsSystem.gnvl(Public.ChinaRound(Public.GetNum(dgv1.Rows[i].Cells["iNum"].Value), 2), "");
                    newrow["DataColumn8"] = "震达医药";
                    newrow["DataColumn9"] = ClsSystem.gnvl(dgv1.Rows[i].Cells["cBatch"].Value, "");


                    newrow["DataColumn10"] = ClsSystem.gnvl(dgv1.Rows[i].Cells["cCusName"].Value, "");
                }
            }
            if (db.Rows.Count > 0)
            {
                XtraReport1 report = new XtraReport1();
                report.DataSource  = db;
                report.PrinterName = "条码打印";
                report.ShowPreview();
            }
            else
            {
                MessageBox.Show("未选择数据", "错误", MessageBoxButtons.OK);
            }
        }
Ejemplo n.º 9
0
        private void GetTable()
        {
            DataSet        dt          = new DataSet();
            SqlDataAdapter thisAdapter = null;
            string         sql         = "";

            try
            {
                dgv1.EndEdit();
                if (dgv1.Rows.Count > 0)
                {
                    dgv1.Rows.Clear();
                }
                //DataTable db = (DataTable)dgv1.DataSource;

                //if (db != null)
                //{
                //    db.Rows.Clear();
                //}
                //   dgv1.DataSource = db;
                this.Cursor = Cursors.WaitCursor;

//                sql = @" select a.cdefine9 ,a.cdlCode  , a.dDate ,a.cSTCode ,a.bReturnFlag,a.ccusname ,
//                        a.cDefine12,a.cDefine13,a.cDefine14,a.cDefine8, a.cMaker, a.cMemo ,a.DLID,a.cdefine11,
//                    b.cinvcode,b.cinvname,b.iQuantity,b.cInvDefine5,b.cDefine28,b.cDefine29,b.cDefine30,b.cBatch ,b.dMDate ,b.cExpirationdate  ,
//                 b.cdefine25,b.iDLsID,b.cDefine32,b.cDefine33,b.cDefine35
//                     from Sales_FHD_T  a join Sales_FHD_W  b on b.dlid=a.dlid  where
//                        ISNULL(a.cverifier ,'')<>''  and   ISNULL(a.cdefine11 ,'')<>'' ";

//                if (ClsSystem.gnvl(textBox1.Text, "") != "")
//                {
//                    sql = sql + " and a.cdlCode>='" + ClsSystem.gnvl(textBox1.Text, "") + "'";
//                }
//                if (ClsSystem.gnvl(textBox2.Text, "") != "")
//                {
//                    sql = sql + " and a.cdlCode<='" + ClsSystem.gnvl(textBox2.Text, "") + "'";
//                }
//                if (ClsSystem.gnvl(dt1.Value, "") != "")
//                {
//                    sql = sql + " and datediff(day,a.ddate,'" + ClsSystem.gnvl(dt1.Value.ToShortDateString(), "") + "')<=0 ";

//                }
//                if (ClsSystem.gnvl(dt2.Value, "") != "")
//                {
//                    sql = sql + " and datediff(day,a.ddate,'" + ClsSystem.gnvl(dt2.Value.ToShortDateString(), "") + "')>=0 ";
//                }

//                if (checkbox1.Checked == true)
//                {
//                    sql = sql + " and a.bReturnFlag= 1 ";
//                }
//                else
//                {
//                    sql = sql + " and a.bReturnFlag= 0 ";
//                }
//                if (checkBox2.Checked == true)
//                {
//                    sql = sql + " and isnull(b.cdefine25,'')<> ''";
//                }
//                else
//                {
//                    sql = sql + " and isnull(b.cdefine25,'')=''";
//                }
//                //sql = sql + "   group by a.DLID ,a.cdlCode  ,a.cSTCode , a.dDate ,a.bReturnFlag, a.cMemo ,a.cMaker, a.cDefine1,a.cDefine2,a.cDefine3,a.cDefine10,a.cDefine11,a.cDefine12,a.cDefine13";
//                sql = sql + "   order by a.dDate    ";

                sql = @" select a.cdefine9,a.cdefine10 ,a.cSBVCode, a.dDate ,a.cSTCode ,a.bReturnFlag,a.ccusname ,
                        a.cDefine12,a.cDefine13,a.cDefine14,a.cDefine15,a.cDefine8, a.cMaker, a.cMemo ,a.SBVID,a.cdefine11,
                          b.cinvcode,b.cinvname,b.cDefine28,b.iQuantity,b.cInvDefine5,b.cDefine29,b.cDefine30,b.cBatch ,
                           b.cSoCode ,inv.cFile ,b.dMDate ,b.cExpirationdate ,b.iUnitPrice ,b.iTaxUnitPrice ,b.iTaxRate ,
                           b.iTax ,b.iMoney ,b.iSum ,       b.iQuotedPrice,   inv.fRetailPrice,
                     b.cdefine23,   b.cdefine24, b.cdefine25,b.iDLsID,b.cDefine32,b.cDefine33,b.cdefine34,a.sbvid,
                           inv.cFile,inv.cInvStd ,inv.cAddress ,b.iNum
                     from SaleBillVouchZT  a   join SaleBillVouchZW b on a.sbvid=b.sbvid 
                          left join inventory inv  on inv.cinvcode=b.cinvcode
                       where   ISNULL(a.cChecker,'')<>'' and   ISNULL(a.cdefine11 ,'')<>'' ";

                if (ClsSystem.gnvl(textBox1.Text, "") != "")
                {
                    sql = sql + " and a.cSBVCode >='" + ClsSystem.gnvl(textBox1.Text, "") + "'";
                }
                if (ClsSystem.gnvl(textBox2.Text, "") != "")
                {
                    sql = sql + " and a.cSBVCode <='" + ClsSystem.gnvl(textBox2.Text, "") + "'";
                }
                if (ClsSystem.gnvl(dt1.Value, "") != "")
                {
                    sql = sql + " and datediff(day,a.ddate,'" + ClsSystem.gnvl(dt1.Value.ToShortDateString(), "") + "')<=0 ";
                }
                if (ClsSystem.gnvl(dt2.Value, "") != "")
                {
                    sql = sql + " and datediff(day,a.ddate,'" + ClsSystem.gnvl(dt2.Value.ToShortDateString(), "") + "')>=0 ";
                }

                if (checkbox1.Checked == true)
                {
                    sql = sql + " and a.bReturnFlag= 1 ";
                }
                else
                {
                    sql = sql + " and a.bReturnFlag= 0 ";
                }
                if (checkBox2.Checked == true)
                {
                    sql = sql + " and isnull(b.cdefine25,'')<> ''";
                }
                else
                {
                    sql = sql + " and isnull(b.cdefine25,'')=''";
                }
                //sql = sql + "   group by a.DLID ,a.cdlCode  ,a.cSTCode , a.dDate ,a.bReturnFlag, a.cMemo ,a.cMaker, a.cDefine1,a.cDefine2,a.cDefine3,a.cDefine10,a.cDefine11,a.cDefine12,a.cDefine13";
                sql         = sql + "   order by a.dDate    ";
                thisAdapter = new SqlDataAdapter(sql, Program.ConnectionString);

                thisAdapter.Fill(dt);
                DataTable db = dt.Tables[0];
                if (db.Rows.Count > 0)
                {
                    for (int i = 0; i < db.Rows.Count; i++)
                    {
                        dgv1.Rows.Add();

                        dgv1.Rows[i].Cells["zxlx"].Value      = ClsSystem.gnvl(db.Rows[i]["cdefine23"], "");
                        dgv1.Rows[i].Cells["cdefine24"].Value = ClsSystem.gnvl(db.Rows[i]["cdefine24"], "");
                        dgv1.Rows[i].Cells["cdefine25"].Value = ClsSystem.gnvl(db.Rows[i]["cdefine25"], "");
                        dgv1.Rows[i].Cells["PSDTM"].Value     = "ZD1" + ClsSystem.gnvl(db.Rows[i]["iDLsID"], "");
                        dgv1.Rows[i].Cells["cCusName"].Value  = ClsSystem.gnvl(db.Rows[i]["cCusName"], "");
                        dgv1.Rows[i].Cells["cdefine14"].Value = ClsSystem.gnvl(db.Rows[i]["cdefine14"], "");
                        dgv1.Rows[i].Cells["cdefine32"].Value = ClsSystem.gnvl(db.Rows[i]["cdefine32"], "");

                        dgv1.Rows[i].Cells["cdefine33"].Value = ClsSystem.gnvl(db.Rows[i]["cdefine33"], "");
                        dgv1.Rows[i].Cells["cdefine34"].Value = ClsSystem.gnvl(db.Rows[i]["cdefine34"], "");
                        dgv1.Rows[i].Cells["dDate"].Value     = ClsSystem.gnvl(db.Rows[i]["dDate"], "");
                        dgv1.Rows[i].Cells["cSBVCode"].Value  = ClsSystem.gnvl(db.Rows[i]["cSBVCode"], "");
                        dgv1.Rows[i].Cells["cInvCode"].Value  = ClsSystem.gnvl(db.Rows[i]["cInvCode"], "");
                        dgv1.Rows[i].Cells["cInvName"].Value  = ClsSystem.gnvl(db.Rows[i]["cInvName"], "");

                        dgv1.Rows[i].Cells["iQuantity"].Value = ClsSystem.gnvl(db.Rows[i]["iQuantity"], "");
                        dgv1.Rows[i].Cells["iNum"].Value      = ClsSystem.gnvl(db.Rows[i]["iNum"], "");

                        dgv1.Rows[i].Cells["cInvDefine5"].Value = ClsSystem.gnvl(db.Rows[i]["cInvDefine5"], "");
                        dgv1.Rows[i].Cells["cDefine28"].Value   = ClsSystem.gnvl(db.Rows[i]["cDefine28"], "");
                        dgv1.Rows[i].Cells["cDefine29"].Value   = ClsSystem.gnvl(db.Rows[i]["cDefine29"], "");

                        dgv1.Rows[i].Cells["cDefine30"].Value = ClsSystem.gnvl(db.Rows[i]["cDefine30"], "");

                        dgv1.Rows[i].Cells["iDLsID"].Value          = ClsSystem.gnvl(db.Rows[i]["iDLsID"], "");
                        dgv1.Rows[i].Cells["cBatch"].Value          = ClsSystem.gnvl(db.Rows[i]["cBatch"], "");
                        dgv1.Rows[i].Cells["dMDate"].Value          = ClsSystem.gnvl(db.Rows[i]["dMDate"], "");
                        dgv1.Rows[i].Cells["cExpirationdate"].Value = ClsSystem.gnvl(db.Rows[i]["cExpirationdate"], "");
                        dgv1.Rows[i].Cells["bReturnFlag"].Value     = ClsSystem.gnvl(db.Rows[i]["bReturnFlag"], "");

                        dgv1.Rows[i].Cells["cMaker"].Value = ClsSystem.gnvl(db.Rows[i]["cMaker"], "");

                        dgv1.Rows[i].Cells["cMemo"].Value     = ClsSystem.gnvl(db.Rows[i]["cMemo"], "");
                        dgv1.Rows[i].Cells["cDefine11"].Value = ClsSystem.gnvl(db.Rows[i]["cDefine11"], "");
                        dgv1.Rows[i].Cells["sbvid"].Value     = ClsSystem.gnvl(db.Rows[i]["sbvid"], "");

                        dgv1.Rows[i].Cells["cInvStd"].Value  = ClsSystem.gnvl(db.Rows[i]["cInvStd"], "");
                        dgv1.Rows[i].Cells["cAddress"].Value = ClsSystem.gnvl(db.Rows[i]["cAddress"], "");
                    }
                }
                //this.dgv1.DataSource = dt.Tables[0];
                this.button4.Text = "全选";
                this.Cursor       = Cursors.Default;
                //  this.textBox1.Text = "查询到 " + dt.Tables[0].Rows.Count.ToString() + " 条记录。";
            }
            catch (Exception ex)
            {
                MessageBox.Show(ex.Message.ToString(), "错误", MessageBoxButtons.OK, MessageBoxIcon.Error);
            }
        }
Ejemplo n.º 10
0
        private void button1_Click(object sender, EventArgs e)
        {
            string xmlData = "";
            string sql     = "";
            string sbvid   = "";;
            //  int y = 0;
            DataTable dts = null;

            this.Cursor = Cursors.WaitCursor;
            if (dgv1.Rows.Count > 0)
            {
                for (int i = 0; i < dgv1.Rows.Count; i++)
                {
                    if (ClsSystem.gnvl(this.dgv1.Rows[i].Cells["check"].Value, "").ToUpper() == "TRUE" && ClsSystem.gnvl(this.dgv1.Rows[i].Cells["cdefine25"].Value, "").ToUpper() != "00000")
                    {
                        //yybm= ClsSystem.gnvl(dgv1.Rows[i].Cells["cdefine11"].Value, "");
                        //PSDBM = ClsSystem.gnvl(dgv1.Rows[i].Cells["cDefine32"].Value, "");
                        //if (yybm_O != yybm&&y>0)
                        //{
                        //    MessageBox.Show("请选择同一客户上传", "错误", MessageBoxButtons.OK, MessageBoxIcon.Error);
                        //    return;
                        //}
                        //if (PSDBM_O != PSDBM && y > 0)
                        //{
                        //    MessageBox.Show("请选择同一医院配送点编码", "错误", MessageBoxButtons.OK, MessageBoxIcon.Error);
                        //    return;
                        //}
                        if (ClsSystem.gnvl(ClsSystem.gnvl(dgv1.Rows[i].Cells["cDefine34"].Value, ""), "") == "")
                        {
                            MessageBox.Show("配送箱数未填入", "错误", MessageBoxButtons.OK, MessageBoxIcon.Error);
                            return;
                        }
                        if (ClsSystem.gnvl(dgv1.Rows[i].Cells["zxlx"].Value, "") == "")
                        {
                            MessageBox.Show("装箱类型未填入", "错误", MessageBoxButtons.OK, MessageBoxIcon.Error);
                            return;
                        }
                        //yybm_O = yybm;
                        //PSDBM_O = PSDBM;
                        //y++;
                    }
                }

                //if (count < 1)
                //{
                //    MessageBox.Show("请选择配送数据", "错误", MessageBoxButtons.OK, MessageBoxIcon.Error);
                //    return;
                //}
                for (int j = 0; j < dgv1.Rows.Count; j++)
                {
                    if (ClsSystem.gnvl(this.dgv1.Rows[j].Cells["check"].Value, "").ToUpper() == "TRUE" && ClsSystem.gnvl(this.dgv1.Rows[j].Cells["cdefine25"].Value, "").ToUpper() != "00000")
                    {
                        xmlData = "";
                        xmlData = xmlData + @"<?xml version=""1.0""  encoding=""utf-8""?>";
                        xmlData = xmlData + "<XMLDATA>";
                        xmlData = xmlData + "<HEAD>";
                        xmlData = xmlData + "<IP>" + SendMessage.GetIP() + "</IP> ";
                        xmlData = xmlData + "<MAC>" + SendMessage.GetMAC() + "</MAC> ";
                        xmlData = xmlData + "<BZXX></BZXX> ";
                        xmlData = xmlData + "</HEAD> ";
                        xmlData = xmlData + "<MAIN>";
                        xmlData = xmlData + "<CZLX>1</CZLX> ";
                        xmlData = xmlData + "<PSDH>" + ClsSystem.gnvl(dgv1.Rows[j].Cells["PSDTM"].Value, "") + "</PSDH> ";
                        xmlData = xmlData + "<YQBM>ZDYC0001</YQBM> ";
                        xmlData = xmlData + "<YYBM>" + ClsSystem.gnvl(dgv1.Rows[j].Cells["cdefine11"].Value, "") + "</YYBM> ";
                        xmlData = xmlData + "<PSDBM>" + ClsSystem.gnvl(dgv1.Rows[j].Cells["cDefine32"].Value, "") + "</PSDBM> ";
                        xmlData = xmlData + "<CJRQ>" + DateTime.Today.Year.ToString("0000") + DateTime.Today.Month.ToString("00") + DateTime.Today.Day.ToString("00") + "</CJRQ> ";
                        xmlData = xmlData + "<SDRQ></SDRQ> ";
                        xmlData = xmlData + "<ZXS>" + ClsSystem.gnvl(dgv1.Rows[j].Cells["cdefine34"].Value, "") + "</ZXS> ";
                        xmlData = xmlData + "<JLS>1</JLS> ";
                        xmlData = xmlData + "</MAIN>";
                        xmlData = xmlData + "<DETAIL>";


                        sbvid = ClsSystem.gnvl(this.dgv1.Rows[j].Cells["sbvid"].Value, "");
                        //                        sql = @" select cinvcode,cinvname,cDefine28,iQuantity,cInvDefine3,cDefine29,cDefine30,cBatch ,dMDate ,cExpirationdate ,cSoCode
                        //                     from  Sales_FHD_w  where dlid=" + DLID;

                        //                        dts = SqlAccess.ExecuteSqlDataTable(sql, Program.ConnectionString);

                        //for (int k = 0; k < dts.Rows.Count; k++)
                        //{

                        xmlData = xmlData + "<STRUCT>";

                        xmlData = xmlData + "<PSDTM>" + ClsSystem.gnvl(dgv1.Rows[j].Cells["PSDTM"].Value, "") + "</PSDTM> ";
                        if (ClsSystem.gnvl(dgv1.Rows[j].Cells["zxlx"].Value, "") == "整箱")
                        {
                            xmlData = xmlData + "<ZXLX>1</ZXLX> ";
                        }
                        else
                        {
                            xmlData = xmlData + "<ZXLX>2</ZXLX> ";
                        }
                        xmlData = xmlData + "<SPLX>1</SPLX> ";
                        xmlData = xmlData + "<ZXSPBM>" + ClsSystem.gnvl(dgv1.Rows[j].Cells["cDefine28"].Value, "") + "</ZXSPBM> ";
                        xmlData = xmlData + "<SCPH>" + ClsSystem.gnvl(dgv1.Rows[j].Cells["cBatch"].Value, "") + "</SCPH> ";
                        xmlData = xmlData + "<SCRQ>" + Convert.ToDateTime(dgv1.Rows[j].Cells["dMDate"].Value).Year.ToString("0000") + Convert.ToDateTime(dgv1.Rows[j].Cells["dMDate"].Value).Month.ToString("00") + Convert.ToDateTime(dgv1.Rows[j].Cells["dMDate"].Value).Day.ToString("00") + "</SCRQ> ";
                        xmlData = xmlData + "<YXRQ>" + Convert.ToDateTime(dgv1.Rows[j].Cells["cExpirationdate"].Value).Year.ToString("0000") + Convert.ToDateTime(dgv1.Rows[j].Cells["cExpirationdate"].Value).Month.ToString("00") + Convert.ToDateTime(dgv1.Rows[j].Cells["cExpirationdate"].Value).Day.ToString("00") + "</YXRQ> ";
                        xmlData = xmlData + "<XSDDH>" + ClsSystem.gnvl(dgv1.Rows[j].Cells["iDLsID"].Value, "") + "</XSDDH> ";
                        xmlData = xmlData + "<WLPTDDH></WLPTDDH> ";
                        xmlData = xmlData + "<DDMXBH>" + ClsSystem.gnvl(dgv1.Rows[j].Cells["cDefine29"].Value, "") + "</DDMXBH> ";
                        xmlData = xmlData + "<PSL>" + ClsSystem.gnvl(Public.ChinaRound(Public.GetNum(dgv1.Rows[j].Cells["iNum"].Value), 2), "") + "</PSL> ";
                        xmlData = xmlData + "<CGJLDW>" + ClsSystem.gnvl(dgv1.Rows[j].Cells["cDefine30"].Value, "") + "</CGJLDW> ";

                        xmlData = xmlData + "</STRUCT>";

                        xmlData = xmlData + "</DETAIL>";
                        xmlData = xmlData + "</XMLDATA>";

                        string    iDLsID    = "";
                        string    CLJG      = "";
                        DataSet   ds        = new DataSet();
                        DataTable db        = new DataTable();
                        string    resultXml = SendMessage.SetMessage("YQ003", xmlData);

                        string result = SendMessage.ReadXMl(resultXml, "HEAD", "ZTCLJG");



                        if (result == "00000")
                        {
                            TextReader tdr = new StringReader(resultXml);
                            ds.ReadXml(tdr);
                            //result = "";
                            //result = SendMessage.ReadXMl(resultXml, "MAIN", "JLS");
                            //if (Public.GetNum(result) > 0)
                            //{
                            if (ds.Tables.Count >= 4)
                            {
                                db = ds.Tables[3];

                                for (int k = 0; k < db.Rows.Count; k++)
                                {
                                    // PSDH = ClsSystem.gnvl(db.Rows[j]["PSDH"], "");
                                    iDLsID = ClsSystem.gnvl(db.Rows[k]["XSDDH"], "");
                                    CLJG   = ClsSystem.gnvl(db.Rows[k]["CLJG"], "");
                                    sql    = " update SaleBillVouchs set cdefine25='" + CLJG + "',cDefine23 ='" + ClsSystem.gnvl(dgv1.Rows[j].Cells["zxlx"].Value, "") + "', cDefine34=" + ClsSystem.gnvl(dgv1.Rows[j].Cells["cdefine34"].Value, "") + " where iDLsID =" + iDLsID + "\n";
                                    dgv1.Rows[j].Cells["cdefine25"].Value = CLJG;
                                }
                                SqlAccess.ExecuteSql(sql, Program.ConnectionString);
                            }
                            else
                            {
                                dgv1.Rows[j].Cells["cdefine25"].Value = "错误:未返回明细";
                            }
                        }
                        else
                        {
                            TextReader tdr = new StringReader(resultXml);
                            ds.ReadXml(tdr);

                            if (ds.Tables.Count >= 4)
                            {
                                db = ds.Tables[3];
                            }
                            CLJG = ClsSystem.gnvl(db.Rows[0]["CLJG"], "");
                            string CLQKMS = ClsSystem.gnvl(db.Rows[0]["CLQKMS"], "");
                            dgv1.Rows[j].Cells["cdefine25"].Value = "错误编码:" + CLJG + "错误信息:" + CLQKMS;
                            MessageBox.Show("错误编码:" + CLJG + "错误信息:" + CLQKMS, "错误", MessageBoxButtons.OK, MessageBoxIcon.Error);
                            return;
                        }
                    }
                }
            }


            this.Cursor = Cursors.Default;
        }
Ejemplo n.º 11
0
        private void GetTable()
        {
            DataSet        dt          = new DataSet();
            SqlDataAdapter thisAdapter = null;
            string         sql         = "";

            try
            {
                dgv1.EndEdit();

                if (dgv1.Rows.Count > 0)
                {
                    dgv1.Rows.Clear();
                }

                this.Cursor = Cursors.WaitCursor;



                sql = @" selecta.cSBVCode, a.dDate ,a.ccusname ,
                        a.cDefine12,a.cDefine13,a.cDefine14,a.cDefine15,a.cDefine8, a.cMaker, a.cMemo ,a.SBVID,a.cdefine11,
                       
                     from SaleBillVouchZT  a   
                       where   ISNULL(a.cChecker,'')<>'' and   ISNULL(a.cdefine11 ,'')<>'' ";

                if (ClsSystem.gnvl(textBox1.Text, "") != "")
                {
                    sql = sql + " and a.cSBVCode >='" + ClsSystem.gnvl(textBox1.Text, "") + "'";
                }
                if (ClsSystem.gnvl(textBox2.Text, "") != "")
                {
                    sql = sql + " and a.cSBVCode <='" + ClsSystem.gnvl(textBox2.Text, "") + "'";
                }
                if (ClsSystem.gnvl(dt1.Value, "") != "")
                {
                    sql = sql + " and datediff(day,a.ddate,'" + ClsSystem.gnvl(dt1.Value.ToShortDateString(), "") + "')<=0 ";
                }
                if (ClsSystem.gnvl(dt2.Value, "") != "")
                {
                    sql = sql + " and datediff(day,a.ddate,'" + ClsSystem.gnvl(dt2.Value.ToShortDateString(), "") + "')>=0 ";
                }

                //if (checkbox1.Checked == true)
                //{
                //    sql = sql + " and a.bReturnFlag= 1 ";
                //}
                //else
                //{
                //    sql = sql + " and a.bReturnFlag= 0 ";
                //}
                if (checkBox2.Checked == true)
                {
                    sql = sql + " and isnull(b.cDefine24,'')<> ''";
                }
                else
                {
                    sql = sql + " and isnull(b.cDefine24,'')=''";
                }
                //sql = sql + "   group by a.DLID ,a.cdlCode  ,a.cSTCode , a.dDate ,a.bReturnFlag, a.cMemo ,a.cMaker, a.cDefine1,a.cDefine2,a.cDefine3,a.cDefine10,a.cDefine11,a.cDefine12,a.cDefine13";
                sql         = sql + "   order by a.dDate    ";
                thisAdapter = new SqlDataAdapter(sql, Program.ConnectionString);

                thisAdapter.Fill(dt);


                DataTable db = dt.Tables[0];
                if (db.Rows.Count > 0)
                {
                    for (int i = 0; i < db.Rows.Count; i++)
                    {
                        dgv1.Rows.Add();


                        dgv1.Rows[i].Cells["cCusName"].Value  = ClsSystem.gnvl(db.Rows[i]["cCusName"], "");
                        dgv1.Rows[i].Cells["cdefine14"].Value = ClsSystem.gnvl(db.Rows[i]["cdefine14"], "");

                        dgv1.Rows[i].Cells["dDate"].Value    = ClsSystem.gnvl(db.Rows[i]["dDate"], "");
                        dgv1.Rows[i].Cells["cSBVCode"].Value = ClsSystem.gnvl(db.Rows[i]["cSBVCode"], "");

                        dgv1.Rows[i].Cells["cMaker"].Value = ClsSystem.gnvl(db.Rows[i]["cMaker"], "");

                        dgv1.Rows[i].Cells["cMemo"].Value     = ClsSystem.gnvl(db.Rows[i]["cMemo"], "");
                        dgv1.Rows[i].Cells["cDefine11"].Value = ClsSystem.gnvl(db.Rows[i]["cDefine11"], "");
                        dgv1.Rows[i].Cells["sbvid"].Value     = ClsSystem.gnvl(db.Rows[i]["sbvid"], "");
                        //  dgv1.Rows[i].Cells["cFile"].Value = ClsSystem.gnvl(db.Rows[i]["cFile"], "");
                    }
                }
                //this.dgv1.DataSource = dt.Tables[0];
                this.button4.Text = "全选";
                this.Cursor       = Cursors.Default;
                //  this.textBox1.Text = "查询到 " + dt.Tables[0].Rows.Count.ToString() + " 条记录。";
            }
            catch (Exception ex)
            {
                MessageBox.Show(ex.Message.ToString(), "错误", MessageBoxButtons.OK, MessageBoxIcon.Error);
            }
        }
Ejemplo n.º 12
0
        private void btnexport_Click(object sender, EventArgs e)
        {
            try
            {
                string strSQL = "";
                string BWB    = "人民币";


                this.Cursor = Cursors.WaitCursor;
                U8Login.clsLogin u8Login = null;
                u8Login = APIinterface.GetU8Login();
                if (u8Login == null)
                {
                    MessageBox.Show("登陆错误:U8登陆失败,检查是否配置正确", "提示", MessageBoxButtons.OK);
                    return;
                }

                //cxdb.DefaultView.Sort = "JHDH ASC";
                //DataTable dt = cxdb.DefaultView.ToTable();
                string strMsg = "";
                string ddh    = "";
                string result = "";
                int    count  = 0;
                string YYBM   = "";
                string DDMXBH = "";
                string PSDBM  = "";
                string sql    = "";

                string    strrq  = "";
                string    strsj  = "";
                string    pdbm   = "";
                string    pdbm_O = "";
                string    DDTJRQ = "";
                DataTable dt     = new DataTable();
                dt = cxdb;


                if (dt.Rows.Count > 0)
                {
                    dt.Columns.Add("Uflag");
                    for (int i = 0; i < dt.Rows.Count; i++)
                    {
                        if (ClsSystem.gnvl(this.dgv2.Rows[i].Cells["check"].Value, "").ToUpper() == "TRUE")
                        {
                            YYBM   = ClsSystem.gnvl(dt.Rows[i]["YYBM"], "");
                            PSDBM  = ClsSystem.gnvl(dt.Rows[i]["PSDBM"], "");
                            DDMXBH = ClsSystem.gnvl(dt.Rows[i]["DDMXBH"], "");
                            sql    = @" select  count(autoid)   from SO_SODetails  sd  with(nolock) left join so_somain so with(nolock) on sd.id=so.id " +
                                     " where so.cdefine11='" + YYBM + "' and sd.cdefine32='" + PSDBM + "' and sd.cdefine29='" + DDMXBH + "'";
                            count = Convert.ToInt16(SqlAccess.ExecuteScalar(sql, Program.ConnectionString));
                            if (count < 1)
                            {
                                dt.Rows[i]["Uflag"] = "1";
                            }
                            strrq = ClsSystem.gnvl(Public.GetInfo("/", ClsSystem.gnvl(dt.Rows[i]["DDTJRQ"], ""), 1), "");
                            strsj = ClsSystem.gnvl(Public.GetInfo("/", ClsSystem.gnvl(dt.Rows[i]["DDTJRQ"], ""), 2), "");
                            dt.Rows[i]["DDTJRQ"] = strrq + strsj;
                        }
                    }

                    dt.DefaultView.Sort = "YYBM ASC,PSDBM ASC,DDTJRQ ASC";
                    DataTable db = dt.DefaultView.ToTable();

                    DataView rowfilter = new DataView(db);
                    rowfilter.RowFilter      = "Uflag= '1'";
                    rowfilter.RowStateFilter = DataViewRowState.CurrentRows;
                    DataTable dts = rowfilter.ToTable();

                    for (int j = 0; j < dts.Rows.Count; j++)
                    {
                        YYBM   = ClsSystem.gnvl(dts.Rows[j]["YYBM"], "");
                        PSDBM  = ClsSystem.gnvl(dts.Rows[j]["PSDBM"], "");
                        DDTJRQ = ClsSystem.gnvl(dts.Rows[j]["DDTJRQ"], "");
                        pdbm   = YYBM + "-" + PSDBM + "-" + DDTJRQ;
                        if (pdbm != pdbm_O)
                        {
                            strMsg = APIinterface.InSO(u8Login, BWB, dts, j);
                            if (strMsg.IndexOf("错误") > 0)
                            {
                                MessageBox.Show(strMsg, "提示", MessageBoxButtons.OK);
                                this.Cursor = Cursors.Default;
                                return;
                            }
                            else
                            {
                                ddh    = ClsSystem.gnvl(SqlAccess.ExecuteScalar("select csocode from SO_SOMain with(nolock) where ID =" + strMsg, Program.ConnectionString), "");
                                result = result + ddh + ",";
                            }
                        }
                        pdbm_O = YYBM + "-" + PSDBM + "-" + DDTJRQ;
                    }
                }

                this.Cursor = Cursors.Default;

                if (result != "")
                {
                    MessageBox.Show("生成销售订单成功:" + result, "提示", MessageBoxButtons.OK);
                    return;
                }
                else
                {
                    MessageBox.Show("无销售订单", "提示", MessageBoxButtons.OK);
                    return;
                }
            }
            catch (Exception ex)
            {
                MessageBox.Show("生成失败", "提示", MessageBoxButtons.OK);
                this.Cursor = Cursors.Default;
                return;
            }
        }
Ejemplo n.º 13
0
        private void button1_Click(object sender, EventArgs e)
        {
            string    xmlData   = "";
            string    resultXMl = "";
            string    sql       = "";
            string    SBVID     = "";
            string    SBVID_o   = "";
            string    yybm      = "";
            string    yybm_O    = "";
            string    PSDBM     = "";
            string    PSDBM_O   = "";
            int       y         = 0;
            int       count     = 0;
            DataTable dts       = null;

            this.Cursor = Cursors.WaitCursor;
            decimal hsje = 0;

            if (dgv1.Rows.Count > 0)
            {
                if (dgv1.Rows.Count > 0)
                {
                    xmlData = "";
                    xmlData = xmlData + @"<?xml version=""1.0""  encoding=""utf-8""?>";
                    xmlData = xmlData + "<XMLDATA>";
                    xmlData = xmlData + "<HEAD>";
                    xmlData = xmlData + "<IP>" + SendMessage.GetIP() + "</IP> ";
                    xmlData = xmlData + "<MAC>" + SendMessage.GetMAC() + "</MAC> ";
                    xmlData = xmlData + "<BZXX></BZXX> ";
                    xmlData = xmlData + "</HEAD> ";
                    xmlData = xmlData + "<MAIN>";
                    xmlData = xmlData + "<YQBM>ZDYC0001</YQBM> ";
                    xmlData = xmlData + "<YYBM>" + ClsSystem.gnvl(dgv1.Rows[count].Cells["cdefine11"].Value, "") + "</YYBM> ";
                    xmlData = xmlData + "<FPH>" + ClsSystem.gnvl(dgv1.Rows[count].Cells["cSBVCode"].Value, "") + "</FPH> ";

                    xmlData = xmlData + "<FPHSZJE>" + ClsSystem.gnvl(SqlAccess.ExecuteScalar(" select isnull(sum(iSum),0) from SaleBillVouchs where  sbvid=" + ClsSystem.gnvl(dgv1.Rows[count].Cells["sbvid"].Value, ""), Program.ConnectionString), "") + "</FPHSZJE> ";
                    xmlData = xmlData + "</MAIN>";

                    xmlData = xmlData + "</XMLDATA>";
                }
                DataSet   ds        = new DataSet();
                DataTable db        = null;
                string    iDLsID    = "";
                string    CLJG      = "";
                string    resultXml = SendMessage.SetMessage("YQ016", xmlData);
                string    result    = SendMessage.ReadXMl(resultXml, "HEAD", "ZTCLJG");
                if (result == "00000")
                {
                    sql = " update SaleBillVouch set cdefine9='" + result + "' where cSBVCode='" + ClsSystem.gnvl(dgv1.Rows[count].Cells["cSBVCode"].Value, "") + "'\n";
                }
                else
                {
                    //TextReader tdr = new StringReader(resultXml);
                    //ds.ReadXml(tdr);

                    //if (ds.Tables.Count >= 4)
                    //{
                    //    db = ds.Tables[2];
                    //}
                    //CLJG = ClsSystem.gnvl(db.Rows[0]["CLJG"], "");
                    //string CLQKMS = ClsSystem.gnvl(db.Rows[0]["CLQKMS"], "");
                    //    dgv1.Rows[i].Cells["cdefine24"].Value = "错误编码:" + CLJG + "错误信息:" + CLQKMS;

                    string CWXX = SendMessage.ReadXMl(resultXml, "HEAD", "CWXX");
                    MessageBox.Show("错误编码:" + result + "错误信息:" + CWXX, "错误", MessageBoxButtons.OK, MessageBoxIcon.Error);
                    return;
                    //MessageBox.Show("错误编码:" + ClsSystem.gnvl(ds.Tables[0].Rows[0]["ZTCLJG"], "") + "错误信息:" + ClsSystem.gnvl(ds.Tables[0].Rows[0]["CWXX"], ""), "错误", MessageBoxButtons.OK, MessageBoxIcon.Error);
                    //return;
                }
                SqlAccess.ExecuteSql(sql, Program.ConnectionString);

                this.Cursor = Cursors.Default;
            }
        }
Ejemplo n.º 14
0
        private void button6_Click(object sender, EventArgs e)
        {
            string xmlData = "";



            try
            {
                this.Cursor = Cursors.WaitCursor;



                if (dgv2.Rows.Count > 0)
                {
                    dgv2.Rows.Clear();
                }

                xmlData = "";
                xmlData = xmlData + @"<?xml version=""1.0""  encoding=""utf-8""?>";
                xmlData = xmlData + "<XMLDATA>";
                xmlData = xmlData + "<HEAD>";
                xmlData = xmlData + "<IP>" + SendMessage.GetIP() + "</IP> ";
                xmlData = xmlData + "<MAC>" + SendMessage.GetMAC() + "</MAC> ";
                xmlData = xmlData + "<BZXX></BZXX> ";
                xmlData = xmlData + "</HEAD> ";
                xmlData = xmlData + "<MAIN>";
                xmlData = xmlData + "<YYBM>" + textBox1.Text.Trim() + "</YYBM> ";
                xmlData = xmlData + "</MAIN>";
                xmlData = xmlData + "</XMLDATA>";
                //  DataSet ds = SendMessage.QuryData("YQ017", xmlData);
                DataSet ds        = new DataSet();
                string  resultXml = SendMessage.SetMessage("YQ017", xmlData);

                string result = SendMessage.ReadXMl(resultXml, "HEAD", "ZTCLJG");

                if (result == "00000")
                {
                    TextReader tdr = new StringReader(resultXml);
                    ds.ReadXml(tdr);
                }

                if (ds.Tables.Count > 3)
                {
                    DataTable db = ds.Tables[3];
                    cxdb = ds.Tables[3];

                    if (db.Rows.Count > 0)
                    {
                        for (int i = 0; i < db.Rows.Count; i++)
                        {
                            dgv2.Rows.Add();

                            dgv2.Rows[i].Cells["SFWJ"].Value = ClsSystem.gnvl(ds.Tables[1].Rows[0]["SFWJ"], "");
                            dgv2.Rows[i].Cells["JLS"].Value  = ClsSystem.gnvl(ds.Tables[1].Rows[0]["JLS"], "");

                            dgv2.Rows[i].Cells["PSDBM"].Value = ClsSystem.gnvl(db.Rows[i]["PSDBM"], "");
                            dgv2.Rows[i].Cells["PSDMC"].Value = ClsSystem.gnvl(db.Rows[i]["PSDMC"], "");
                            dgv2.Rows[i].Cells["PSDZ"].Value  = ClsSystem.gnvl(db.Rows[i]["PSDZ"], "");



                            dgv2.Rows[i].Cells["LXRXM"].Value = ClsSystem.gnvl(db.Rows[i]["LXRXM"], "");
                            dgv2.Rows[i].Cells["LXDH"].Value  = ClsSystem.gnvl(db.Rows[i]["LXDH"], "");
                            dgv2.Rows[i].Cells["YZBM"].Value  = ClsSystem.gnvl(db.Rows[i]["YZBM"], "");

                            dgv2.Rows[i].Cells["BZXX"].Value = ClsSystem.gnvl(db.Rows[i]["BZXX"], "");
                        }
                    }
                }
                else
                {
                    MessageBox.Show(ClsSystem.gnvl(ds.Tables[0].Rows[0]["CWXX"], ""), "错误", MessageBoxButtons.OK);
                }

                this.Cursor = Cursors.Default;
                //      MessageBox.Show("未上传的存货查询完成", "提示", MessageBoxButtons.OK);
            }
            catch (Exception ex)
            {
                this.Cursor = Cursors.Default;
                MessageBox.Show(ex.Message.ToString(), "错误", MessageBoxButtons.OK);
                return;
            }
        }
Ejemplo n.º 15
0
        private void button6_Click(object sender, EventArgs e)
        {
            string sql = "";

            try
            {
                dgv2.EndEdit();
                sql = BuildSqlSelect();

                this.Cursor = Cursors.WaitCursor;
                if (dgv2.Rows.Count > 0)
                {
                    dgv2.Rows.Clear();
                }
                DataSet ds = new DataSet();
                if (ClsSystem.gnvl(sql, "") != "")
                {
                    string resultXml = SendMessage.SetMessage("YQ010", sql);

                    string result = SendMessage.ReadXMl(resultXml, "HEAD", "ZTCLJG");

                    if (result == "00000")
                    {
                        TextReader tdr = new StringReader(resultXml);
                        ds.ReadXml(tdr);
                        result = "";
                        result = SendMessage.ReadXMl(resultXml, "MAIN", "JLS");
                        if (Public.GetNum(result) > 0)
                        {
                            DataTable db = ds.Tables[3];

                            //dt.DefaultView.Sort = "JHDH ASC";
                            //DataTable db  = dt.DefaultView.ToTable();
                            cxdb = db;


                            if (db.Rows.Count > 0)
                            {
                                for (int i = 0; i < db.Rows.Count; i++)
                                {
                                    dgv2.Rows.Add();

                                    dgv2.Rows[i].Cells["SFWJ"].Value   = ClsSystem.gnvl(ds.Tables[1].Rows[0]["SFWJ"], "");
                                    dgv2.Rows[i].Cells["JLS"].Value    = ClsSystem.gnvl(ds.Tables[1].Rows[0]["JLS"], "");
                                    dgv2.Rows[i].Cells["DDMXBH"].Value = ClsSystem.gnvl(db.Rows[i]["DDMXBH"], "");
                                    dgv2.Rows[i].Cells["JHDH"].Value   = ClsSystem.gnvl(db.Rows[i]["JHDH"], "");
                                    dgv2.Rows[i].Cells["YQBM"].Value   = ClsSystem.gnvl(db.Rows[i]["YQBM"], "");

                                    dgv2.Rows[i].Cells["YYBM"].Value  = ClsSystem.gnvl(db.Rows[i]["YYBM"], "");
                                    dgv2.Rows[i].Cells["YYMC"].Value  = ClsSystem.gnvl(SqlAccess.ExecuteScalar("select cus.cCusName from Customer_extradefine  ex join Customer cus on cus.cCusCode=ex.cCusCode where ex.ccdefine1='" + ClsSystem.gnvl(db.Rows[i]["YYBM"], "") + "'", Program.ConnectionString), "");
                                    dgv2.Rows[i].Cells["PSDBM"].Value = ClsSystem.gnvl(db.Rows[i]["PSDBM"], "");
                                    dgv2.Rows[i].Cells["PSDZ"].Value  = ClsSystem.gnvl(db.Rows[i]["PSDZ"], "");
                                    dgv2.Rows[i].Cells["CGLX"].Value  = ClsSystem.gnvl(SqlAccess.ExecuteScalar("select cgmc from ysxt_CGMS  with(nolock) where cgbm='" + ClsSystem.gnvl(db.Rows[i]["CGLX"], "") + "'", Program.ConnectionString), "");
                                    if (ClsSystem.gnvl(db.Rows[i]["DDLX"], "") == "1")
                                    {
                                        dgv2.Rows[i].Cells["DDLX"].Value = "医院自行订单";
                                    }
                                    else
                                    {
                                        dgv2.Rows[i].Cells["DDLX"].Value = "托管药库订单";
                                    }
                                    if (ClsSystem.gnvl(db.Rows[i]["SPLX"], "") == "1")
                                    {
                                        dgv2.Rows[i].Cells["SPLX"].Value = "药品类";
                                    }
                                    else if (ClsSystem.gnvl(db.Rows[i]["SPLX"], "") == "2")
                                    {
                                        dgv2.Rows[i].Cells["SPLX"].Value = "医用耗材器械类";
                                    }
                                    else
                                    {
                                        dgv2.Rows[i].Cells["SPLX"].Value = "其他";
                                    }
                                    dgv2.Rows[i].Cells["YPLX"].Value   = ClsSystem.gnvl(SqlAccess.ExecuteScalar("select ypjxmc from ysxt_Ypjx  with(nolock) where ypjxbm='" + ClsSystem.gnvl(db.Rows[i]["YPLX"], "") + "'", Program.ConnectionString), "");
                                    dgv2.Rows[i].Cells["ZXSPBM"].Value = ClsSystem.gnvl(db.Rows[i]["ZXSPBM"], "");
                                    dgv2.Rows[i].Cells["CPM"].Value    = ClsSystem.gnvl(db.Rows[i]["CPM"], "");
                                    dgv2.Rows[i].Cells["YPJX"].Value   = ClsSystem.gnvl(db.Rows[i]["YPJX"], "");

                                    dgv2.Rows[i].Cells["CFGG"].Value = ClsSystem.gnvl(db.Rows[i]["CFGG"], "");

                                    dgv2.Rows[i].Cells["YYDWMC"].Value = ClsSystem.gnvl(db.Rows[i]["YYDWMC"], "");
                                    dgv2.Rows[i].Cells["BZNHSL"].Value = ClsSystem.gnvl(db.Rows[i]["BZNHSL"], "");
                                    dgv2.Rows[i].Cells["SCQYMC"].Value = ClsSystem.gnvl(db.Rows[i]["SCQYMC"], "");
                                    dgv2.Rows[i].Cells["CGJLDW"].Value = ClsSystem.gnvl(db.Rows[i]["CGJLDW"], "");
                                    dgv2.Rows[i].Cells["CGSL"].Value   = ClsSystem.gnvl(db.Rows[i]["CGSL"], "");
                                    //  dgv2.Rows[i].Cells["DCPSBZ"].Value = ClsSystem.gnvl(db.Rows[i]["DCPSBZ"], "");
                                    if (ClsSystem.gnvl(db.Rows[i]["DDTJFS"], "") == "1")
                                    {
                                        dgv2.Rows[i].Cells["DDTJFS"].Value = "医院填报";
                                    }
                                    else
                                    {
                                        dgv2.Rows[i].Cells["DDTJFS"].Value = "药企代填";
                                    }
                                    dgv2.Rows[i].Cells["DDCLZT"].Value = ClsSystem.gnvl(SqlAccess.ExecuteScalar("select mc from ysxt_ddclzt  with(nolock) where bm='" + ClsSystem.gnvl(db.Rows[i]["DDCLZT"], "") + "'", Program.ConnectionString), "");

                                    dgv2.Rows[i].Cells["DDTJRQ"].Value = ClsSystem.gnvl(db.Rows[i]["DDTJRQ"], "");
                                    dgv2.Rows[i].Cells["BZSM"].Value   = ClsSystem.gnvl(db.Rows[i]["BZSM"], "");
                                }
                            }
                        }
                        else
                        {
                            MessageBox.Show("未查到订单记录", "错误", MessageBoxButtons.OK);
                            return;
                        }
                    }
                    else
                    {
                        MessageBox.Show("处理结果:" + result + ClsSystem.gnvl(ds.Tables[0].Rows[0]["CWXX"], ""), "错误", MessageBoxButtons.OK);
                        return;
                    }
                }


                this.Cursor = Cursors.Default;
                //      MessageBox.Show("未上传的存货查询完成", "提示", MessageBoxButtons.OK);
            }
            catch (Exception ex)
            {
                this.Cursor = Cursors.Default;
                MessageBox.Show(ex.Message.ToString(), "错误", MessageBoxButtons.OK);
                return;
            }
        }
Ejemplo n.º 16
0
        private void btnexport_Click(object sender, EventArgs e)
        {
            try
            {
                string strSQL   = "";
                string BWB      = "人民币";
                string JHDH     = "";
                string JHDH_old = "";

                this.Cursor = Cursors.WaitCursor;
                U8Login.clsLogin u8Login = null;
                u8Login = APIinterface.GetU8Login();
                if (u8Login == null)
                {
                    MessageBox.Show("登陆错误:U8登陆失败,检查是否配置正确", "提示", MessageBoxButtons.OK);
                    return;
                }
                cxdb.DefaultView.Sort = "JHDH ASC";
                DataTable dt     = cxdb.DefaultView.ToTable();
                string    strMsg = "";
                string    ddh    = "";
                string    result = "";
                int       count  = 0;
                string    YYBM   = "";
                string    pdbm   = "";
                string    pdbm_O = "";
                if (dt.Rows.Count > 0)
                {
                    for (int j = 0; j < dt.Rows.Count; j++)
                    {
                        count = 0;

                        //if (ClsSystem.gnvl(this.dgv2.Rows[j].Cells["check"].Value, "").ToUpper() == "TRUE")
                        //{
                        JHDH = ClsSystem.gnvl(dt.Rows[j]["JHDH"], "");
                        YYBM = ClsSystem.gnvl(dt.Rows[j]["YYBM"], "");
                        pdbm = YYBM + "-" + JHDH;
                        if (pdbm != pdbm_O)
                        {
                            count = Convert.ToInt16(SqlAccess.ExecuteScalar(" select count(ID)   from so_somain with(nolock) where    cdefine14  ='" + pdbm + "'", Program.ConnectionString));
                            if (count < 1)
                            {
                                strMsg = APIinterface.InSO(u8Login, BWB, dt, j);
                                if (strMsg.IndexOf("错误") > 0)
                                {
                                    MessageBox.Show(strMsg, "提示", MessageBoxButtons.OK);
                                    this.Cursor = Cursors.Default;
                                    return;
                                }
                                else
                                {
                                    ddh    = ClsSystem.gnvl(SqlAccess.ExecuteScalar("select csocode from SO_SOMain with(nolock) where ID =" + strMsg, Program.ConnectionString), "");
                                    result = result + ddh + ",";
                                }
                            }
                            //else
                            //{
                            //    MessageBox.Show("计划单号:" + JHDH + "已经生成销售订单", "提示", MessageBoxButtons.OK);
                            //    return;
                            //}
                        }
                        //  }
                        pdbm_O = YYBM + "-" + JHDH;
                    }
                }

                this.Cursor = Cursors.Default;

                if (result != "")
                {
                    MessageBox.Show("生成销售订单成功:" + result, "提示", MessageBoxButtons.OK);
                    return;
                }
                else
                {
                    MessageBox.Show("无销售订单成功", "提示", MessageBoxButtons.OK);
                    return;
                }
            }
            catch (Exception ex)
            {
                MessageBox.Show("生成失败", "提示", MessageBoxButtons.OK);
                this.Cursor = Cursors.Default;
                return;
            }
        }
Ejemplo n.º 17
0
        private void button6_Click(object sender, EventArgs e)
        {
            string sql = "";



            try
            {
                sql = @"select  inv.cinvcode,inv.cInvName,inv.cCurrencyName,inv.cEnglishName,ex.cidefine8,
                     inv.cInvStd,inv.cEnterprise ,ex.cidefine1,ex.cidefine2,inv.cFile ,ex.cidefine3,c.cComUnitName, ex.cidefine4
                   from Inventory inv join Inventory_extradefine ex on  inv.cinvcode=ex.cInvCode
                  join ComputationUnit c on c.cComunitCode=inv.cCAComUnitCode
                  where   isnull(inv.cInvDefine10,'')='' order by inv.cinvcode";


                this.Cursor = Cursors.WaitCursor;



                if (dgv2.Rows.Count > 0)
                {
                    dgv2.Rows.Clear();
                }


                DataTable db = SqlAccess.ExecuteSqlDataTable(sql, Program.ConnectionString);



                if (db.Rows.Count > 0)
                {
                    for (int i = 0; i < db.Rows.Count; i++)
                    {
                        dgv2.Rows.Add();

                        dgv2.Rows[i].Cells["cinvcode"].Value      = ClsSystem.gnvl(db.Rows[i]["cinvcode"], "");
                        dgv2.Rows[i].Cells["cInvName"].Value      = ClsSystem.gnvl(db.Rows[i]["cInvName"], "");
                        dgv2.Rows[i].Cells["cidefine1"].Value     = ClsSystem.gnvl(db.Rows[i]["cidefine1"], "");
                        dgv2.Rows[i].Cells["cCurrencyName"].Value = ClsSystem.gnvl(db.Rows[i]["cCurrencyName"], "");
                        dgv2.Rows[i].Cells["cEnglishName"].Value  = ClsSystem.gnvl(db.Rows[i]["cEnglishName"], "");

                        dgv2.Rows[i].Cells["cidefine8"].Value   = ClsSystem.gnvl(db.Rows[i]["cidefine8"], "");
                        dgv2.Rows[i].Cells["cInvStd"].Value     = ClsSystem.gnvl(db.Rows[i]["cInvStd"], "");
                        dgv2.Rows[i].Cells["cEnterprise"].Value = ClsSystem.gnvl(db.Rows[i]["cEnterprise"], "");
                        dgv2.Rows[i].Cells["cidefine2"].Value   = ClsSystem.gnvl(db.Rows[i]["cidefine2"], "");

                        dgv2.Rows[i].Cells["cFile"].Value        = ClsSystem.gnvl(db.Rows[i]["cFile"], "");
                        dgv2.Rows[i].Cells["cidefine3"].Value    = ClsSystem.gnvl(db.Rows[i]["cidefine3"], "");
                        dgv2.Rows[i].Cells["cComUnitName"].Value = ClsSystem.gnvl(db.Rows[i]["cComUnitName"], "");
                        dgv2.Rows[i].Cells["cidefine4"].Value    = ClsSystem.gnvl(db.Rows[i]["cidefine4"], "");
                    }
                }

                this.Cursor = Cursors.Default;
                //      MessageBox.Show("未上传的存货查询完成", "提示", MessageBoxButtons.OK);
            }
            catch (Exception ex)
            {
                this.Cursor = Cursors.Default;
                MessageBox.Show(ex.Message.ToString(), "错误", MessageBoxButtons.OK);
                throw;
            }
        }
Ejemplo n.º 18
0
        private void button6_Click(object sender, EventArgs e)
        {
            string xmlData = "";

            try
            {
                this.Cursor = Cursors.WaitCursor;

                if (dgv2.Rows.Count > 0)
                {
                    dgv2.Rows.Clear();
                }

                xmlData = "";
                xmlData = xmlData + @"<?xml version=""1.0""  encoding=""utf-8""?>";
                xmlData = xmlData + "<XMLDATA>";
                xmlData = xmlData + "<HEAD>";
                xmlData = xmlData + "<IP>" + SendMessage.GetIP() + "</IP> ";
                xmlData = xmlData + "<MAC>" + SendMessage.GetMAC() + "</MAC> ";
                xmlData = xmlData + "<BZXX></BZXX> ";
                xmlData = xmlData + "</HEAD> ";
                xmlData = xmlData + "<MAIN>";
                xmlData = xmlData + "<FBRQ></FBRQ> ";
                xmlData = xmlData + "<YPTBDM>" + textBox1.Text.Trim() + "</YPTBDM> ";
                xmlData = xmlData + "</MAIN>";
                xmlData = xmlData + "</XMLDATA>";
                DataSet ds = SendMessage.QuryData("YQ018", xmlData);

                if (ds != null && ClsSystem.gnvl(ds.Tables[0].Rows[0]["ZTCLJG"], "") == "00000")
                {
                    DataTable db = ds.Tables[3];
                    cxdb = ds.Tables[3];

                    if (db.Rows.Count > 0)
                    {
                        for (int i = 0; i < db.Rows.Count; i++)
                        {
                            dgv2.Rows.Add();

                            dgv2.Rows[i].Cells["SFWJ"].Value = ClsSystem.gnvl(ds.Tables[1].Rows[0]["SFWJ"], "");
                            dgv2.Rows[i].Cells["JLS"].Value  = ClsSystem.gnvl(ds.Tables[1].Rows[0]["JLS"], "");

                            dgv2.Rows[i].Cells["YPTBDM"].Value = ClsSystem.gnvl(db.Rows[i]["YPTBDM"], "");
                            dgv2.Rows[i].Cells["PZWH"].Value   = ClsSystem.gnvl(db.Rows[i]["PZWH"], "");
                            dgv2.Rows[i].Cells["BWM"].Value    = ClsSystem.gnvl(db.Rows[i]["BWM"], "");
                            dgv2.Rows[i].Cells["YPTYM"].Value  = ClsSystem.gnvl(db.Rows[i]["YPTYM"], "");
                            dgv2.Rows[i].Cells["JX"].Value     = ClsSystem.gnvl(db.Rows[i]["JX"], "");
                            dgv2.Rows[i].Cells["GG"].Value     = ClsSystem.gnvl(db.Rows[i]["GG"], "");


                            dgv2.Rows[i].Cells["SCQY"].Value = ClsSystem.gnvl(db.Rows[i]["SCQY"], "");
                            dgv2.Rows[i].Cells["SPM"].Value  = ClsSystem.gnvl(db.Rows[i]["SPM"], "");
                            dgv2.Rows[i].Cells["BZSL"].Value = ClsSystem.gnvl(db.Rows[i]["BZSL"], "");

                            dgv2.Rows[i].Cells["BZCZ"].Value     = ClsSystem.gnvl(db.Rows[i]["BZCZ"], "");
                            dgv2.Rows[i].Cells["BZFS"].Value     = ClsSystem.gnvl(db.Rows[i]["BZFS"], "");
                            dgv2.Rows[i].Cells["GGBZWZBS"].Value = ClsSystem.gnvl(db.Rows[i]["GGBZWZBS"], "");
                            dgv2.Rows[i].Cells["JCXXQYRQ"].Value = ClsSystem.gnvl(db.Rows[i]["JCXXQYRQ"], "");
                            dgv2.Rows[i].Cells["JJDW"].Value     = ClsSystem.gnvl(db.Rows[i]["JJDW"], "");
                            dgv2.Rows[i].Cells["JHJGGZDM"].Value = ClsSystem.gnvl(db.Rows[i]["JHJGGZDM"], "");

                            dgv2.Rows[i].Cells["JHGZJGJE"].Value = ClsSystem.gnvl(db.Rows[i]["JHGZJGJE"], "");
                            dgv2.Rows[i].Cells["XSJGGZDM"].Value = ClsSystem.gnvl(db.Rows[i]["XSJGGZDM"], "");
                            dgv2.Rows[i].Cells["XSGZJGJE"].Value = ClsSystem.gnvl(db.Rows[i]["XSGZJGJE"], "");
                            dgv2.Rows[i].Cells["WJGZQYRQ"].Value = ClsSystem.gnvl(db.Rows[i]["WJGZQYRQ"], "");
                            dgv2.Rows[i].Cells["CGFS"].Value     = ClsSystem.gnvl(db.Rows[i]["CGFS"], "");
                            dgv2.Rows[i].Cells["CGZT"].Value     = ClsSystem.gnvl(db.Rows[i]["CGZT"], "");
                            dgv2.Rows[i].Cells["GZYJ"].Value     = ClsSystem.gnvl(db.Rows[i]["GZYJ"], "");

                            dgv2.Rows[i].Cells["YSGZQYRQ"].Value = ClsSystem.gnvl(db.Rows[i]["YSGZQYRQ"], "");
                            dgv2.Rows[i].Cells["ZSFBRQ"].Value   = ClsSystem.gnvl(db.Rows[i]["ZSFBRQ"], "");
                        }
                    }
                }
                else
                {
                    MessageBox.Show(ClsSystem.gnvl(ds.Tables[0].Rows[0]["CWXX"], ""), "错误", MessageBoxButtons.OK);
                }

                this.Cursor = Cursors.Default;
                //      MessageBox.Show("未上传的存货查询完成", "提示", MessageBoxButtons.OK);
            }
            catch (Exception ex)
            {
                this.Cursor = Cursors.Default;
                MessageBox.Show(ex.Message.ToString(), "错误", MessageBoxButtons.OK);
                return;
            }
        }
Ejemplo n.º 19
0
        private void button6_Click(object sender, EventArgs e)
        {
            string sql = "";



            try
            {
//                sql = @"select  inv.cinvcode,inv.cInvName,inv.cCurrencyName,inv.cEnglishName,ex.cidefine8,
//                     inv.cInvStd,inv.cEnterprise ,ex.cidefine1,ex.cidefine2,inv.cFile ,ex.cidefine3,c.cComUnitName, ex.cidefine4
//                   from Inventory inv join Inventory_extradefine ex on  inv.cinvcode=ex.cInvCode
//                  join ComputationUnit c on c.cComunitCode=inv.cCAComUnitCode
//                  where   isnull(inv.cInvDefine10,'')='' order by inv.cinvcode";
                sql = @"select top 100 inv.cinvcode ,inv.cinvname, iex.cidefine1,com.cComUnitName , sum( case when isnull(bgspstop,0) =1 or isnull(bstopflag,0) =1 then 0 else ISNULL(iQuantity,0)-isnull(fStopQuantity,0) - ISNULL(fOutQuantity,0) end) AS fAvailQtty   
                    from CurrentStock csk  join inventory inv on inv.cinvcode=csk.cinvcode
left join Inventory_extradefine  iex on iex.cinvcode=inv.cinvcode
left join ComputationUnit com on com.cComUnitCode=inv.cComUnitCode
where isnull(iex.cidefine1,'')<>''
 group by inv.cinvcode ,inv.cinvname,iex.cidefine1 ,com.cComUnitName 
having  sum( case when isnull(bgspstop,0) =1 or isnull(bstopflag,0) =1 then 0 else ISNULL(iQuantity,0)-isnull(fStopQuantity,0) - ISNULL(fOutQuantity,0) end) <>0 ";

                this.Cursor = Cursors.WaitCursor;



                if (dgv2.Rows.Count > 0)
                {
                    dgv2.Rows.Clear();
                }


                DataTable db = SqlAccess.ExecuteSqlDataTable(sql, Program.ConnectionString);



                if (db.Rows.Count > 0)
                {
                    for (int i = 0; i < db.Rows.Count; i++)
                    {
                        dgv2.Rows.Add();

                        dgv2.Rows[i].Cells["cinvcode"].Value = ClsSystem.gnvl(db.Rows[i]["cinvcode"], "");
                        dgv2.Rows[i].Cells["cInvName"].Value = ClsSystem.gnvl(db.Rows[i]["cInvName"], "");
                        dgv2.Rows[i].Cells["ZXSPBM"].Value   = ClsSystem.gnvl(db.Rows[i]["cidefine1"], "");
                        dgv2.Rows[i].Cells["SPLX"].Value     = "药品";
                        dgv2.Rows[i].Cells["KCSL"].Value     = ClsSystem.gnvl(db.Rows[i]["fAvailQtty"], "");

                        dgv2.Rows[i].Cells["KCDW"].Value = ClsSystem.gnvl(db.Rows[i]["cComUnitName"], "");
                    }
                }

                this.Cursor = Cursors.Default;
                //      MessageBox.Show("未上传的存货查询完成", "提示", MessageBoxButtons.OK);
            }
            catch (Exception ex)
            {
                this.Cursor = Cursors.Default;
                MessageBox.Show(ex.Message.ToString(), "错误", MessageBoxButtons.OK);
                return;
            }
        }
Ejemplo n.º 20
0
        public static DataTable CheckDataTable(DataTable dt, string tableName, string cHeadKey, string cFlag)
        {
            //  WriteLog.writeLog("校验开始" + DateTime.Now + "tableName" + tableName);
            dt.Columns.Add("Flag");//标识
            // string cValue = "";
            DataTable dtcompare = null;
            Hashtable htCompare = new Hashtable();
            string    cBodyKey  = "";

            try
            {
                dtcompare = SqlAccess.ExecuteSqlDataTable(" select distinct cdefine28 from " + tableName + "  with(nolock) where cdefine28 like'" + cHeadKey + "%'", ufconnstr_111);

                if (dtcompare != null && dtcompare.Rows.Count > 0)
                {
                    foreach (DataRow dr in dtcompare.Rows)
                    {
                        htCompare.Add(dr[0].ToString(), "");
                    }
                }
                else
                {
                    for (int i = 0; i < dt.Rows.Count; i++)
                    {
                        dt.Rows[i]["Flag"] = "0";
                    }
                    return(dt);
                }

                for (int i = 0; i < dt.Rows.Count; i++)
                {
                    //判断
                    cBodyKey = ClsSystem.gnvl(dt.Rows[i]["SERIALKEY"], "");

                    if (htCompare.ContainsKey(cHeadKey + dt.Rows[i]["SERIALKEY"]))
                    {
                        dt.Rows[i]["Flag"] = "1";
                        //  dt.Rows[i]["cFlag"] = "1";
                    }
                    else
                    {
                        dt.Rows[i]["Flag"] = "0";
                    }
                }

                DataView rowfilter1 = new DataView(dt);
                rowfilter1.RowFilter      = "Flag = '" + cFlag + "'";
                rowfilter1.RowStateFilter = DataViewRowState.CurrentRows;
                DataTable dts = rowfilter1.ToTable();

                return(dts);
            }
            catch (Exception ex)
            {
                MessageBox.Show("具体原因是:\n" + ex.Message.ToString(), "错误", MessageBoxButtons.OK, MessageBoxIcon.Error);
                return(dt);
            }
            finally
            {
                //  WriteLog.writeLog("校验结束" + DateTime.Now + "tableName" + tableName);
            }


            // dt.Columns.Add("Flag");//标识


            //// string cValue = "";
            // DataTable dt = null;
            // string cBodyKey = "";
            // try
            // {
            //     dt = new DataTable();
            //     for (int i = 0; i < dt.Rows.Count; i++)
            //     {
            //         //判断
            //         if (i == 0)
            //         {

            //         }
            //         cBodyKey = ClsSystem.gnvl(dt.Rows[i]["SERIALKEY"], "");
            //         cValue = ClsSystem.gnvl(SqlAccess.ExecuteScalar(" select cdefine28 from " + tableName + "  with(nolock) where cdefine28='" + cHeadKey + cBodyKey + "'", ufconnstr_111), "");
            //        // dt = ClsSystem.gnvl(SqlAccess.ExecuteSqlDataTable(" select cdefine28 from " + tableName + "  with(nolock) where cdefine28 like'" + cHeadKey + "%'", ufconnstr_111), "");

            //         if (cValue != "")
            //         {
            //             dt.Rows[i]["Flag"] = "1";
            //             //  dt.Rows[i]["cFlag"] = "1";

            //         }
            //         else
            //         {
            //             dt.Rows[i]["Flag"] = "0";
            //         }
            //     }

            //     DataView rowfilter1 = new DataView(dt);
            //     rowfilter1.RowFilter = "Flag = '" + cFlag + "'";
            //     rowfilter1.RowStateFilter = DataViewRowState.CurrentRows;
            //     DataTable dts = rowfilter1.ToTable();

            //     return dts;
            // }
            // catch (Exception ex)
            // {
            //     MessageBox.Show("具体原因是:\n" + ex.Message.ToString(), "错误", MessageBoxButtons.OK, MessageBoxIcon.Error);
            //     return dt;
            // }
            // finally
            // {

            // }
        }
Ejemplo n.º 21
0
        private void button1_Click(object sender, EventArgs e)
        {
            string    xmlData   = "";
            string    resultXMl = "";
            string    sql       = "";
            string    sbvid     = "";
            string    yybm      = "";
            string    yybm_O    = "";
            int       y         = 0;
            DataTable dts       = null;

            this.Cursor = Cursors.WaitCursor;
            if (dgv1.Rows.Count > 0)
            {
                for (int i = 0; i < dgv1.Rows.Count; i++)
                {
                    if (ClsSystem.gnvl(this.dgv1.Rows[i].Cells["check"].Value, "").ToUpper() == "TRUE")
                    {
                        if (ClsSystem.gnvl(dgv1.Rows[i].Cells["cmemo"].Value, "") == "")
                        {
                            MessageBox.Show("终止原因未填入", "错误", MessageBoxButtons.OK, MessageBoxIcon.Error);
                            return;
                        }
                        if (ClsSystem.gnvl(dgv1.Rows[i].Cells["cDefine29"].Value, "") == "")
                        {
                            MessageBox.Show("订单明细编号未填入", "错误", MessageBoxButtons.OK, MessageBoxIcon.Error);
                            return;
                        }
                        yybm_O = yybm;
                        y++;
                    }
                }

                for (int i = 0; i < dgv1.Rows.Count; i++)
                {
                    if (ClsSystem.gnvl(this.dgv1.Rows[i].Cells["check"].Value, "").ToUpper() == "TRUE")
                    {
                        sbvid = ClsSystem.gnvl(this.dgv1.Rows[i].Cells["sbvid"].Value, "");


                        xmlData = "";
                        xmlData = xmlData + @"<?xml version=""1.0""  encoding=""utf-8""?>";
                        xmlData = xmlData + "<XMLDATA>";
                        xmlData = xmlData + "<HEAD>";
                        xmlData = xmlData + "<IP>" + SendMessage.GetIP() + "</IP> ";
                        xmlData = xmlData + "<MAC>" + SendMessage.GetMAC() + "</MAC> ";
                        xmlData = xmlData + "<BZXX></BZXX> ";
                        xmlData = xmlData + "</HEAD> ";
                        xmlData = xmlData + "<MAIN>";

                        xmlData = xmlData + "<DDMXBH>" + ClsSystem.gnvl(dgv1.Rows[i].Cells["cDefine29"].Value, "") + "</DDMXBH> ";

                        xmlData = xmlData + "<ZZYY>" + ClsSystem.gnvl(dgv1.Rows[i].Cells["cmemo"].Value, "") + "</ZZYY> ";

                        xmlData = xmlData + "</MAIN>";

                        xmlData = xmlData + "</XMLDATA>";

                        string resultXml = SendMessage.SetMessage("YQ013", xmlData);
                        string result    = SendMessage.ReadXMl(resultXml, "HEAD", "ZTCLJG");

                        if (result == "00000")
                        {
                            dgv1.Rows[i].Cells["result"].Value = result;
                        }
                        else
                        {
                            MessageBox.Show("错误编码:" + result + "错误信息:" + SendMessage.ReadXMl(resultXml, "HEAD", "CWXX"), "错误", MessageBoxButtons.OK, MessageBoxIcon.Error);
                            return;
                        }
                    }
                }
            }



            this.Cursor = Cursors.Default;
        }
Ejemplo n.º 22
0
        private void GetTable()
        {
            DataSet        dt          = new DataSet();
            SqlDataAdapter thisAdapter = null;
            string         sql         = "";

            try
            {
                dgv1.EndEdit();

                DataTable db = (DataTable)dgv1.DataSource;

                if (db != null)
                {
                    db.Rows.Clear();
                }
                dgv1.DataSource = db;


                sql = @" select a.cSBVCode  , a.dDate ,a.bReturnFlag,a.ccusname ,
                        a.cDefine14,a.cMaker ,a.cdefine11,
                        b.cinvcode,b.cinvname,b.cDefine29,b.cBatch,b.cmemo ,  b.cdefine25,b.iDLsID,b.cDefine32,b.cDefine33,'ZD1' +Convert(char(10),b.iDLsID) as PSDTM,a.sbvid
                     from  SaleBillVouchZT  a   join SaleBillVouchZW b on a.sbvid=b.sbvid  where 
                       ISNULL(a.cChecker,'')<>''";

                if (ClsSystem.gnvl(textBox1.Text, "") != "")
                {
                    sql = sql + " and a.cSBVCode>='" + ClsSystem.gnvl(textBox1.Text, "") + "'";
                }
                if (ClsSystem.gnvl(textBox2.Text, "") != "")
                {
                    sql = sql + " and a.cSBVCode<='" + ClsSystem.gnvl(textBox2.Text, "") + "'";
                }
                if (ClsSystem.gnvl(dt1.Value, "") != "")
                {
                    sql = sql + " and datediff(day,a.ddate,'" + ClsSystem.gnvl(dt1.Value.ToShortDateString(), "") + "')<=0 ";
                }
                if (ClsSystem.gnvl(dt2.Value, "") != "")
                {
                    sql = sql + " and datediff(day,a.ddate,'" + ClsSystem.gnvl(dt2.Value.ToShortDateString(), "") + "')>=0 ";
                }

                if (checkbox1.Checked == true)
                {
                    sql = sql + " and a.bReturnFlag= 1 ";
                }
                else
                {
                    sql = sql + " and a.bReturnFlag= 0 ";
                }
                if (checkBox2.Checked == true)
                {
                    sql = sql + " and isnull(b.cdefine25,'')<> ''";
                }
                else
                {
                    sql = sql + " and isnull(b.cdefine25,'')=''";
                }
                //sql = sql + "   group by a.DLID ,a.cdlCode  ,a.cSTCode , a.dDate ,a.bReturnFlag, a.cMemo ,a.cMaker, a.cDefine1,a.cDefine2,a.cDefine3,a.cDefine10,a.cDefine11,a.cDefine12,a.cDefine13";
                sql         = sql + "   order by a.dDate    ";
                thisAdapter = new SqlDataAdapter(sql, Program.ConnectionString);

                thisAdapter.Fill(dt);

                this.dgv1.DataSource = dt.Tables[0];
                this.button4.Text    = "全选";
                //  this.textBox1.Text = "查询到 " + dt.Tables[0].Rows.Count.ToString() + " 条记录。";
            }
            catch (Exception ex)
            {
                MessageBox.Show(ex.Message.ToString(), "错误", MessageBoxButtons.OK, MessageBoxIcon.Error);
            }
        }
Ejemplo n.º 23
0
        private void button4_Click(object sender, EventArgs e)
        {
            string    xmlData   = "";
            string    resultXMl = "";
            string    sql       = "";
            string    SBVID     = "";
            string    SBVID_o   = "";
            string    yybm      = "";
            string    yybm_O    = "";
            string    PSDBM     = "";
            string    PSDBM_O   = "";
            int       y         = 0;
            int       count     = 0;
            DataTable dts       = null;

            this.Cursor = Cursors.WaitCursor;
            decimal hsje = 0;

            if (ClsSystem.gnvl(comboBox1.Text, "") == "")
            {
                MessageBox.Show("医院没有选择", "错误", MessageBoxButtons.OK, MessageBoxIcon.Error);
                comboBox1.Focus();
                return;
            }
            if (ClsSystem.gnvl(comboBox4.Text, "") == "")
            {
                MessageBox.Show("订单类型", "错误", MessageBoxButtons.OK, MessageBoxIcon.Error);
                comboBox4.Focus();
                return;
            }
            if (ClsSystem.gnvl(comboBox5.Text, "") == "")
            {
                MessageBox.Show("配送点编码", "错误", MessageBoxButtons.OK, MessageBoxIcon.Error);
                comboBox5.Focus();
                return;
            }
            if (dgv2.Rows.Count < 1)
            {
                MessageBox.Show("表体无数据", "错误", MessageBoxButtons.OK, MessageBoxIcon.Error);

                return;
            }

            if (dgv2.Rows.Count > 0)
            {
                for (int i = 0; i < dgv2.Rows.Count; i++)
                {
                    if (!dgv2.Rows[i].IsNewRow)
                    {
                        count++;
                    }
                }
                xmlData = "";
                xmlData = xmlData + @"<?xml version=""1.0""  encoding=""utf-8""?>";
                xmlData = xmlData + "<XMLDATA>";
                xmlData = xmlData + "<HEAD>";
                xmlData = xmlData + "<IP>" + SendMessage.GetIP() + "</IP> ";
                xmlData = xmlData + "<MAC>" + SendMessage.GetMAC() + "</MAC> ";
                xmlData = xmlData + "<BZXX></BZXX> ";
                xmlData = xmlData + "</HEAD> ";
                xmlData = xmlData + "<MAIN>";
                xmlData = xmlData + "<CZLX>1</CZLX> ";

                //xmlData = xmlData + "<YQBM>ZDYC0001</YQBM> ";
                xmlData = xmlData + "<YYBM>" + ClsSystem.gnvl(comboBox1.SelectedValue.ToString(), "") + "</YYBM> ";
                xmlData = xmlData + "<PSDBM>" + ClsSystem.gnvl(comboBox5.SelectedValue.ToString(), "") + "</PSDBM> ";
                xmlData = xmlData + "<DDLX>" + ClsSystem.gnvl((comboBox4.SelectedIndex + 1).ToString(), "") + "</DDLX> ";
                xmlData = xmlData + "<DDBH></DDBH> ";
                xmlData = xmlData + "<YYJHDH></YYJHDH> ";

                xmlData = xmlData + "<ZWDHRQ>" + Convert.ToDateTime(dateTimePicker1.Value).Year.ToString("0000") +
                          Convert.ToDateTime(dateTimePicker1.Value).Month.ToString("00") +
                          Convert.ToDateTime(dateTimePicker1.Value).Day.ToString("00") +

                          "</ZWDHRQ> ";
                xmlData = xmlData + "<JLS>" + count.ToString() + "</JLS> ";
                xmlData = xmlData + "</MAIN>";
                xmlData = xmlData + "<DETAIL>";

                for (int i = 0; i < dgv2.Rows.Count; i++)
                {
                    if (dgv2.Rows[i].IsNewRow)
                    {
                        continue;
                    }
                    //SBVID = ClsSystem.gnvl(this.dgv2.Rows[i].Cells["SBVID"].Value, "");

                    //   dts = SqlAccess.ExecuteSqlDataTable(sql, Program.ConnectionString);

                    xmlData = xmlData + "<STRUCT>";

                    xmlData = xmlData + "<SXH>" + ClsSystem.gnvl(this.dgv2.Rows[i].Cells["xh"].Value, "") + "</SXH> ";


                    //   xmlData = xmlData + "<CGLX>" + Convert.ToDateTime(dgv2.Rows[i].Cells["dDate"].Value).Year.ToString("0000") + Convert.ToDateTime(dgv2.Rows[i].Cells["dDate"].Value).Month.ToString("00") + Convert.ToDateTime(dgv2.Rows[i].Cells["dDate"].Value).Day.ToString("00") + "</CGLX> ";
                    xmlData = xmlData + "<CGLX>" + ClsSystem.gnvl(dgv2.Rows[i].Cells["CGLX"].Value, "0") + "</CGLX>";

                    xmlData = xmlData + "<SPLX>" + ClsSystem.gnvl(this.dgv2.Rows[i].Cells["SPLX"].Value, "") + "</SPLX> ";
                    xmlData = xmlData + "<ZXSPBM>" + ClsSystem.gnvl(dgv2.Rows[i].Cells["ZXSPBM"].Value, "") + "</ZXSPBM> ";

                    xmlData = xmlData + "<CGJLDW>" + ClsSystem.gnvl(dgv2.Rows[i].Cells["CGJLDW"].Value, "") + "</CGJLDW> ";

                    xmlData = xmlData + "<CGSL>" + ClsSystem.gnvl(dgv2.Rows[i].Cells["CGSL"].Value, "") + "</CGSL> ";

                    xmlData = xmlData + "<CGDJ>" + ClsSystem.gnvl(dgv2.Rows[i].Cells["CGDJ"].Value, "") + "</CGDJ> ";
                    xmlData = xmlData + "<YQBM>" + ClsSystem.gnvl(dgv2.Rows[i].Cells["YQBM"].Value, "") + "</YQBM> ";
                    //多次配送标识
                    xmlData = xmlData + "<DCPSBS>" + ClsSystem.gnvl(dgv2.Rows[i].Cells["DCPSBS"].Value, "") + "</DCPSBS> ";

                    xmlData = xmlData + "<BZSM>" + ClsSystem.gnvl(dgv2.Rows[i].Cells["BZSM"].Value, "") + "</BZSM> ";

                    xmlData = xmlData + "</STRUCT>";
                }
                xmlData = xmlData + "</DETAIL>";
                xmlData = xmlData + "</XMLDATA>";

                DataSet   ds        = new DataSet();
                DataTable db        = null;
                string    DDBH      = "";
                string    DDMXBH    = "";
                string    resultXml = SendMessage.SetMessage("YQ005", xmlData);
                string    result    = SendMessage.ReadXMl(resultXml, "HEAD", "ZTCLJG");
                if (result == "00000")
                {
                    DDBH          = SendMessage.ReadXMl(resultXml, "MAIN", "DDBH");
                    textBox1.Text = DDBH;
                    TextReader tdr = new StringReader(resultXml);
                    ds.ReadXml(tdr);
                    if (ds.Tables.Count >= 3)
                    {
                        db = ds.Tables[3];
                        for (int j = 0; j < db.Rows.Count; j++)
                        {
                            DDMXBH = ClsSystem.gnvl(db.Rows[j]["DDMXBH"], "");
                            //  CLJG = ClsSystem.gnvl(db.Rows[j]["CLJG"], "");
                            dgv2.Rows[j].Cells["DDMXBH"].Value = DDMXBH;
                        }
                    }
                }
                else
                {
                    string CWXX = SendMessage.ReadXMl(resultXml, "HEAD", "CWXX");
                    MessageBox.Show("错误编码:" + result + "错误信息:" + CWXX, "错误", MessageBoxButtons.OK, MessageBoxIcon.Error);
                    return;
                    //MessageBox.Show("错误编码:" + ClsSystem.gnvl(ds.Tables[0].Rows[0]["ZTCLJG"], "") + "错误信息:" + ClsSystem.gnvl(ds.Tables[0].Rows[0]["CWXX"], ""), "错误", MessageBoxButtons.OK, MessageBoxIcon.Error);
                    //return;
                }

                this.Cursor = Cursors.Default;
            }
        }
Ejemplo n.º 24
0
        private void QuerySaleBillVouch(DataTable db)
        {
            Dictionary <string, string> csocodes = new Dictionary <string, string>();
            List <DataTable>            tables   = new List <DataTable>();

            //销售订单的备注为原始销售订单号
            for (int i = 0; i < db.Rows.Count; ++i)
            {
                //销售发票号
                string sbvcode = ClsSystem.gnvl(db.Rows[i]["cSBVCode"], "");

                string csocode = "";
                if (checkBoxQuery.Checked)
                {
                    //原始销售订单号
                    csocode = DBHelper.FindOther("csocode",
                                                 "SaleBillVouchZT", "cSBVCode = '" + sbvcode + "'", Program.ConnectionString);
                }
                else
                {
                    //发货退货单号
                    csocode = DBHelper.FindOther("cDLCode",
                                                 "SaleBillVouchZT", "cSBVCode = '" + sbvcode + "'", Program.ConnectionString);
                }

                if (csocodes.ContainsKey(sbvcode))
                {
                    continue;
                }
                else
                {
                    csocodes.Add(sbvcode, csocode);
                }
                string sql = @" select a.cdefine9,a.cdefine10 ,a.cSBVCode, a.dDate ,a.cSTCode ,a.bReturnFlag,a.ccusname ,
                        a.cDefine12,a.cDefine13,a.cDefine14,a.cDefine15,a.cDefine8, a.cMaker, a.cMemo ,a.SBVID,a.cdefine11,
                          b.cinvcode,b.cinvname,b.cDefine28,b.iQuantity,b.cInvDefine5,b.cDefine29,b.cDefine30,b.cBatch ,
                           b.cSoCode ,inv.cFile ,b.dMDate ,b.cExpirationdate ,b.iUnitPrice ,b.iTaxUnitPrice ,b.iTaxRate ,
                           b.iTax ,b.iMoney ,b.iSum ,       b.iQuotedPrice,   inv.fRetailPrice,b.idlsid ,
                         b.cdefine24,b.cdefine25,b.iDLsID,b.cDefine32,b.cDefine33,a.sbvid,inv.cFile,b.iNum,b.iInvExchRate 
                     from SaleBillVouchZT  a   join SaleBillVouchZW b on a.sbvid=b.sbvid 
                          left join inventory inv  on inv.cinvcode=b.cinvcode
                       where a.cmemo like '" + csocode + "'";
                sql = sql + " and a.bReturnFlag= 0 ";
                if (checkBox2.Checked == true) //是否传递
                {
                    sql = sql + " and isnull(b.cDefine24,'')<>''";
                }
                else
                {
                    sql = sql + " and isnull(b.cDefine24,'')=''";
                }

                sql = sql + "   order by a.dDate    ";

                DataSet        dt          = new DataSet();
                SqlDataAdapter thisAdapter = new SqlDataAdapter(sql, Program.ConnectionString);
                thisAdapter.Fill(dt);
                if (dt.Tables.Count > 0)
                {
                    DataTable table = dt.Tables[0];
                    if (table.Rows.Count > 0)
                    {
                        tables.Add(table.Copy());
                    }
                }
            }
            foreach (var table in tables)
            {
                for (int i = 0; i < table.Rows.Count; ++i)
                {
                    db.Rows.Add(table.Rows[i].ItemArray);
                }
            }
        }
Ejemplo n.º 25
0
        private void button1_Click(object sender, EventArgs e)
        {
            string  xmlData   = "";
            string  resultXMl = "";
            string  sql       = "";
            decimal CGSL      = 0;

            this.Cursor = Cursors.WaitCursor;


            if (ClsSystem.gnvl(comboBox1.Text, "") == "")
            {
                MessageBox.Show("医院没有选择", "错误", MessageBoxButtons.OK, MessageBoxIcon.Error);
                comboBox1.Focus();
                return;
            }
            if (ClsSystem.gnvl(comboBox4.Text, "") == "")
            {
                MessageBox.Show("订单类型", "错误", MessageBoxButtons.OK, MessageBoxIcon.Error);
                comboBox4.Focus();
                return;
            }
            if (ClsSystem.gnvl(comboBox5.Text, "") == "")
            {
                MessageBox.Show("配送点编码", "错误", MessageBoxButtons.OK, MessageBoxIcon.Error);
                comboBox5.Focus();
                return;
            }
            if (dgv2.Rows.Count < 1)
            {
                MessageBox.Show("表体无数据", "错误", MessageBoxButtons.OK, MessageBoxIcon.Error);

                return;
            }

            if (dgv2.Rows.Count > 0)
            {
                for (int i = 0; i < dgv2.Rows.Count; i++)
                {
                    if (dgv2.Rows[i].IsNewRow)
                    {
                        continue;
                    }
                    //CGSL += int.Parse(ClsSystem.gnvl(this.dgv2.Rows[i].Cells["CGSL"].Value, ""));
                    CGSL++;//商品品种数目
                }
                xmlData = "";
                xmlData = xmlData + @"<?xml version=""1.0""  encoding=""utf-8""?>";
                xmlData = xmlData + "<XMLDATA>";
                xmlData = xmlData + "<HEAD>";
                xmlData = xmlData + "<IP>" + SendMessage.GetIP() + "</IP> ";
                xmlData = xmlData + "<MAC>" + SendMessage.GetMAC() + "</MAC> ";
                xmlData = xmlData + "<BZXX></BZXX> ";
                xmlData = xmlData + "</HEAD> ";

                xmlData = xmlData + "<MAIN>";
                xmlData = xmlData + "<YYBM>" + ClsSystem.gnvl(comboBox1.SelectedValue.ToString(), "") + "</YYBM> ";
                xmlData = xmlData + "<PSDBM>" + ClsSystem.gnvl(comboBox5.SelectedValue.ToString(), "") + "</PSDBM> ";
                xmlData = xmlData + "<DDLX>" + ClsSystem.gnvl((comboBox4.SelectedIndex + 1).ToString(), "") + "</DDLX> ";
                xmlData = xmlData + "<DDBH>" + ClsSystem.gnvl(textBox1.Text, "") + "</DDBH> ";
                xmlData = xmlData + "<SPSL>" + CGSL + "</SPSL> ";
                xmlData = xmlData + "</MAIN>";

                xmlData = xmlData + "</XMLDATA>";

                string resultXml = SendMessage.SetMessage("YQ006", xmlData);
                string result    = SendMessage.ReadXMl(resultXml, "HEAD", "ZTCLJG");
                if (result == "00000")
                {
                    MessageBox.Show("确认成功", "提示", MessageBoxButtons.OK, MessageBoxIcon.Exclamation);
                    return;
                }
                else
                {
                    string CWXX = SendMessage.ReadXMl(resultXml, "HEAD", "CWXX");
                    MessageBox.Show("错误编码:" + result + "错误信息:" + CWXX, "错误", MessageBoxButtons.OK, MessageBoxIcon.Error);
                    return;
                    //MessageBox.Show("错误编码:" + ClsSystem.gnvl(ds.Tables[0].Rows[0]["ZTCLJG"], "") + "错误信息:" + ClsSystem.gnvl(ds.Tables[0].Rows[0]["CWXX"], ""), "错误", MessageBoxButtons.OK, MessageBoxIcon.Error);
                    //return;
                }


                this.Cursor = Cursors.Default;
            }
        }
Ejemplo n.º 26
0
        /// <summary>
        /// 上传发票
        /// </summary>
        /// <param name="sender"></param>
        /// <param name="e"></param>
        private void button1_Click(object sender, EventArgs e)
        {
            string    xmlData   = "";
            string    resultXMl = "";
            string    sql       = "";
            string    SBVID     = "";
            string    SBVID_o   = "";
            string    yybm      = "";
            string    yybm_O    = "";
            string    PSDBM     = "";
            string    PSDBM_O   = "";
            int       y         = 0;
            int       count     = 0;
            DataTable dts       = null;

            this.Cursor = Cursors.WaitCursor;
            decimal hsje         = 0;
            decimal iInvExchRate = 0;

            if (dgv1.Rows.Count > 0)
            {
                for (int i = 0; i < dgv1.Rows.Count; i++)
                {
                    if (ClsSystem.gnvl(this.dgv1.Rows[i].Cells["cdefine24"].Value, "").ToUpper() == "00000")
                    {
                        continue;
                    }
                    if (ClsSystem.gnvl(this.dgv1.Rows[i].Cells["check"].Value, "").ToUpper() == "TRUE" &&
                        ClsSystem.gnvl(this.dgv1.Rows[i].Cells["cdefine24"].Value, "").ToUpper() != "00000")
                    {
                        yybm  = ClsSystem.gnvl(dgv1.Rows[i].Cells["cdefine11"].Value, "");
                        SBVID = ClsSystem.gnvl(this.dgv1.Rows[i].Cells["SBVID"].Value, "");
                        //PSDBM = ClsSystem.gnvl(this.dgv1.Rows[i].Cells["cDefine32"].Value, "");
                        if (yybm_O != yybm && y > 0)
                        {
                            MessageBox.Show("请选择同一客户上传", "错误", MessageBoxButtons.OK, MessageBoxIcon.Error);
                            return;
                        }
                        //if (SBVID != SBVID_o && y > 0)
                        //{

                        //    MessageBox.Show("请选择同一发票", "错误", MessageBoxButtons.OK, MessageBoxIcon.Error);
                        //    return;
                        //}
                        if (PSDBM_O != PSDBM && y > 0)
                        {
                            MessageBox.Show("请选择同一医院配送点编码", "错误", MessageBoxButtons.OK, MessageBoxIcon.Error);
                            return;
                        }

                        hsje = hsje + Public.ChinaRound(Public.GetNum(dgv1.Rows[i].Cells["iSum"].Value), 4);

                        yybm_O  = yybm;
                        SBVID_o = SBVID;
                        PSDBM_O = PSDBM;
                        y++;
                        count = i;
                    }
                }
                if (dgv1.Rows.Count > 0)
                {
                    xmlData = "";
                    xmlData = xmlData + @"<?xml version=""1.0""  encoding=""utf-8""?>";
                    xmlData = xmlData + "<XMLDATA>";
                    xmlData = xmlData + "<HEAD>";
                    xmlData = xmlData + "<IP>" + SendMessage.GetIP() + "</IP> ";
                    xmlData = xmlData + "<MAC>" + SendMessage.GetMAC() + "</MAC> ";
                    xmlData = xmlData + "<BZXX></BZXX> ";
                    xmlData = xmlData + "</HEAD> ";
                    xmlData = xmlData + "<MAIN>";
                    xmlData = xmlData + "<CZLX>1</CZLX> ";

                    xmlData = xmlData + "<YQBM>ZDYC0001</YQBM> ";
                    xmlData = xmlData + "<YYBM>" + ClsSystem.gnvl(dgv1.Rows[count].Cells["cdefine11"].Value, "") + "</YYBM> ";
                    xmlData = xmlData + "<PSDBM>" + ClsSystem.gnvl(dgv1.Rows[count].Cells["cDefine32"].Value, "") + "</PSDBM> ";

                    xmlData = xmlData + "<JLS>" + y.ToString() + "</JLS> ";
                    xmlData = xmlData + "</MAIN>";
                    xmlData = xmlData + "<DETAIL>";

                    for (int i = 0; i < dgv1.Rows.Count; i++)
                    {
                        WriteU8BVCode(i);
                        if (ClsSystem.gnvl(this.dgv1.Rows[i].Cells["check"].Value, "").ToUpper() == "TRUE" && ClsSystem.gnvl(this.dgv1.Rows[i].Cells["cDefine24"].Value, "").ToUpper() != "00000")
                        {
                            SBVID        = ClsSystem.gnvl(this.dgv1.Rows[i].Cells["SBVID"].Value, "");
                            iInvExchRate = Public.GetNum(dgv1.Rows[i].Cells["iInvExchRate"].Value);

                            //   dts = SqlAccess.ExecuteSqlDataTable(sql, Program.ConnectionString);

                            xmlData = xmlData + "<STRUCT>";

                            xmlData = xmlData + "<FPH>" + ClsSystem.gnvl(this.dgv1.Rows[i].Cells["cSBVCode"].Value, "") + "</FPH> ";


                            xmlData = xmlData + "<FPRQ>" + Convert.ToDateTime(dgv1.Rows[i].Cells["dDate"].Value).Year.ToString("0000") + Convert.ToDateTime(dgv1.Rows[i].Cells["dDate"].Value).Month.ToString("00") + Convert.ToDateTime(dgv1.Rows[i].Cells["dDate"].Value).Day.ToString("00") + "</FPRQ> ";
                            xmlData = xmlData + "<FPHSZJE>" + ClsSystem.gnvl(hsje, "0") + "</FPHSZJE>";
                            xmlData = xmlData + "<DLCGBZ>0</DLCGBZ> ";
                            xmlData = xmlData + "<FPBZ>" + ClsSystem.gnvl(this.dgv1.Rows[i].Cells["cMemo"].Value, "") + "</FPBZ> ";
                            xmlData = xmlData + "<GLMXBH>" + ClsSystem.gnvl(dgv1.Rows[i].Cells["cDefine29"].Value, "") + "</GLMXBH> ";
                            xmlData = xmlData + "<XSDDH>" + ClsSystem.gnvl(dgv1.Rows[i].Cells["iDLsID"].Value, "") + "</XSDDH> ";
                            xmlData = xmlData + "<SPLX>1</SPLX> ";

                            xmlData = xmlData + "<SFCH>" + ClsSystem.gnvl(dgv1.Rows[i].Cells["bReturnFlag"].Value, "") + "</SFCH> ";

                            if (ClsSystem.gnvl(dgv1.Rows[i].Cells["bReturnFlag"].Value, "") == "1")
                            {
                                xmlData = xmlData + "<GLBZ>0</GLBZ> ";
                            }
                            else
                            {
                                xmlData = xmlData + "<GLBZ>1</GLBZ> ";
                            }
                            xmlData = xmlData + "<WFGLSM></WFGLSM> ";
                            xmlData = xmlData + "<ZXSPBM>" + ClsSystem.gnvl(dgv1.Rows[i].Cells["cDefine28"].Value, "") + "</ZXSPBM> ";
                            xmlData = xmlData + "<SCPH>" + ClsSystem.gnvl(dgv1.Rows[i].Cells["cBatch"].Value, "") + "</SCPH> ";
                            xmlData = xmlData + "<PZWH>" + ClsSystem.gnvl(dgv1.Rows[i].Cells["cFile"].Value, "") + "</PZWH> ";
                            xmlData = xmlData + "<SPSL>" + ClsSystem.gnvl(dgv1.Rows[i].Cells["iNum"].Value, "") + "</SPSL> ";
                            xmlData = xmlData + "<CGJLDW>" + ClsSystem.gnvl(dgv1.Rows[i].Cells["cDefine30"].Value, "") + "</CGJLDW> ";
                            xmlData = xmlData + "<SCRQ>" + Convert.ToDateTime(dgv1.Rows[i].Cells["dMDate"].Value).Year.ToString("0000") + Convert.ToDateTime(dgv1.Rows[i].Cells["dMDate"].Value).Month.ToString("00") + Convert.ToDateTime(dgv1.Rows[i].Cells["dMDate"].Value).Day.ToString("00") + "</SCRQ> ";
                            xmlData = xmlData + "<YXRQ>" + Convert.ToDateTime(dgv1.Rows[i].Cells["cExpirationdate"].Value).Year.ToString("0000") + Convert.ToDateTime(dgv1.Rows[i].Cells["cExpirationdate"].Value).Month.ToString("00") + Convert.ToDateTime(dgv1.Rows[i].Cells["cExpirationdate"].Value).Day.ToString("00") + "</YXRQ> ";
                            xmlData = xmlData + "<WSDJ>" + ClsSystem.gnvl(Public.ChinaRound(Public.GetNum(dgv1.Rows[i].Cells["iUnitPrice"].Value), 4), "") + "</WSDJ> ";
                            xmlData = xmlData + "<HSDJ>" + ClsSystem.gnvl(Public.ChinaRound(Public.GetNum(dgv1.Rows[i].Cells["iTaxUnitPrice"].Value), 4), "") + "</HSDJ> ";
                            xmlData = xmlData + "<SL>" + ClsSystem.gnvl(Public.ChinaRound(Public.GetNum(dgv1.Rows[i].Cells["iTaxRate"].Value), 4), "") + "</SL> ";
                            xmlData = xmlData + "<SE>" + ClsSystem.gnvl(Public.ChinaRound(Public.GetNum(dgv1.Rows[i].Cells["iTax"].Value), 4), "") + "</SE> ";
                            xmlData = xmlData + "<WSJE>" + ClsSystem.gnvl(Public.ChinaRound(Public.GetNum(dgv1.Rows[i].Cells["iMoney"].Value), 4), "") + "</WSJE> ";
                            xmlData = xmlData + "<HSJE>" + ClsSystem.gnvl(Public.ChinaRound(Public.GetNum(dgv1.Rows[i].Cells["iSum"].Value), 4), "") + "</HSJE> ";

                            xmlData = xmlData + "<PFJ>" + ClsSystem.gnvl(Public.ChinaRound(Public.GetNum(dgv1.Rows[i].Cells["iQuotedPrice"].Value), 4), "") + "</PFJ> ";
                            xmlData = xmlData + "<LSJ>" + ClsSystem.gnvl(Public.ChinaRound(Public.GetNum(dgv1.Rows[i].Cells["fRetailPrice"].Value), 4), "") + "</LSJ> ";

                            xmlData = xmlData + "</STRUCT>";
                        }
                    }
                    xmlData = xmlData + "</DETAIL>";
                    xmlData = xmlData + "</XMLDATA>";
                }
                DataSet   ds        = new DataSet();
                DataTable db        = null;
                string    iDLsID    = "";
                string    CLJG      = "";
                string    resultXml = SendMessage.SetMessage("YQ004", xmlData);
                string    result    = SendMessage.ReadXMl(resultXml, "HEAD", "ZTCLJG");
                if (result == "00000")
                {
                    try
                    {
                        TextReader tdr = new StringReader(resultXml);
                        ds.ReadXml(tdr);
                        if (ds.Tables.Count == 3)
                        {
                            db = ds.Tables[2];
                            for (int j = 0; j < db.Rows.Count; j++)
                            {
                                iDLsID = ClsSystem.gnvl(db.Rows[j]["XSDDH"], "");
                                CLJG   = ClsSystem.gnvl(db.Rows[j]["CLJG"], "");

                                sql = sql + " update SaleBillVouchs set cdefine24='" + CLJG + "' where iDLsID=" + iDLsID + "\n";
                            }
                        }
                    }
                    catch (Exception ex)
                    {
                    }
                }
                else
                {
                    TextReader tdr = new StringReader(resultXml);
                    ds.ReadXml(tdr);
                    string CLQKMS = "";
                    if (ds.Tables.Count == 3)
                    {
                        db     = ds.Tables[2];
                        CLJG   = ClsSystem.gnvl(db.Rows[0]["CLJG"], "");
                        CLQKMS = ClsSystem.gnvl(db.Rows[0]["CLQKMS"], "");
                    }
                    //dgv1.Rows[i].Cells["cdefine24"].Value = "错误编码:" + CLJG + "错误信息:" + CLQKMS;

                    string CWXX = SendMessage.ReadXMl(resultXml, "HEAD", "CWXX");
                    MessageBox.Show("错误编码:" + result + "错误信息:" + CWXX + "\n\r" + CLQKMS, "错误", MessageBoxButtons.OK, MessageBoxIcon.Error);
                    return;
                    //MessageBox.Show("错误编码:" + ClsSystem.gnvl(ds.Tables[0].Rows[0]["ZTCLJG"], "") + "错误信息:" + ClsSystem.gnvl(ds.Tables[0].Rows[0]["CWXX"], ""), "错误", MessageBoxButtons.OK, MessageBoxIcon.Error);
                    //return;
                }
                try
                {
                    SqlAccess.ExecuteSql(sql, Program.ConnectionString);
                }
                catch (Exception ex)
                {
                    MessageBox.Show(ex.Message);
                }
                this.Cursor = Cursors.Default;
            }
        }
Ejemplo n.º 27
0
        private void comboBox1_SelectedValueChanged(object sender, EventArgs e)
        {
            if (isTrue)
            {
                string xmlData   = "";
                string resultXMl = "";

                if (ClsSystem.gnvl(comboBox1.Text, "") == "")
                {
                    MessageBox.Show("医院没有选择", "错误", MessageBoxButtons.OK, MessageBoxIcon.Error);
                    comboBox1.Focus();
                    return;
                }

                xmlData = "";
                xmlData = xmlData + @"<?xml version=""1.0""  encoding=""utf-8""?>";
                xmlData = xmlData + "<XMLDATA>";
                xmlData = xmlData + "<HEAD>";
                xmlData = xmlData + "<IP>" + SendMessage.GetIP() + "</IP> ";
                xmlData = xmlData + "<MAC>" + SendMessage.GetMAC() + "</MAC> ";
                xmlData = xmlData + "<BZXX></BZXX> ";
                xmlData = xmlData + "</HEAD> ";

                xmlData = xmlData + "<MAIN>";
                xmlData = xmlData + "<YYBM>" + comboBox1.SelectedValue.ToString() + "</YYBM> ";
                xmlData = xmlData + "</MAIN>";
                xmlData = xmlData + "</XMLDATA>";
                //     MessageBox.Show(xmlData);
                //   DataSet ds = SendMessage.QuryData("YQ017", xmlData);
                DataSet ds        = new DataSet();
                string  resultXml = SendMessage.SetMessage("YQ017", xmlData);
                //     MessageBox.Show(resultXml);
                string result = SendMessage.ReadXMl(resultXml, "HEAD", "ZTCLJG");

                if (result == "00000")
                {
                    TextReader tdr = new StringReader(resultXml);
                    ds.ReadXml(tdr);
                }

                if (ds.Tables.Count > 3)
                //  if (ds != null && ClsSystem.gnvl(ds.Tables[0].Rows[0]["ZTCLJG"], "") == "00000")
                {
                    DataTable db = ds.Tables[3];
                    cxdb = ds.Tables[3];

                    if (db.Rows.Count > 0)
                    {
                        comboBox5.DataSource = db;

                        comboBox5.DisplayMember = "PSDMC";
                        comboBox5.ValueMember   = "PSDBM";
                        comboBox5.Text          = "";
                    }
                }
                else
                {
                    result = SendMessage.ReadXMl(resultXml, "HEAD", "CWXX");
                    MessageBox.Show(result, "错误", MessageBoxButtons.OK);
                }
            }
            isTrue = false;
        }
Ejemplo n.º 28
0
        private string Qury01(string cType)
        {
            string xmlData   = "";
            string ResultXml = "";
            string czlx      = "1";//新增


            string strsql = @"sselect cInvCCode as SPLX ,cInvDefine1 as YPLX,  cInvName as tym,'' as CPM,
'' as YWM, cInvName as SPM,cInvDefine2 as YPSPTXM, cInvDefine3 as YPJX,
cInvStd as GG,cEnterprise  as SCQYMC,'' as CPLB,'' as YPBWM,cFile  as YPPZWH,
'' as BZCZ,'' as BZDW,cPackingType  as CGYYDW,'' as BZSL,'' as BZFS,'' as TZMS
 from inventory  where isnull(cInvDefine10,'')<>'' ";

            DataTable db = SqlAccess.ExecuteSqlDataTable(strsql, conn);

            if (db.Rows.Count > 0)
            {
                for (int i = 0; i < db.Rows.Count; i++)
                {
                    xmlData   = "";
                    ResultXml = "";
                    xmlData   = @"<?xml version=""1.0""  encoding=""utf-8""?>";
                    xmlData   = xmlData + "<XMLDATA>";
                    xmlData   = xmlData + "<HEAD>";
                    xmlData   = xmlData + "<IP>" + SendMessage.GetIP() + "</IP>";
                    xmlData   = xmlData + "<MAC>" + SendMessage.GetMAC() + "</MAC>";
                    xmlData   = xmlData + "<BZXX/>";
                    xmlData   = xmlData + "</HEAD>";
                    xmlData   = xmlData + "<MAIN>";
                    xmlData   = xmlData + "<CZLX>" + czlx + "</CZLX>";
                    xmlData   = xmlData + "<SPLX>" + ClsSystem.gnvl(db.Rows[i]["SPLX"], "") + "</SPLX>";
                    xmlData   = xmlData + "<YPLX>" + ClsSystem.gnvl(db.Rows[i]["YPLX"], "") + "</YPLX>";
                    xmlData   = xmlData + "<TYM>" + ClsSystem.gnvl(db.Rows[i]["TYM"], "") + "</TYM>";
                    xmlData   = xmlData + "<CPM>" + ClsSystem.gnvl(db.Rows[i]["CPM"], "") + "</CPM>";
                    xmlData   = xmlData + "<YWM>" + ClsSystem.gnvl(db.Rows[i]["YWM"], "") + "</YWM>";
                    xmlData   = xmlData + "<SPM>" + ClsSystem.gnvl(db.Rows[i]["SPM"], "") + "</SPM>";
                    xmlData   = xmlData + "<YPSPTXM>" + ClsSystem.gnvl(db.Rows[i]["YPSPTXM"], "") + "</YPSPTXM>";
                    xmlData   = xmlData + "<YPJX>" + ClsSystem.gnvl(db.Rows[i]["YPJX"], "") + "</YPJX>";
                    xmlData   = xmlData + "<GG>" + ClsSystem.gnvl(db.Rows[i]["GG"], "") + "</GG>";
                    xmlData   = xmlData + "<SCQYMC>" + ClsSystem.gnvl(db.Rows[i]["SCQYMC"], "") + "</SCQYMC>";
                    xmlData   = xmlData + "<CPLB>" + ClsSystem.gnvl(db.Rows[i]["CPLB"], "") + "</CPLB>";
                    xmlData   = xmlData + "<YPBWM>" + ClsSystem.gnvl(db.Rows[i]["YPBWM"], "") + "</YPBWM>";
                    xmlData   = xmlData + "<YPPZWH>" + ClsSystem.gnvl(db.Rows[i]["YPPZWH"], "") + "</YPPZWH>";
                    xmlData   = xmlData + "<BZCZ>" + ClsSystem.gnvl(db.Rows[i]["BZCZ"], "") + "</BZCZ>";
                    xmlData   = xmlData + "<BZDW>" + ClsSystem.gnvl(db.Rows[i]["BZDW"], "") + "</BZDW>";
                    xmlData   = xmlData + "<CGYYDW>" + ClsSystem.gnvl(db.Rows[i]["CGYYDW"], "") + "</CGYYDW>";
                    xmlData   = xmlData + "<BZSL>" + ClsSystem.gnvl(db.Rows[i]["BZSL"], "") + "</BZSL>";
                    xmlData   = xmlData + "<BZFS>" + ClsSystem.gnvl(db.Rows[i]["BZFS"], "") + "</BZFS>";
                    xmlData   = xmlData + "<TZMS>" + ClsSystem.gnvl(db.Rows[i]["TZMS"], "") + "</TZMS>";
                    xmlData   = xmlData + "</MAIN>";
                    xmlData   = xmlData + "</XMLDATA>";


                    DataSet ds = SendMessage.QuryData(cType, xmlData);

                    if (ds.Tables.Count > 0)
                    {
                        if (ClsSystem.gnvl(ds.Tables[0].Rows[0]["ZTCLJG"], "") == "00000")
                        {
                            xmlData = @"<?xml version=""1.0""  encoding=""utf-8""?>";
                            xmlData = xmlData + "<XMLDATA>";
                            xmlData = xmlData + "<HEAD>";
                            xmlData = xmlData + "<IP>" + SendMessage.GetIP() + "</IP>";
                            xmlData = xmlData + "<MAC>" + SendMessage.GetMAC() + "</MAC>";
                            xmlData = xmlData + "<BZXX/>";
                            xmlData = xmlData + "</HEAD>";
                            xmlData = xmlData + "<MAIN>";
                            xmlData = xmlData + "<CXLX>07</CXLX>";
                            xmlData = xmlData + "<CXBH>" + ClsSystem.gnvl(db.Rows[i]["YPBWM"], "") + "</CXBH>";
                            xmlData = xmlData + "</MAIN>";
                            xmlData = xmlData + "</XMLDATA>";
                            DataSet rds = SendMessage.QuryData("YQ015", xmlData);
                            if (rds.Tables.Count > 0)
                            {
                                if (ClsSystem.gnvl(rds.Tables[0].Rows[0]["ZTCLJG"], "") == "00000")
                                {
                                    //strsql = "insert into YS_Interface_Records(cMaker,dDate,cType,cFlag,ExCode,errMsg) values("
                                    //                        + "'',getdate(),'" + cType + "','成功','" + VouchNO + "','')";

                                    // SqlAccess.ExecuteSql(strsql, conn);
                                }
                            }
                        }
                    }
                }
            }
            return(null);
        }