示例#1
0
 private void bbiLotApprove_ItemClick(object sender, DevExpress.XtraBars.ItemClickEventArgs e)
 {
     uGridProBoxBarCode.UpdateData();
     for (var i = 0; i < uGridProBoxBarCode.Rows.Count; i++)
     {
         if ((bool)uGridProBoxBarCode.Rows[i].Cells["bSelect"].Value)
         {
             var cOrderNumber = uGridProBoxBarCode.Rows[i].Cells["cOrderNumber"].Value.ToString();
             var cState       = uGridProBoxBarCode.Rows[i].Cells["cState"].Value.ToString();
             if (!cState.Equals("完成"))
             {
                 uGridProBoxBarCode.Rows[i].Cells["cResult"].Value = "Error:必需是完成的单据才允许导入EAS";
                 continue;
             }
             var wf     = new WmsFunction(BaseStructure.WmsCon);
             var lotCmd = new SqlCommand("GenerateWmsEas")
             {
                 CommandType = CommandType.StoredProcedure
             };
             lotCmd.Parameters.AddWithValue("@cOrderNumber", cOrderNumber);
             lotCmd.Parameters.AddWithValue("@cType", "销售出库");
             lotCmd.Parameters.AddWithValue("@cGuid", Guid.NewGuid());
             lotCmd.Parameters.AddWithValue("@bReUpdate", 1);
             if (wf.ExecSqlCmd(lotCmd))
             {
                 uGridProBoxBarCode.Rows[i].Cells["cResult"].Value = @"写入中间表成功";
             }
         }
         else
         {
             MessageBox.Show(@"请选择要审核的记录行");
         }
     }
 }
示例#2
0
        private void biAddNew_ItemClick(object sender, DevExpress.XtraBars.ItemClickEventArgs e)
        {
            var ew = new EasOrder {
                Url = BaseStructure.OrderServiceUri
            };
            var dtRm = ew.GetRm();
            var wf   = new WmsFunction(BaseStructure.WmsCon);

            pbMain.Maximum = dtRm.Rows.Count - 1;
            pbMain.Value   = 0;
            for (var i = 0; i < dtRm.Rows.Count; i++)
            {
                var synCmd = new SqlCommand("SyncInventory")
                {
                    CommandType = CommandType.StoredProcedure
                };
                synCmd.Parameters.AddWithValue("@cInvCode", dtRm.Rows[i]["cInvCode"]);
                synCmd.Parameters.AddWithValue("@cInvName", dtRm.Rows[i]["cInvName"]);
                synCmd.Parameters.AddWithValue("@cInvType", "Rm");
                synCmd.Parameters.AddWithValue("@FStatus", dtRm.Rows[i]["FStatus"]);
                synCmd.Parameters.AddWithValue("@bLotMgr", dtRm.Rows[i]["FIsLotNumber"]);
                wf.ExecSqlCmd(synCmd);
                pbMain.Value = i;
                WmsFunction.VLogDebug("SyncInventory", dtRm.Rows[i]["cInvCode"] + "/" + dtRm.Rows[i]["cInvName"] + "/" + dtRm.Rows[i]["FStatus"] + "/" + dtRm.Rows[i]["FIsLotNumber"]);
            }
            MessageBox.Show(@"同步完成");
            var bTrue = biDelete.Caption.Equals("停用");

            GetRawMaterial(bTrue);
        }
示例#3
0
        private void uGridCheck_DoubleClickCell(object sender, Infragistics.Win.UltraWinGrid.DoubleClickCellEventArgs e)
        {
            if (e.Cell.Row == null || e.Cell.Row.Index < 0)
            {
                return;
            }
            _cOrderNumber = e.Cell.Row.Cells["cOrderNumber"].Value.ToString();
            _iRowNo       = e.Cell.Row.Index;
            var eo = new EasOrderService.EasOrder();

            eo.Url = BaseStructure.OrderServiceUri;
            var dtTemp = eo.GetPoDetail(_cOrderNumber);

            uGridChecks.DataSource = dtTemp;
            if (dtTemp != null && dtTemp.Rows.Count > 0)
            {
                var strTemp = dtTemp.Compute("sum(FAmount)", "").ToString();
                if (decimal.TryParse(strTemp, out _iSum))
                {
                    _cSumUpper = WmsFunction.ExchangeUper(_iSum);
                }
                else
                {
                    _iSum      = 0;
                    _cSumUpper = "";
                }
            }
        }
