Example #1
0
        /// <summary>
        /// 判断物料编码是否合法
        /// </summary>
        /// <param name="sMNo"></param>
        /// <returns></returns>
        private bool JudgeMNoIsOK(string sMNo)
        {
            bool   bOK  = false;
            string sSql = "select count(*) nCount from TPC_Material where cMNo='" + sMNo.Trim() + "'";
            string sErr = "";
            object objX = null;

            if (DBFuns.GetValueBySql(AppInformation.SvrSocket, sSql, "", "nCount", out objX, out sErr))
            {
                if (sErr.Trim() != "" && sErr.Trim() != "0")
                {
                    MessageBox.Show(sErr);
                    return(false);
                }
                else
                {
                    if (objX == null)
                    {
                        bOK = false;
                    }
                    else
                    {
                        bOK = objX.ToString() == "1";
                    }
                }
            }
            else
            {
                bOK = false;
            }
            return(bOK);
        }
Example #2
0
        private bool isBillOK()
        {
            string sSql = string.Format("select nbillstatus from TWB_BillIn where cBNo='{0}'", sBNo);

            if (DBFuns.GetValueBySql(AppInformation.SvrSocket, sSql, "", "nbillstatus", out objValue, out sErr))
            {
                if (objValue != null && objValue.ToString() != "" && (sErr.Trim() == "" || sErr.Trim() == "0"))
                {
                    if (Convert.ToInt32(objValue) == 1)
                    {
                        return(true);
                    }
                }
            }
            return(false);
        }
Example #3
0
 private void btn_Dtl_InnerAccont_Click(object sender, EventArgs e)
 {
     if (isBillOK())
     {
         sSql = "select count(0) num from TWB_WorkTaskDtl where  cBNo='" + sBNo + "' and nItem=" + nItem.ToString() +
                " and  nWorkId in (select nWorkId from TWB_WorkTask where nWKStatus <99)";
         if (DBFuns.GetValueBySql(AppInformation.SvrSocket, sSql, "", "num", out objValue, out sErr))
         {
             if (objValue != null && objValue.ToString() != "" && (sErr.Trim() == "" || sErr.Trim() == "0"))
             {
                 if (Convert.ToInt32(objValue) == 0)
                 {
                     if (MessageBox.Show("确定整单无差异登记吗?", "WMS", MessageBoxButtons.YesNo, MessageBoxIcon.Question, MessageBoxDefaultButton.Button2) == DialogResult.Yes)
                     {
                         int count    = 0;
                         int badcount = 0;
                         foreach (DataGridViewRow item in dataGridView_HasPallet.Rows)
                         {
                             int pWorkId = Convert.ToInt32(item.Cells["nWorkId"].Value);
                             if (PubDBCommFuns.sp_DoAccont(base.AppInformation.SvrSocket, pWorkId, 1, "WMS", out sErr) == "0")
                             {
                                 count++;
                             }
                             else
                             {
                                 badcount++;
                             }
                         }
                         DoRefreshQty();
                         DoRefreshHasPallet();
                         MessageBox.Show("成功登记了 " + count.ToString() + " 条任务,失败" + badcount.ToString() + " 条任务!");
                     }
                 }
                 else
                 {
                     MessageBox.Show("对不起,该订单下还有没有上架完成的任务!");
                 }
             }
         }
     }
     else
     {
         MessageBox.Show("对不起,还没有收到PSCS发过来的收货入库单!");
     }
 }
Example #4
0
        private int GetPosRowNo(string sPosId)
        {
            int    num      = 0;
            string sSql     = "select nRow from TWC_WareCell where cPosId='" + sPosId.Trim() + "'";
            object objValue = null;
            string sErr     = "";

            if (DBFuns.GetValueBySql(base.AppInformation.SvrSocket, sSql, "", "nRow", out objValue, out sErr))
            {
                if (objValue != null)
                {
                    num = Convert.ToInt16(objValue);
                }
                return(num);
            }
            MessageBox.Show("获取货位的行号时出错:" + sErr);
            return(num);
        }
Example #5
0
        private void DoRefreshQty()
        {
            sSql = "select fqty,fpallet,ffinished from TWB_BillInDtl where cBNo='" + sBNo + "' and nItem=" + nItem.ToString();
            DataSet ds = PubDBCommFuns.GetDataBySql(base.AppInformation.SvrSocket, false, sSql, "TWB_BillInDtl", 0, 0, "", out sErr);

            if (sErr.Length > 0)
            {
                MessageBox.Show(sErr);
            }
            else if (ds == null)
            {
                MessageBox.Show("对不起,打开单据表数据失败!");
            }
            else
            {
                DataRow dr = ds.Tables["TWB_BillInDtl"].Rows[0];
                fqty        = Convert.ToDouble(dr["fqty"]);
                lbfqty.Text = fqty.ToString();
                string fpalletStr = dr["fpallet"].ToString();
                fpalletStr       = fpalletStr == "" ? "0" : fpalletStr;
                fpallet          = Convert.ToDouble(fpalletStr);
                lbfpallet.Text   = fpallet.ToString();
                ffinished        = Convert.ToDouble(dr["ffinished"]);
                lbffinished.Text = ffinished.ToString();
            }
            sSql = "select sum(fQty) fQty from TWB_WorkTaskDtl where  cBNo='" + sBNo + "' and nItem=" + nItem.ToString()
                   + " and  nWorkId in (select nWorkId from TWB_WorkTask where nWKStatus in (99,109))";

            if (DBFuns.GetValueBySql(AppInformation.SvrSocket, sSql, "", "fQty", out objValue, out sErr))
            {
                if (objValue != null && objValue.ToString() != "" && (sErr.Trim() == "" || sErr.Trim() == "0"))
                {
                    taskFinNum        = Convert.ToDouble(objValue);
                    lbtaskFinNum.Text = taskFinNum.ToString();
                }
            }
        }