コード例 #1
0
        private int GetMaterialQCState(string sMNo)
        {
            int    nState = 1;
            string sSql   = "select isnull(bIsQC,1) bIsQC from TPC_Material where cMNo='" + sMNo.Trim() + "'";
            object objX   = null;
            string sErr   = "";

            PubDBCommFuns.GetValueBySql(AppInformation.SvrSocket, sSql, "", "bIsQC", out objX, out sErr);
            if (sErr.Trim() != "" && sErr.Trim() != "0")
            {
                MessageBox.Show(sErr);
            }
            else if (objX != null)
            {
                nState = int.Parse(objX.ToString());
                if (nState == 1)
                {
                    nState = 0;
                }
                else
                {
                    nState = 1;
                }
            }
            return(nState);
        }
コード例 #2
0
        private void OpenCellItemList(string sCellId)
        {
            string sPalletId = "";
            string sErr      = "";
            object objX      = null;

            PubDBCommFuns.GetValueBySql(AppInformation.SvrSocket, "select isnull(nPalletId,'') nPalletId from TWC_WareCell where cPosId='" + sCellId.Trim() + "'", "", "nPalletId", out objX, out sErr);
            if (sErr.Trim() != "" && sErr.Trim() == "0")
            {
                MessageBox.Show(sErr);
                return;
            }
            if (objX != null)
            {
                sPalletId = objX.ToString();
            }
            if (sPalletId.Trim() == "")
            {
                sPalletId = "~";
            }
            string sWHId = cmb_cWHId.SelectedValue.ToString();
            //StringBuilder sSql = new StringBuilder("select * from V_StoreItemList");
            DataTable tbX = PubDBCommFuns.sp_Pack_GetItemList(AppInformation.SvrSocket, sPalletId, sWHId, "", 1, out sErr);

            if ((sErr != "0") && (sErr.Trim().Length != 0))
            {
                MessageBox.Show(sErr);
            }
            else
            {
                bdsList.DataSource = tbX;
                grdList.DataSource = bdsList;
            }
        }
コード例 #3
0
ファイル: FrmStockMCheckFilter.cs プロジェクト: windygu/SGWMS
        private bool GetIsLinkErp()
        {
            string sSql     = "select isnull(max(cParValue),'0') cParValue from TPS_SysPar where  cParId='nIsLinkMis' ";
            string sErr     = "";
            object objValue = null;

            PubDBCommFuns.GetValueBySql(base.AppInformation.SvrSocket, sSql, "", "cParValue", out objValue, out sErr);
            if ((sErr.Trim() != "") && (sErr.Trim() != "0"))
            {
                MessageBox.Show(sErr);
            }
            return((objValue != null) && (int.Parse(objValue.ToString()) > 0));
        }
コード例 #4
0
        private bool GetIsLinkErp()
        {
            bool   bOK  = false;
            string sSql = "select isnull(max(cParValue),'0') cParValue from TPS_SysPar where  cParId='nIsLinkMis' ";
            string sErr = "";
            object objX = null;

            PubDBCommFuns.GetValueBySql(AppInformation.SvrSocket, sSql, "", "cParValue", out objX, out sErr);
            if (sErr.Trim() != "" && sErr.Trim() != "0")
            {
                MessageBox.Show(sErr);
            }
            bOK = objX != null && int.Parse(objX.ToString()) > 0;
            return(bOK);
        }
コード例 #5
0
        private string GetCellPalletId(string sCellId)
        {
            string sPalletId = "";
            string sErr      = "";
            object objX      = null;

            PubDBCommFuns.GetValueBySql(AppInformation.SvrSocket, "select isnull(nPalletId,' ') nPalletId from TWC_WareCell where cPosId='" + sCellId.Trim() + "'", "", "nPalletId", out objX, out sErr);
            if (sErr.Trim() != "" && sErr.Trim() == "0")
            {
                MessageBox.Show(sErr);
                return("");
            }
            if (objX != null)
            {
                sPalletId = objX.ToString();
            }
            return(sPalletId.Trim());
        }