示例#4
0
        private void btnSubmit_Click(object sender, EventArgs e)
        {
            var sqlstr = "UpdatePwd";
            var con    = new SqlConnection(BaseStructure.WmsCon);
            var cmd    = new SqlCommand(sqlstr, con)
            {
                CommandType = CommandType.StoredProcedure
            };

            cmd.Parameters.AddWithValue("@uName", utxtUser.Text);
            cmd.Parameters.AddWithValue("@uPassword", WmsFunction.GetMd5Hash(utxtPassword.Text));
            cmd.Parameters.AddWithValue("@uPwd", WmsFunction.GetMd5Hash(utxtPwd.Text));
            try
            {
                con.Open();
            }
            catch (Exception ex)
            {
                MessageBox.Show(@"发生异常" + ex.Message, @"Warning", MessageBoxButtons.OK, MessageBoxIcon.Warning);
                return;
            }
            if (cmd.ExecuteNonQuery() < 1)
            {
                MessageBox.Show(@"修改失败", @"Warning", MessageBoxButtons.OK, MessageBoxIcon.Warning);
            }
            else
            {
                MessageBox.Show(@"修改成功", @"Information", MessageBoxButtons.OK, MessageBoxIcon.Information);
                DialogResult = DialogResult.OK;
            }
        }
示例#5
0
        private DataTable JudgeManualInvCode(string cInvCode)
        {
            var wf  = new WmsFunction(BaseStructure.WmsCon);
            var cmd = new SqlCommand("select * from IT_Product where cInvCode=@cInvCode and bLotMgr=0");

            cmd.Parameters.AddWithValue("@cInvCode", cInvCode);
            return(wf.GetSqlTable(cmd));
        }
示例#6
0
        private DataTable JudgeBarcodeIsOrder(string cOrderNumber)
        {
            var wf  = new WmsFunction(BaseStructure.WmsCon);
            var cmd = new SqlCommand("select * from SS_Detail where cOrderNumber=@cOrderNumber");

            cmd.Parameters.AddWithValue("@cOrderNumber", cOrderNumber);
            return(wf.GetSqlTable(cmd));
        }
示例#7
0
        private void UpdatePrintNum(string cBoxNumber)
        {
            var cmd = new SqlCommand("update SS_Box set iPrintNum=iPrintNum+1  where cBoxNumber=@cBoxNumber");

            cmd.Parameters.AddWithValue("@cBoxNumber", cBoxNumber);
            var wf = new WmsFunction(BaseStructure.WmsCon);

            wf.ExecSqlCmd(cmd);
        }
示例#8
0
        private void GetRecord()
        {
            var cmd = new SqlCommand("select * from View_Bar_Product_SerialNumber where cGuid=@cGuid");

            cmd.Parameters.AddWithValue("@cGuid", _cGuid);
            var wf = new WmsFunction(BaseStructure.WmsCon);

            uGridProBarCode.DataSource = wf.GetSqlTable(cmd);
        }
示例#9
0
        private DataTable GetPrintTable()
        {
            var cmd = new SqlCommand("select * from View_Bar_Product_SerialNumber where cGuid=@cGuid");

            cmd.Parameters.AddWithValue("@cGuid", _cGuid);
            var wf = new WmsFunction(BaseStructure.WmsCon);

            return(wf.GetSqlTable(cmd));
        }
 private void biSearch_ItemClick(object sender, DevExpress.XtraBars.ItemClickEventArgs e)
 {
     var bfun = new WmsFunction(BaseStructure.WmsCon);
     var strTemp = bfun.GetWhereSqlStr("Pro_TransferDeliveryDetail");
     if (string.IsNullOrEmpty(strTemp))
         return;
     pageChange.WhereStr = strTemp;
     pageChange.GetRecord();
     MessageBox.Show(@"查询成功", @"成功");
 }
