示例#1
0
        private void WorkTrackDeliveryOrder_Load(object sender, EventArgs e)
        {
            proDeliveryDetailTableAdapter.Connection.ConnectionString = BaseStructure.WmsCon;
            if (string.IsNullOrEmpty(_lid))
            {
                SetPanelVlaue("", "btnLast");
            }
            else
            {
                SetPanelVlaue(_lid);
            }

            //智能匹配数据源
            var cmd = new SqlCommand("select top 100 cCode from ProDelivery order by AutoID desc");
            cmd.Parameters.AddWithValue("@cCode", txtQuery.Text);
            var wf = new WmsFunction(BaseStructure.WmsCon);
            txtQuery.DataSource = wf.GetSqlTable(cmd);


            //初始化表格功能控件
            tsgfMain.FormId = Name.GetHashCode().ToString(CultureInfo.CurrentCulture);
            tsgfMain.FormName = Text;
            tsgfMain.Constr = BaseStructure.WmsCon;
            tsgfMain.GetGridStyle(tsgfMain.FormId);
        }
示例#2
0
 private void GetRawMaterial()
 {
     var cmd = new SqlCommand("select   a.FItemID,a.FNumber,a.FName,FModel,FFullName,FDefaultLoc,FSPID,a.FUnitID,b.FName FUnitName from t_icitem a inner join t_MeasureUnit b on a.FUnitID=b.FMeasureUnitID where isnull(a.FDeleted,0)<>1 order by a.FitemID");
     var wf = new WmsFunction(BaseStructure.KisConstring);
     _dtRawMaterial = wf.GetSqlTable(cmd);
     txtcInvCode.DataSource = _dtRawMaterial;
 }
        private void WorkTrackDeliveryOrder_Load(object sender, EventArgs e)
        {
            proDeliveryDetailTableAdapter.Connection.ConnectionString = BaseStructure.WmsCon;
            if (string.IsNullOrEmpty(_lid))
            {
                SetPanelVlaue("", "btnLast");
            }
            else
            {
                SetPanelVlaue(_lid);
            }

            //智能匹配数据源
            var cmd = new SqlCommand("select top 100 cCode from ProDelivery order by AutoID desc");

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

            txtQuery.DataSource = wf.GetSqlTable(cmd);


            //初始化表格功能控件
            tsgfMain.FormId   = Name.GetHashCode().ToString(CultureInfo.CurrentCulture);
            tsgfMain.FormName = Text;
            tsgfMain.Constr   = BaseStructure.WmsCon;
            tsgfMain.GetGridStyle(tsgfMain.FormId);
        }
示例#4
0
        /// <summary>
        /// 判断什么未填写,返回对应的标签
        /// </summary>
        /// <returns></returns>
        private string CheckNull()
        {
            if (string.IsNullOrEmpty(txtcInvCode.Text))
            {
                return("编码");
            }
            //if (string.IsNullOrEmpty(txtcOrderNumber.Text))
            //    return "客户订单号";
            if (string.IsNullOrEmpty(txtFBatchNo.Text))
            {
                return("生产批号");
            }
            if (!dtpdDate.Checked)
            {
                return("日期");
            }
            var cmdInvCode = new SqlCommand("select * from t_icItem where FNumber=@FNumber");

            cmdInvCode.Parameters.AddWithValue("@FNumber", txtcInvCode.Value);
            var wfun = new WmsFunction(BaseStructure.KisConstring);

            if (!wfun.BoolExistTable(cmdInvCode))
            {
                return(@"编码不正确,编码");
            }
            //if (dataInventory.ShiftDetail.Rows.Count < 1)
            //    return "子件";
            return(uneiQuantity.Value == null || string.IsNullOrEmpty(uneiQuantity.Value.ToString()) ? "数量" : string.Empty);
        }
示例#5
0
        /// <summary>
        /// 判断什么未填写,返回对应的标签
        /// </summary>
        /// <returns></returns>
        private string CheckNull()
        {
            if (string.IsNullOrEmpty(txtcInvCode.Text))
            {
                return("编码");
            }
            if (string.IsNullOrEmpty(txtcLotNo.Text))
            {
                return("批号");
            }
            if (!dtpdDate.Checked)
            {
                return("日期");
            }
            if (!dtpcDefine2.Checked)
            {
                return("供应商生产日期");
            }
            if (dtpcDefine2.Value > dtpdDate.Value)
            {
                return("供应商生产日期必需小于进货日期");
            }
            var cmdInvCode = new SqlCommand("select * from t_icItem where FNumber=@FNumber");

            cmdInvCode.Parameters.AddWithValue("@FNumber", txtcInvCode.Value);
            var wfun = new WmsFunction(BaseStructure.KisConstring);

            if (!wfun.BoolExistTable(cmdInvCode))
            {
                return(@"编码不正确,编码");
            }
            return(uneiQuantity.Value == null || string.IsNullOrEmpty(uneiQuantity.Value.ToString()) ? "数量" : string.Empty);
        }