コード例 #6
0
        private int GetMaterialKeepDay(string sMNo)
        {
            int    nDay = 360;
            string sSql = "select isnull(nKeepDay,360) nKeepDay from TPC_Material where cMNo='" + sMNo.Trim() + "'";
            object objX = null;
            string sErr = "";

            PubDBCommFuns.GetValueBySql(AppInformation.SvrSocket, sSql, "", "nKeepDay", out objX, out sErr);
            if (sErr.Trim() != "" && sErr.Trim() != "0")
            {
                MessageBox.Show(sErr);
            }
            else if (objX != null)
            {
                nDay = int.Parse(objX.ToString());
            }
            return(nDay);
        }
コード例 #7
0
ファイル: frmCountWareCell.cs プロジェクト: windygu/SGWMS
        private void CountWCellUsedRate()
        {
            int           nUsed    = 0;
            int           nCount   = 1;
            double        fRate    = 0;
            object        objValue = null;
            string        sErr     = "";
            string        sCond    = GetCondition();
            StringBuilder sSql     = new StringBuilder("select count(*) nCount from V_WareCellStoreState");

            sSql.Append(sCond);
            sSql.Append(" and  nstatusstore >0 ");
            PubDBCommFuns.GetValueBySql(AppInformation.SvrSocket, sSql.ToString(), "", "nCount", out objValue, out sErr);
            if (sErr.Trim() != "" && sErr.Trim() != "0")
            {
                MessageBox.Show(sErr);
                return;
            }
            if (objValue != null)
            {
                nUsed = int.Parse(objValue.ToString());
            }
            sSql.Remove(0, sSql.Length);
            sSql.Append("select count(*) nCount from V_WareCellStoreState");
            sSql.Append(sCond);
            sErr = "";
            PubDBCommFuns.GetValueBySql(AppInformation.SvrSocket, sSql.ToString(), "", "nCount", out objValue, out sErr);
            if (sErr.Trim() != "" && sErr.Trim() != "0")
            {
                MessageBox.Show(sErr);
                return;
            }
            if (objValue != null)
            {
                nCount = int.Parse(objValue.ToString());
            }
            if (nCount == 0)
            {
                nCount = 1;
            }
            fRate             = ((nUsed * 1.0) / nCount) * 100;
            lbl_UsedRate.Text = fRate.ToString("##.##") + " %";
        }
コード例 #8
0
        /// <summary>
        /// 根据系统参数,确定是否启用扩展表
        /// </summary>
        private void DoIsUseExTable()
        {
            string sErr     = "";
            object objValue = "";
            string sSql     = "select cParValue from TPS_SysPar where cParId='nOutBillIsEx'";

            PubDBCommFuns.GetValueBySql(AppInformation.SvrSocket, sSql, "", "cParValue", out objValue, out sErr);
            if (sErr.Trim() != "" && sErr.Trim() != "0")
            {
                MessageBox.Show(sErr);
            }
            else
            {
                if (objValue != null)
                {
                    bIsEx = objValue.ToString().Trim() != "0";
                }
            }
        }
コード例 #9
0
        private int GetMaterialKeepDay(string sMNo)
        {
            int    num      = 360;
            string sSql     = "select isnull(nKeepDay,360) nKeepDay from TPC_Material where cMNo='" + sMNo.Trim() + "'";
            object objValue = null;
            string sErr     = "";

            PubDBCommFuns.GetValueBySql(base.AppInformation.SvrSocket, sSql, "", "nKeepDay", out objValue, out sErr);
            if ((sErr.Trim() != "") && (sErr.Trim() != "0"))
            {
                MessageBox.Show(sErr);
                return(num);
            }
            if (objValue != null)
            {
                num = int.Parse(objValue.ToString());
            }
            return(num);
        }
コード例 #10
0
        private int GetMaterialQCState(string sMNo)
        {
            int    num      = 1;
            string sSql     = "select isnull(bIsQC,1) bIsQC from TPC_Material where cMNo='" + sMNo.Trim() + "'";
            object objValue = null;
            string sErr     = "";

            PubDBCommFuns.GetValueBySql(base.AppInformation.SvrSocket, sSql, "", "bIsQC", out objValue, out sErr);
            if ((sErr.Trim() != "") && (sErr.Trim() != "0"))
            {
                MessageBox.Show(sErr);
                return(num);
            }
            if (objValue == null)
            {
                return(num);
            }
            if (int.Parse(objValue.ToString()) == 1)
            {
                return(0);
            }
            return(1);
        }