示例#11
0
        /// <summary>
        /// 是否有权限操作
        /// </summary>
        /// <returns></returns>
        private bool CanOperator(string cKey)
        {
            var cmd = new SqlCommand("select * from BRoleFunction where rCode=@rCode and fCode=@fCode and isnull(bRight,0)=1");

            cmd.Parameters.AddWithValue("@rCode", BaseStructure.LoginRoleId);
            cmd.Parameters.AddWithValue("@fCode", cKey);
            var wf = new WmsFunction(BaseStructure.WmsCon);

            return(wf.BoolExistTable(cmd));
        }
示例#12
0
        private void UpdatePrintNum(int iPrintNum)
        {
            var cmd = new SqlCommand("update SS_Box set iPrintNum=@iPrintNum  where cGuid=@cGuid");

            cmd.Parameters.AddWithValue("@cGuid", _cGuid);
            cmd.Parameters.AddWithValue("@iPrintNum", iPrintNum + 1);
            var wf = new WmsFunction(BaseStructure.WmsCon);

            wf.ExecSqlCmd(cmd);
        }
示例#13
0
        private void btnProDelivery_Click(object sender, EventArgs e)
        {
            var cmd = new SqlCommand("DeleteFromTransfer");

            cmd.CommandType = CommandType.StoredProcedure;
            cmd.Parameters.AddWithValue("@cOrderNumber", txtcOrderNumber.Text);
            cmd.Parameters.AddWithValue("@cOrderType", "Pro_TransferDelivery");
            var wfun = new WmsFunction(BaseStructure.WmsCon);

            wfun.ExecSqlCmd(cmd);
        }
示例#14
0
        private int PrintCount()
        {
            var cmd = new SqlCommand("select top 1 isnull(iPrintNum,1) from SS_Box where cGuid=@cGuid");

            cmd.Parameters.AddWithValue("@cGuid", _cGuid);
            var wf         = new WmsFunction(BaseStructure.WmsCon);
            var ciPrintNum = wf.ReturnFirstSingle(cmd);
            int iPrintNum;

            return(int.TryParse(ciPrintNum, out iPrintNum) ? iPrintNum : 1);
        }
示例#15
0
        private void biSearch_ItemClick(object sender, DevExpress.XtraBars.ItemClickEventArgs e)
        {
            if (beidDate.EditValue == null)
            {
                beidDate.EditValue = DateTime.Now.Date;
            }
            var      cdDate = beidDate.EditValue.ToString();
            DateTime dDate;

            if (!DateTime.TryParse(cdDate, out dDate))
            {
                dDate = DateTime.Now.Date;
            }
            //通过WebService获取报单系统数据
            var js = new CompareService.EasAndWmsCompareReport();

            var easData = js.GetMoveMaterialReq(dDate);

            var wf    = new WmsFunction(BaseStructure.WmsCon);
            var cGuid = Guid.NewGuid();

            //写临时表
            for (var i = 0; i < easData.Rows.Count; i++)
            {
                var cmdInsertTemp = new SqlCommand("insert into Tmp_Compare(cInvCode,cInvName,iQuantity,cUnit,cGuid,cOrderNumber) " +
                                                   "Values(@cInvCode,@cInvName,@iQuantity,@cUnit,@cGuid,@cOrderNumber)");
                cmdInsertTemp.Parameters.AddWithValue("@cInvCode", easData.Rows[i]["cInvCode"].ToString());
                cmdInsertTemp.Parameters.AddWithValue("@cInvName", easData.Rows[i]["cInvName"].ToString());
                cmdInsertTemp.Parameters.AddWithValue("@iQuantity", easData.Rows[i]["iSumQuantity"].ToString());
                cmdInsertTemp.Parameters.AddWithValue("@cUnit", easData.Rows[i]["cUnit"].ToString());
                cmdInsertTemp.Parameters.AddWithValue("@cGuid", cGuid);
                cmdInsertTemp.Parameters.AddWithValue("@cOrderNumber", easData.Rows[i]["cOrderNumber"].ToString());
                wf.ExecSqlCmd(cmdInsertTemp);
            }

            var cmd = new SqlCommand("CompareProduceDetail")
            {
                CommandType = CommandType.StoredProcedure
            };

            cmd.Parameters.AddWithValue("@dDate", dDate);
            cmd.Parameters.AddWithValue("@cGuid", cGuid);

            uGridProBoxBarCode.DataSource = wf.GetSqlTable(cmd);

            var cmdDelete = new SqlCommand("Delete from Tmp_Compare where cGuid=@cGuid");

            cmdDelete.Parameters.AddWithValue("@cGuid", cGuid);
            wf.ExecSqlCmd(cmdDelete);

            tsgfMain.GetGridStyle(tsgfMain.FormId);
        }