示例#6
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;
            }
        }
示例#7
0
        private void biAddNew_ItemClick(object sender, DevExpress.XtraBars.ItemClickEventArgs e)
        {
            //判断什么为填写
            var nullstr = CheckNull();

            if (!string.IsNullOrEmpty(nullstr))
            {
                MessageBox.Show(nullstr + @" 数据异常,请先完成班次制令单后,
再操作此功能", @"错误", MessageBoxButtons.OK, MessageBoxIcon.Warning);
                return;
            }
            using (
                var wpc = new WorkTrackProductLabelCreate(txtcInvCode.Text, utecInvName.Text, txtcOrderNumber.Text,
                                                          dtpdDate.Value.ToShortDateString()))
            {
                if (wpc.ShowDialog() != DialogResult.Yes)
                {
                    return;
                }
                var wf  = new WmsFunction(BaseStructure.WmsCon);
                var cmd = new SqlCommand("proc_GenerateProductLabel")
                {
                    CommandType = CommandType.StoredProcedure
                };
                cmd.Parameters.AddWithValue("@cSerialNumber", lblTitleMain.lblcSerialNumber.Text);
                cmd.Parameters.AddWithValue("@iQuantity", wpc.Quantity);
                cmd.Parameters.AddWithValue("@SerialQty", wpc.SerialQty);
                cmd.Parameters.AddWithValue("@cMemo", wpc.Memo);
                wf.ExecSqlCmd(cmd);
                productLabelTableAdapter.Fill(dataInventory.ProductLabel, lblTitleMain.lblcSerialNumber.Text);
            }
        }
示例#8
0
 /// <summary>
 /// 判断是否登录成功
 /// </summary>
 /// <returns></returns>
 public static bool OkLogin(string uName, string uPassword)
 {
     using (var con = new SqlConnection(BaseStructure.WmsCon))
     {
         using (var cmd = new SqlCommand {
             Connection = con
         })
         {
             cmd.CommandText = "select * from View_BUserRole where (cCode=@cCode or cName=@cCode) and cPwd=@cPwd";
             cmd.Parameters.AddWithValue("@cCode", uName);
             cmd.Parameters.AddWithValue("@cPwd", WmsFunction.GetMd5Hash(uPassword));
             con.Open();
             using (var dr = cmd.ExecuteReader(CommandBehavior.CloseConnection))
             {
                 if (dr.Read())                                            //直接登陆
                 {
                     BaseStructure.LoginId       = dr["cCode"].ToString(); //把登陆名和登陆服务器保存到静态变量中
                     BaseStructure.LoginName     = dr["cName"].ToString();
                     BaseStructure.LoginRoleId   = dr["rCode"].ToString();
                     BaseStructure.LoginRoleName = dr["rName"].ToString();
                     return(true);
                 }
                 MessageBox.Show(@"用户名或密码错误,请联系管理员!", @"Warning", MessageBoxButtons.OK, MessageBoxIcon.Warning);
                 return(false);
             }
         }
     }
 }
示例#9
0
        private void GetRawMaterial()
        {
            var cmd = new SqlCommand("select   a.FItemID,a.FNumber,a.FName,FModel,FFullName,FDefaultLoc,FSPID,a.FUnitID,b.FName FUnitName from t_icitem a inner join t_MeasureUnit b on a.FUnitID=b.FMeasureUnitID where isnull(a.FDeleted,0)<>1 order by a.FitemID");
            var wf  = new WmsFunction(BaseStructure.KisConstring);

            _dtRawMaterial         = wf.GetSqlTable(cmd);
            txtcInvCode.DataSource = _dtRawMaterial;
        }
示例#10
0
        private DataTable GetPrintData()
        {
            var cmd = new SqlCommand("select * from View_ProductLabel where cSerialNumber=@cSerialNumber");

            cmd.Parameters.AddWithValue("@cSerialNumber", lblTitleMain.lblcSerialNumber.Text);
            var wf = new WmsFunction(BaseStructure.WmsCon);

            return(wf.GetSqlTable(cmd));
        }
示例#11
0
        private void GetCurrentStock(string cFitemList)
        {
            var cmd = new SqlCommand(@" select a.FItemID,b.FNumber,b.FName,a.FQty Quantity,b.FModel,b.FFullName,a.FBatchNo,a.FStockID,
c.FNumber FStockNumber,c.FName FStockName,a.FStockPlaceID,d.FNumber FStockPlaceNumber,d.FName FStockPlaceName
from ICInventory a inner join t_ICItem b on a.FItemID=b.FItemID 
inner join t_Stock c on a.FStockID=c.FItemID inner join t_StockPlace d on a.FStockPlaceID=d.FSPID
where a.FQty>0 and a.FItemID in(" + cFitemList + ")   order by a.FItemID,a.FBatchNo,a.FStockID,a.FStockPlaceID ");
            var wf = new WmsFunction(BaseStructure.KisConstring);
            uGridCurrentStock.DataSource = wf.GetSqlTable(cmd);
        }
示例#12
0
 private void biSearch_ItemClick(object sender, DevExpress.XtraBars.ItemClickEventArgs e)
 {
     var bfun = new WmsFunction(BaseStructure.WmsCon);
     var strTemp = bfun.GetWhereSqlStr("RmStoreDetail");
     if (string.IsNullOrEmpty(strTemp))
         return;
     pageChange.WhereStr = strTemp;
     pageChange.GetRecord();
     MessageBox.Show(@"查询成功", @"成功");
 }
示例#13
0
        private void GetCurrentStock(string cFitemList)
        {
            var cmd = new SqlCommand(@" select a.FItemID,b.FNumber,b.FName,a.FQty Quantity,b.FModel,b.FFullName,a.FBatchNo,a.FStockID,
c.FNumber FStockNumber,c.FName FStockName,a.FStockPlaceID,d.FNumber FStockPlaceNumber,d.FName FStockPlaceName
from ICInventory a inner join t_ICItem b on a.FItemID=b.FItemID 
inner join t_Stock c on a.FStockID=c.FItemID inner join t_StockPlace d on a.FStockPlaceID=d.FSPID
where a.FQty>0 and a.FItemID in(" + cFitemList + ")   order by a.FItemID,a.FBatchNo,a.FStockID,a.FStockPlaceID ");
            var wf  = new WmsFunction(BaseStructure.KisConstring);

            uGridCurrentStock.DataSource = wf.GetSqlTable(cmd);
        }
示例#14
0
        private void GetProduct()
        {
            var cmd = new SqlCommand("Select * from Bom");
            var wf  = new WmsFunction(BaseStructure.WmsCon);

            BomList = wf.GetSqlTable(cmd);
            txtcInvCode.DataSource = BomList;
            var cmdVendor = new SqlCommand("select FNumber,FName from t_Department order by FNumber");

            wf.Constr           = BaseStructure.KisConstring;
            txtcDept.DataSource = wf.GetSqlTable(cmdVendor);
        }
示例#15
0
        private void SetLotNoSourceAndRecentVendor()
        {
            if (!biSave.Enabled)
            {
                return;
            }
            var wf  = new WmsFunction(BaseStructure.KisConstring);
            var cmd = new SqlCommand("select FBatchNo,FQty from ICInventory where FitemID=@FItemID and FQty>0 order by FBatchNo desc");

            cmd.Parameters.AddWithValue("@FItemID", _FitemId);
            txtcLotNo.DataSource = wf.GetSqlTable(cmd);
        }
示例#16
0
        private void RefreshData(string cOrderNumber)
        {
            var cmd =
                new SqlCommand(
                    @"select top 100 FInterID,ICInvBackup.FBillNo,FDate,FStockID,ICInvBackup.FStatus,FBillerID,FCheckerID,FCheckDate, 
t_User.FName CreateName,temp.FName CheckName,t_Stock.FName CheckWareHouse 
from ICInvBackup left join t_Stock on ICInvBackup.FStockID=t_Stock.FItemID 
left join t_User on ICInvBackup.FBillerID=t_User.FUserID 
left join t_User temp on ICInvBackup.FCheckerID=temp.FUserID where ICInvBackup.FBillNo like '%" + cOrderNumber + "%' order by FInterID desc");
            var wmf = new WmsFunction(BaseStructure.KisConstring);
            uGridCheck.DataSource = wmf.GetSqlTable(cmd);
        }
示例#17
0
        private void biSearch_ItemClick(object sender, DevExpress.XtraBars.ItemClickEventArgs e)
        {
            var bfun    = new WmsFunction(BaseStructure.WmsCon);
            var strTemp = bfun.GetWhereSqlStr("RmStoreDetail");

            if (string.IsNullOrEmpty(strTemp))
            {
                return;
            }
            pageChange.WhereStr = strTemp;
            pageChange.GetRecord();
            MessageBox.Show(@"查询成功", @"成功");
        }
示例#18
0
        private void RefreshData(string cOrderNumber)
        {
            var cmd =
                new SqlCommand(
                    @"select top 100 FInterID,ICInvBackup.FBillNo,FDate,FStockID,ICInvBackup.FStatus,FBillerID,FCheckerID,FCheckDate, 
t_User.FName CreateName,temp.FName CheckName,t_Stock.FName CheckWareHouse 
from ICInvBackup left join t_Stock on ICInvBackup.FStockID=t_Stock.FItemID 
left join t_User on ICInvBackup.FBillerID=t_User.FUserID 
left join t_User temp on ICInvBackup.FCheckerID=temp.FUserID where ICInvBackup.FBillNo like '%" + cOrderNumber + "%' order by FInterID desc");
            var wmf = new WmsFunction(BaseStructure.KisConstring);

            uGridCheck.DataSource = wmf.GetSqlTable(cmd);
        }
示例#19
0
        private void RefreshData(string cOrderNumber)
        {
            var cmd =
                new SqlCommand(
                    @"select top 100 FInterID,POInstock.FBillNo,FSupplyID,FDate,POInstock.FStatus,FBillerID,FCheckerID,FCheckDate,
t_Supplier.FName,t_User.FName CreateName,temp.FName CheckName
from POInstock inner join t_Supplier on POInstock.FSupplyID=t_Supplier.FItemID
inner join t_User on POInstock.FBillerID=t_User.FUserID 
left join t_User temp on POInstock.FCheckerID=temp.FUserID  where  POInstock.FStatus in (1,2) and POInstock.FInterID in 
(select distinct FInterID from POInStockEntry where FAuxConCommitQty = 0) and POOrder.FBillNo like '%" + cOrderNumber + "%' order by FInterID desc");
            var wmf = new WmsFunction(BaseStructure.KisConstring);
            uGridCheck.DataSource = wmf.GetSqlTable(cmd);
        }
示例#20
0
        private void RefreshData(string cOrderNumber)
        {
            var cmd =
                new SqlCommand(
                    @"select top 100 FInterID,POInstock.FBillNo,FSupplyID,FDate,POInstock.FStatus,FBillerID,FCheckerID,FCheckDate,
t_Supplier.FName,t_User.FName CreateName,temp.FName CheckName
from POInstock inner join t_Supplier on POInstock.FSupplyID=t_Supplier.FItemID
inner join t_User on POInstock.FBillerID=t_User.FUserID 
left join t_User temp on POInstock.FCheckerID=temp.FUserID  where  POInstock.FStatus in (1,2) and POInstock.FInterID in 
(select distinct FInterID from POInStockEntry where FAuxConCommitQty = 0) and POOrder.FBillNo like '%" + cOrderNumber + "%' order by FInterID desc");
            var wmf = new WmsFunction(BaseStructure.KisConstring);

            uGridCheck.DataSource = wmf.GetSqlTable(cmd);
        }
示例#21
0
        /// <summary>
        /// 获取原料批号所有被使用的产成品序列号
        /// </summary>
        private void Query_RmTrackingUseInProduct()
        {
            if (string.IsNullOrEmpty(biRmcInvCode.EditValue.ToString()) ||
                string.IsNullOrEmpty(biRmLotNo.EditValue.ToString()))
                return;

            uGridRawMaterial.Text = string.Format("原料编码 {0}   原料批号:{1}", biRmcInvCode.EditValue, biRmLotNo.EditValue);
            var cmd = new SqlCommand("Query_RmTrackingUseInProduct") {CommandType = CommandType.StoredProcedure};
            cmd.Parameters.AddWithValue("@cInvCode", biRmcInvCode.EditValue);
            cmd.Parameters.AddWithValue("@FBatchNo", biRmLotNo.EditValue);
            var wf = new WmsFunction(BaseStructure.WmsCon);

            uGridRawMaterial.DataSource = wf.GetSqlTable(cmd);
            MessageBox.Show(@"成功查询", @"成功", MessageBoxButtons.OK, MessageBoxIcon.Information);
        }
示例#22
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");
            var rCode = BaseStructure.LoginRoleId;

            if (string.IsNullOrEmpty(rCode))
            {
                rCode = BaseStructure.LoginId;
            }
            cmd.Parameters.AddWithValue("@rCode", rCode);
            cmd.Parameters.AddWithValue("@fCode", cKey);
            var wf = new WmsFunction(BaseStructure.WmsCon);

            return(wf.BoolExistTable(cmd));
        }
示例#23
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);
        }
示例#24
0
        private void RefreshData()
        {
            var cmd =
                new SqlCommand(
                    @"select top 100 FInterID,ICStockBIll.FBillNo,FDCStockID,FSCStockID,FDate,ICStockBIll.FStatus,FBillerID,FCheckerID,FCheckDate,
t_User.FName CreateName,temp.FName CheckName,t_Stock.FName StoreWareHouse,tStock.FName DeliveryWareHouse
from ICStockBIll left join t_Stock on ICStockBIll.FDCStockID=t_Stock.FItemID
left join t_Stock tStock on ICStockBIll.FSCStockID=tStock.FItemID
left join t_User on ICStockBIll.FBillerID=t_User.FUserID 
left join t_User temp on ICStockBIll.FCheckerID=temp.FUserID
where ICStockBIll.FTranType=41
order by FInterID desc");
            var wmf = new WmsFunction(BaseStructure.KisConstring);
            uGridCheck.DataSource = wmf.GetSqlTable(cmd);
        }
示例#25
0
        private void WmsRibbonMain_Load(object sender, EventArgs e)
        {
            //设置状态栏显示内容
            uStatusBar.Panels[4].MarqueeInfo.Start();
            uStatusBar.Panels["tssl_Lname"].Text   = @"操作员:" + BaseStructure.LoginName;
            uStatusBar.Panels["tssl_Lserver"].Text = @"Server:" + BaseStructure.WmsServer;
            uStatusBar.Panels["cCompany"].Text     = Properties.Settings.Default.cCompany;
            var wmc = new WmsMainChild {
                MdiParent = this
            };

            wmc.Show();

            WmsFunction.GridFilter_Customizer();
            GetMenuAuthority();
        }
示例#26
0
        private void RefreshData()
        {
            var cmd =
                new SqlCommand(
                    @"select top 100 FInterID,ICStockBIll.FBillNo,FDCStockID,FSCStockID,FDate,ICStockBIll.FStatus,FBillerID,FCheckerID,FCheckDate,
t_User.FName CreateName,temp.FName CheckName,t_Stock.FName StoreWareHouse,tStock.FName DeliveryWareHouse
from ICStockBIll left join t_Stock on ICStockBIll.FDCStockID=t_Stock.FItemID
left join t_Stock tStock on ICStockBIll.FSCStockID=tStock.FItemID
left join t_User on ICStockBIll.FBillerID=t_User.FUserID 
left join t_User temp on ICStockBIll.FCheckerID=temp.FUserID
where ICStockBIll.FTranType=41
order by FInterID desc");
            var wmf = new WmsFunction(BaseStructure.KisConstring);

            uGridCheck.DataSource = wmf.GetSqlTable(cmd);
        }
示例#27
0
        private void BaseRoleFunction_Load(object sender, EventArgs e)
        {
            uGridRole_Function.DisplayLayout.ValueLists.Add("roleList");
            uGridRole_Function.DisplayLayout.ValueLists.Add("functionList");
            //设置连接并载入数据
            roleFunctionTableAdapter.Connection.ConnectionString = BaseStructure.WmsCon;
            bFunctionTableAdapter.Connection.ConnectionString    = BaseStructure.WmsCon;
            bRoleTableAdapter.Connection.ConnectionString        = BaseStructure.WmsCon;
            bFunctionTableAdapter.Fill(baseDs.BFunction);

            var wf = new WmsFunction(BaseStructure.WmsCon);

            uGridRole.DataSource = wf.GetSqlTable("SELECT * from View_RoleAndUser");

            SetFunctionDropDownList();
            //SetRoleDropDownList();
        }
示例#28
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["FBillNo"].Value.ToString();
            _iRowNo = e.Cell.Row.Index;
            if (!int.TryParse(e.Cell.Row.Cells["FinterID"].Value.ToString(), out _FinterID))
                return;
            var cmd =
                new SqlCommand(
                    @"select ICStockBIllEntry.FItemID,ICStockBIllEntry.FEntryID,FShortNumber,FNumber,FModel,FName,FQty 
from ICStockBIllEntry inner join t_ICItem on ICStockBIllEntry.FItemID=t_ICItem.FItemID
where FInterID=@FinterID");
            cmd.Parameters.AddWithValue("@FinterID", _FinterID);
            var wmf = new WmsFunction(BaseStructure.KisConstring);
            uGridChecks.DataSource = wmf.GetSqlTable(cmd);
        }
示例#29
0
        private void uGridShiftDetail_DoubleClickCell(object sender, Infragistics.Win.UltraWinGrid.DoubleClickCellEventArgs e)
        {
            var wf  = new WmsFunction(BaseStructure.WmsCon);
            var cmd = new SqlCommand("select * from RmLabel where cInvCode=@cInvCode and cLotNo=@cLotNo");

            cmd.Parameters.AddWithValue("@cInvCode", e.Cell.Row.Cells["cInvCode"].Value.ToString());
            cmd.Parameters.AddWithValue("@cLotNo", e.Cell.Row.Cells["FBatchNo"].Value.ToString());

            var dt = wf.GetSqlTable(cmd);

            if (dt == null || dt.Rows.Count < 1)
            {
                MessageBox.Show(@"当前批号,未在原料标签打印记录中,请手动在原料标签打印中,打印!", @"异常", MessageBoxButtons.OK, MessageBoxIcon.Warning);

                return;
            }
            PrintDialogRm("print", e.Cell.Row, dt);
        }
示例#30
0
        /// <summary>
        /// 审核
        /// </summary>
        private void Approve()
        {
            var cmd = new SqlCommand("ApproveProDelivery")
            {
                CommandType = CommandType.StoredProcedure
            };
            var prs = new[]
            {
                new SqlParameter("@AutoID", lblAutoID.Text),
                new SqlParameter("@cHandler", BaseStructure.LoginName)
            };

            cmd.Parameters.AddRange(prs);
            var wf = new WmsFunction(BaseStructure.WmsCon);

            if (wf.ExecSqlCmd(cmd))
            {
                SetPanelVlaue(lblAutoID.Text);
            }
        }
示例#31
0
        /// <summary>
        /// 获取原料批号所有被使用的产成品序列号
        /// </summary>
        private void Query_RmTrackingUseInProduct()
        {
            if (string.IsNullOrEmpty(biRmcInvCode.EditValue.ToString()) ||
                string.IsNullOrEmpty(biRmLotNo.EditValue.ToString()))
            {
                return;
            }

            uGridRawMaterial.Text = string.Format("原料编码 {0}   原料批号:{1}", biRmcInvCode.EditValue, biRmLotNo.EditValue);
            var cmd = new SqlCommand("Query_RmTrackingUseInProduct")
            {
                CommandType = CommandType.StoredProcedure
            };

            cmd.Parameters.AddWithValue("@cInvCode", biRmcInvCode.EditValue);
            cmd.Parameters.AddWithValue("@FBatchNo", biRmLotNo.EditValue);
            var wf = new WmsFunction(BaseStructure.WmsCon);

            uGridRawMaterial.DataSource = wf.GetSqlTable(cmd);
            MessageBox.Show(@"成功查询", @"成功", MessageBoxButtons.OK, MessageBoxIcon.Information);
        }
示例#32
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["FBillNo"].Value.ToString();
            _iRowNo       = e.Cell.Row.Index;
            if (!int.TryParse(e.Cell.Row.Cells["FinterID"].Value.ToString(), out _FinterID))
            {
                return;
            }
            var cmd =
                new SqlCommand(
                    @"select POInstockEntry.FItemID,POInstockEntry.FEntryID,FShortNumber,FNumber,FModel,FName,FQty 
from POInstockEntry inner join t_ICItem on POInstockEntry.FItemID=t_ICItem.FItemID
where FInterID=@FinterID and FAuxConCommitQty = 0");

            cmd.Parameters.AddWithValue("@FinterID", _FinterID);
            var wmf = new WmsFunction(BaseStructure.KisConstring);

            uGridChecks.DataSource = wmf.GetSqlTable(cmd);
        }
示例#33
0
        private void SetRecentVendor()
        {
            if (!biSave.Enabled)
            {
                return;
            }
            var cmdRecentVendor = new SqlCommand("select top 1 FSupplyID,FKFDate from vwICBill_1 where FNumber=@FNumber and FBatchNo=@FBatchNo");
            var wf = new WmsFunction(BaseStructure.KisConstring);

            cmdRecentVendor.Parameters.AddWithValue("@FNumber", txtcInvCode.Text);
            cmdRecentVendor.Parameters.AddWithValue("@FBatchNo", txtcLotNo.Text);
            var dtTemp = wf.GetSqlTable(cmdRecentVendor);

            if (dtTemp != null && dtTemp.Rows.Count > 0)
            {
                txtcVendor.Text = dtTemp.Rows[0]["FSupplyID"].ToString();
                var      cDate = dtTemp.Rows[0]["FKFDate"].ToString();
                DateTime dTemp;
                if (DateTime.TryParse(cDate, out dTemp))
                {
                    dtpdDate.Value = dTemp;
                }
            }
        }
示例#34
0
        private void BaseRoleFunction_Load(object sender, EventArgs e)
        {

            uGridRole_Function.DisplayLayout.ValueLists.Add("roleList");
            uGridRole_Function.DisplayLayout.ValueLists.Add("functionList");
            //设置连接并载入数据
            roleFunctionTableAdapter.Connection.ConnectionString = BaseStructure.WmsCon;
            bFunctionTableAdapter.Connection.ConnectionString = BaseStructure.WmsCon;
            bRoleTableAdapter.Connection.ConnectionString = BaseStructure.WmsCon;
            bFunctionTableAdapter.Fill(baseDs.BFunction);

            var wf = new WmsFunction(BaseStructure.WmsCon);
            uGridRole.DataSource = wf.GetSqlTable("SELECT * from View_RoleAndUser");

            SetFunctionDropDownList();
            //SetRoleDropDownList();
        }
示例#35
0
        private void SetRecentVendor()
        {
            if (!biSave.Enabled)
                return;
            var cmdRecentVendor = new SqlCommand("select top 1 FSupplyID,FKFDate from vwICBill_1 where FNumber=@FNumber and FBatchNo=@FBatchNo");
            var wf = new WmsFunction(BaseStructure.KisConstring);

            cmdRecentVendor.Parameters.AddWithValue("@FNumber", txtcInvCode.Text);
            cmdRecentVendor.Parameters.AddWithValue("@FBatchNo", txtcLotNo.Text);
            var dtTemp = wf.GetSqlTable(cmdRecentVendor);
            if(dtTemp!=null&&dtTemp.Rows.Count>0)
            {
                txtcVendor.Text = dtTemp.Rows[0]["FSupplyID"].ToString();
                var cDate = dtTemp.Rows[0]["FKFDate"].ToString();
                DateTime dTemp;
                if(DateTime.TryParse(cDate,out dTemp))
                {
                    dtpdDate.Value = dTemp;
                }
            }
        }
示例#36
0
        private void uGridShiftDetail_DoubleClickCell(object sender, Infragistics.Win.UltraWinGrid.DoubleClickCellEventArgs e)
        {
            var wf = new WmsFunction(BaseStructure.WmsCon);
            var cmd = new SqlCommand("select * from RmLabel where cInvCode=@cInvCode and cLotNo=@cLotNo");
            cmd.Parameters.AddWithValue("@cInvCode", e.Cell.Row.Cells["cInvCode"].Value.ToString());
            cmd.Parameters.AddWithValue("@cLotNo", e.Cell.Row.Cells["FBatchNo"].Value.ToString());

            var dt = wf.GetSqlTable(cmd);
            if (dt==null||dt.Rows.Count<1)
            {
                MessageBox.Show(@"当前批号,未在原料标签打印记录中,请手动在原料标签打印中,打印!", @"异常", MessageBoxButtons.OK, MessageBoxIcon.Warning);
                
                return;
            }
            PrintDialogRm("print", e.Cell.Row, dt);
        }
示例#37
0
 /// <summary>
 /// 判断什么未填写,返回对应的标签
 /// </summary>
 /// <returns></returns>
 private string CheckNull()
 {
     if (string.IsNullOrEmpty(txtcInvCode.Text))
         return "编码";
     //if (string.IsNullOrEmpty(txtcOrderNumber.Text))
     //    return "客户订单号";
     if(string.IsNullOrEmpty(txtFBatchNo.Text))
     {
         return "生产批号";
     }
     if (!dtpdDate.Checked)
         return "日期";var cmdInvCode = new SqlCommand("select * from t_icItem where FNumber=@FNumber");
     cmdInvCode.Parameters.AddWithValue("@FNumber", txtcInvCode.Value);
     var wfun = new WmsFunction(BaseStructure.KisConstring);
     if (!wfun.BoolExistTable(cmdInvCode))
     {
         return @"编码不正确,编码";
     }
     //if (dataInventory.ShiftDetail.Rows.Count < 1)
     //    return "子件";
     return uneiQuantity.Value == null || string.IsNullOrEmpty(uneiQuantity.Value.ToString()) ? "数量" : string.Empty;
 }
示例#38
0
 private void GetProduct()
 {
     var cmd = new SqlCommand("Select * from Bom");
     var wf = new WmsFunction(BaseStructure.WmsCon);
     BomList = wf.GetSqlTable(cmd);
     txtcInvCode.DataSource = BomList;
     var cmdVendor = new SqlCommand("select FNumber,FName from t_Department order by FNumber");
     wf.Constr = BaseStructure.KisConstring;
     txtcDept.DataSource = wf.GetSqlTable(cmdVendor);
 }
 private DataTable GetPrintData()
 {
     var cmd = new SqlCommand("select * from View_ProductLabel where cSerialNumber=@cSerialNumber");
     cmd.Parameters.AddWithValue("@cSerialNumber", lblTitleMain.lblcSerialNumber.Text);
     var wf=new WmsFunction(BaseStructure.WmsCon);
     return wf.GetSqlTable(cmd);
 }
        private void biAddNew_ItemClick(object sender, DevExpress.XtraBars.ItemClickEventArgs e)
        {
            //判断什么为填写
            var nullstr = CheckNull();
            if (!string.IsNullOrEmpty(nullstr))
            {
                MessageBox.Show(nullstr + @" 数据异常,请先完成班次制令单后,
再操作此功能", @"错误", MessageBoxButtons.OK, MessageBoxIcon.Warning);
                return;
            }
            using (
                var wpc = new WorkTrackProductLabelCreate(txtcInvCode.Text, utecInvName.Text, txtcOrderNumber.Text,
                    dtpdDate.Value.ToShortDateString()))
            {
                if (wpc.ShowDialog() != DialogResult.Yes)
                    return;
                var wf=new WmsFunction(BaseStructure.WmsCon);
                var cmd = new SqlCommand("proc_GenerateProductLabel"){CommandType = CommandType.StoredProcedure};
                cmd.Parameters.AddWithValue("@cSerialNumber", lblTitleMain.lblcSerialNumber.Text);
                cmd.Parameters.AddWithValue("@iQuantity", wpc.Quantity);
                cmd.Parameters.AddWithValue("@SerialQty", wpc.SerialQty);
                cmd.Parameters.AddWithValue("@cMemo", wpc.Memo);
                wf.ExecSqlCmd(cmd);
                productLabelTableAdapter.Fill(dataInventory.ProductLabel, lblTitleMain.lblcSerialNumber.Text);}
        }
示例#41
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;
 }
示例#42
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");
     var rCode = BaseStructure.LoginRoleId;
     if (string.IsNullOrEmpty(rCode))
         rCode = BaseStructure.LoginId;
     cmd.Parameters.AddWithValue("@rCode", rCode);
     cmd.Parameters.AddWithValue("@fCode", cKey);
     var wf = new WmsFunction(BaseStructure.WmsCon);
     return wf.BoolExistTable(cmd);
 }
示例#43
0
 /// <summary>
 /// 审核
 /// </summary>
 private void Approve()
 {
     var cmd = new SqlCommand("ApproveProDelivery") { CommandType = CommandType.StoredProcedure };
     var prs = new[]
         {
             new SqlParameter("@AutoID",lblAutoID.Text),
             new SqlParameter("@cHandler",BaseStructure.LoginName) 
         };
     cmd.Parameters.AddRange(prs);
     var wf = new WmsFunction(BaseStructure.WmsCon);
     if (wf.ExecSqlCmd(cmd))
     {
         SetPanelVlaue(lblAutoID.Text);
     }
 }
示例#44
0
 /// <summary>
 /// 判断什么未填写,返回对应的标签
 /// </summary>
 /// <returns></returns>
 private string CheckNull()
 {
     if (string.IsNullOrEmpty(txtcInvCode.Text))
         return "编码";
     if (string.IsNullOrEmpty(txtcLotNo.Text))
         return "批号";
     if (!dtpdDate.Checked)
         return "日期";
     if (!dtpcDefine2.Checked)
         return "供应商生产日期";
     if(dtpcDefine2.Value>dtpdDate.Value)
     {
         return "供应商生产日期必需小于进货日期";
     }
     var cmdInvCode = new SqlCommand("select * from t_icItem where FNumber=@FNumber");
     cmdInvCode.Parameters.AddWithValue("@FNumber", txtcInvCode.Value);
     var wfun = new WmsFunction(BaseStructure.KisConstring);
     if (!wfun.BoolExistTable(cmdInvCode))
     {
         return @"编码不正确,编码";
     }
     return uneiQuantity.Value == null || string.IsNullOrEmpty(uneiQuantity.Value.ToString()) ? "数量" : string.Empty;
 }
示例#45
0
        private void SetLotNoSourceAndRecentVendor()
        {
            if(!biSave.Enabled)
                return;
            var wf = new WmsFunction(BaseStructure.KisConstring);
            var cmd = new SqlCommand("select FBatchNo,FQty from ICInventory where FitemID=@FItemID and FQty>0 order by FBatchNo desc");
            cmd.Parameters.AddWithValue("@FItemID", _FitemId);
            txtcLotNo.DataSource = wf.GetSqlTable(cmd);

            

        }