示例#16
0
        private DataTable GetInvAndQuantity(string cInvCode, string cOrderNumber, string cGuid)
        {
            var sqlcmd = "GetSSRptOrderDetail";
            var cmd    = new SqlCommand(sqlcmd);

            cmd.CommandType = CommandType.StoredProcedure;
            cmd.Parameters.AddWithValue("@cGuid", cGuid);
            cmd.Parameters.AddWithValue("@cOrderNumber", cOrderNumber);
            cmd.Parameters.AddWithValue("@cInvCode", cInvCode);
            var wf = new WmsFunction(BaseStructure.WmsCon);

            return(wf.GetSqlTable(cmd));
        }
示例#17
0
        private void btnSubmit_Click(object sender, EventArgs e)
        {
            var wf      = new WmsFunction(BaseStructure.WmsCon);
            var PlusCmd = new SqlCommand("update SS_Detail set cBoxNumber=@cBoxNumber where cOrderNumber=@cOrderNumber and cBoxNumber=@cOldBoxNumber ");

            PlusCmd.Parameters.AddWithValue("@cOrderNumber", _cOrderNumber);
            PlusCmd.Parameters.AddWithValue("@cBoxNumber", txtcNewBoxNumber.Text);
            PlusCmd.Parameters.AddWithValue("@cOldBoxNumber", txtcOrgBoxNumber.Text);


            wf.ExecSqlCmd(PlusCmd);
            DialogResult = DialogResult.OK;
        }
示例#18
0
        private void biSearch_ItemClick(object sender, DevExpress.XtraBars.ItemClickEventArgs e)
        {
            var bfun    = new WmsFunction(BaseStructure.WmsCon);
            var strTemp = bfun.GetWhereSqlStr("WMSSS_Detail");

            if (string.IsNullOrEmpty(strTemp))
            {
                return;
            }
            pageListMain.Condition = "View_WmsSSDetail where " + strTemp;
            pageListMain.WhereStr  = strTemp;
            pageListMain.GetRecord();
            MessageBox.Show(@"查询成功", @"成功");
        }
示例#19
0
        /// <summary>
        /// 根据扫描的周转箱序列号取得该的周转箱的批号
        /// </summary>
        /// <param name="cSerialNumber"></param>
        /// <returns></returns>
        private string GetProductBoxLotNo(string cSerialNumber)
        {
            var wf     = new WmsFunction(BaseStructure.WmsCon);
            var LotCmd = new SqlCommand("select cLotNo,cInvName from  View_Bar_Product_Box_SerialNumber where cSerialNumber=@cSerialNumber");

            LotCmd.Parameters.AddWithValue("@cSerialNumber", cSerialNumber);
            var dt = wf.GetSqlTable(LotCmd);

            if (dt == null || dt.Rows.Count < 1)
            {
                return(string.Empty);
            }
            return(dt.Rows[0]["cLotNo"].ToString());
        }
示例#20
0
        private bool GetLotMgr()
        {
            var wf         = new WmsFunction(BaseStructure.WmsCon);
            var bOutAllCmd = new SqlCommand("select isnull(bLotMgr,0) bLotMgr from IT_Product where cInvCode=@cInvCode");

            bOutAllCmd.Parameters.AddWithValue("@cInvCode", lblcInvCode.Text);
            bool bLotMgr;
            var  cLotMgr = wf.ReturnFirstSingle(bOutAllCmd);

            if (bool.TryParse(cLotMgr, out bLotMgr))
            {
                return(bLotMgr);
            }
            return(false);
        }
示例#21
0
        private void WmsRibbonMain_Load(object sender, EventArgs e)
        {
            ToUpdateNoMessage();
            //设置状态栏显示内容
            uStatusBar.Panels[4].MarqueeInfo.Start();
            uStatusBar.Panels["tssl_Lname"].Text   = @"操作员:" + BaseStructure.LoginName;
            uStatusBar.Panels["tssl_Lserver"].Text = @"Server:" + BaseStructure.WmsServer;
            var wmc = new WmsMainChild {
                MdiParent = this
            };

            wmc.Show();

            WmsFunction.GridFilter_Customizer();
            GetMenuAuthority();
        }
示例#22
0
        private void GetWareHouse()
        {
            var wf = new WmsFunction(BaseStructure.WmsCon);

            var cmd =
                new SqlCommand("select * from WareHouse");
            var dt = wf.GetSqlTable(cmd);

            if (dt == null)
            {
                return;
            }
            cbxWarehouse.DisplayMember = "cWhName";
            cbxWarehouse.ValueMember   = "cWhCode";
            cbxWarehouse.DataSource    = dt;
        }
示例#23
0
        private void tsbtnAdd_Click(object sender, EventArgs e)
        {
            var wf     = new WmsFunction(BaseStructure.WmsCon);
            var lotCmd = new SqlCommand("GenerateOrderNumber")
            {
                CommandType = CommandType.StoredProcedure
            };

            lotCmd.Parameters.AddWithValue("@cPrelix", "YFTF");
            lotCmd.Parameters.AddWithValue("@cType", "销售退货");
            lotCmd.Parameters.AddWithValue("@cOperator", BaseStructure.LoginName);
            lblcOrderNumber.Text = wf.ReturnFirstSingle(lotCmd);
            dataProductMain.SS_DeliveryReturn.Rows.Clear();
            txtcBarCode.Enabled = true;
            txtcBarCode.Text    = "";
        }
示例#24
0
        /// <summary>
        /// 根据商品码取得虚拟条码
        /// </summary>
        /// <param name="cBarCode"></param>
        /// <returns></returns>
        private string GetInventoryMapping(string cBarCode)
        {
            var wf  = new WmsFunction(BaseStructure.WmsCon);
            var cmd = new SqlCommand("select  cVirtualBarCode,cInvName  from BInventoryMapping where cEBarCode=@cEBarCode");

            cmd.Parameters.AddWithValue("@cEBarCode", cBarCode);

            var dt = wf.GetSqlTable(cmd);

            if (dt == null || dt.Rows.Count < 1)
            {
                return(string.Empty);
            }
            txtcInvName.Text = dt.Rows[0]["cInvName"].ToString();
            return(dt.Rows[0]["cVirtualBarCode"].ToString());
        }
示例#25
0
        private void biSearch_ItemClick(object sender, DevExpress.XtraBars.ItemClickEventArgs e)
        {
            var bfun    = new WmsFunction(BaseStructure.WmsCon);
            var strTemp = bfun.GetWhereSqlStr("View_SFOrderAndWmsEAS");

            if (string.IsNullOrEmpty(strTemp))
            {
                return;
            }

            pageListMain.Condition = " View_SFOrderAndWmsEAS where " + strTemp;
            pageListMain.WhereStr  = strTemp;
            pageListMain.GetRecord();

            WmsFunction.VLogDebug("biSearch_ItemClick", pageListMain.Condition + "/" + pageListMain.WhereStr);
            MessageBox.Show(@"查询成功", @"成功");
        }
示例#26
0
        // <summary>
        /// 判断出库的产品是否包含在出库单中
        /// </summary>
        /// <param name="cInvCode"></param>
        /// <returns></returns>
        private bool JudgeInvCode(string cInvCode)
        {
            var wf         = new WmsFunction(BaseStructure.WmsCon);
            var bOutAllCmd = new SqlCommand("select cInvCode,cInvName from IT_Product where cInvCode=@cInvCode");

            bOutAllCmd.Parameters.AddWithValue("@cInvCode", cInvCode);
            var dt = wf.GetSqlTable(bOutAllCmd);

            if (dt == null || dt.Rows.Count < 1)
            {
                MessageBox.Show(@"非系统产品!");
                txtcBarCode.Text = "";
                txtcBarCode.Focus();
                return(false);
            }
            txtcInvName.Text = dt.Rows[0]["cInvName"].ToString();

            return(true);
        }
示例#27
0
        private void biSave_ItemClick(object sender, DevExpress.XtraBars.ItemClickEventArgs e)
        {
            if (string.IsNullOrEmpty(utecBoxNumber.Text))
            {
                MessageBox.Show(@"箱号必输");
                return;
            }


            var cmd = new SqlCommand("update SS_Box set iWeight=@iWeight,dWeight=Getdate() where cBoxNumber=@cBoxNumber");

            cmd.Parameters.AddWithValue("@iWeight", uteiWeight.Value ?? 0);
            cmd.Parameters.AddWithValue("@cBoxNumber", utecBoxNumber.Text);

            var wf = new WmsFunction(BaseStructure.WmsCon);

            if (wf.ExecSqlCmd(cmd))
            {
                MessageBox.Show(@"箱重量更新成功");
            }
            else
            {
                MessageBox.Show(@"更新失败,请检查箱号是否存在!");
                return;
            }

            var GetBoxCmd = new SqlCommand("select * from SS_Box where cBoxNumber=@cBoxNumber");

            GetBoxCmd.Parameters.AddWithValue("@cBoxNumber", utecBoxNumber.Text);
            var dtSource = wf.GetSqlTable(GetBoxCmd);

            if (dtSource != null)
            {
                uGridOutBox.DataSource = dtSource;
            }


            biSave.Enabled        = false;
            biAddNew.Enabled      = true;
            utecBoxNumber.Enabled = false;
            dtpdDate.Enabled      = false;
        }
示例#28
0
        private void WorkLotReApprove_Load(object sender, EventArgs e)
        {
            var wf        = new WmsFunction(BaseStructure.WmsCon);
            var getConfig = new SqlCommand("select cValue EasUser,cMemo EasUserPwd,cDefine1 EasDataCenter from  BSetting where cName='EasInterface'");
            var dt        = wf.GetSqlTable(getConfig);

            if (dt == null || dt.Rows.Count < 1)
            {
                txtUser.Text       = @"yofoto";
                txtPwd.Text        = @"000000";
                txtDataCenter.Text = @"P001";
            }
            else
            {
                txtUser.Text = dt.Rows[0]["EasUser"].ToString();
                txtPwd.Text  = dt.Rows[0]["EasUserPwd"].ToString();
                //txtDataCenter.Text = dt.Rows[0]["EasDataCenter"].ToString();
                txtDataCenter.Text = @"P001";
            }
        }
示例#29
0
        private void tsbtnUpdate_Click(object sender, EventArgs e)
        {
            if (txtcInvCode.Value == null || string.IsNullOrEmpty(txtcInvCode.Value.ToString()))
            {
                MessageBox.Show(@"产品编码必输");
                return;
            }
            if (!WmsFunction.IsNumAndEnCh(tstxtLotNo.Text))
            {
                MessageBox.Show(@"请输入正确的批次格式,只允许有数字与字母");
                return;
            }
            var cmd = new SqlCommand("update Bar_Product_Box_SerialNumber set cLotNo='" + tstxtLotNo.Text + "' where cSerialNumber in " +
                                     "(select cSerialNumber from View_Bar_Product_Box_SerialNumber where " + pageChange.WhereStr + ")");

            var wf = new WmsFunction(BaseStructure.WmsCon);

            wf.ExecSqlCmd(cmd);
            pageChange.GetRecord();
            DllWmsMain.RecordLogAction(@"周转箱更新批号", BaseStructure.LoginName + " 更新了" + pageChange.WhereStr + "范围的批号  " + tstxtLotNo.Text);
        }
示例#30
0
        private void GetReturnHistory()
        {
            var wf = new WmsFunction(BaseStructure.WmsCon);

            var cmd =
                new SqlCommand(
                    "select top 100 cOrderNumber,cOrderNumber+'----'+cOperator as cDisplayText from Log_OrderNumber where cType='销售退货'");
            var dt = wf.GetSqlTable(cmd);

            if (dt == null)
            {
                return;
            }

            if (tscbxReturnHistory.ComboBox != null)
            {
                tscbxReturnHistory.ComboBox.DisplayMember = "cDisplayText";
                tscbxReturnHistory.ComboBox.ValueMember   = "cOrderNumber";
                tscbxReturnHistory.ComboBox.DataSource    = dt;
            }
        }