Пример #1
0
        /// <summary>
        /// 设置定位数据及状态
        /// </summary>
        /// <param name="p_ID">ID</param>
        public override void SetPosStatus(int p_ID)
        {
            int tempID = HTDataID;

            BindGrid();
            ProcessGrid.GridViewFocus(gridView1, new string[] { "ID" }, new string[] { tempID.ToString() });
        }
Пример #2
0
        /// <summary>
        /// 创建DataTable
        /// </summary>
        private void CreateDatable()
        {
            string[] ItemStr = GetItemStr(txtScan.Text.Trim());
            DataRow  row     = dtCode.NewRow();

            row["GBCode"]     = txtScan.Text.Trim();
            row["GHTime"]     = DateTime.Now.Date;
            row["GHOPID"]     = FParamConfig.LoginID;
            row["MainID"]     = GetMainID(txtScan.Text.Trim());
            row["JCTime"]     = GetJCTime(txtScan.Text.Trim());
            row["GBStatusID"] = (int)EnumGBStatus.归还;
            row["LYFlag"]     = LYFlag;

            row["ItemCode"]  = ItemStr[0];
            row["ItemName"]  = ItemStr[1];
            row["ItemStd"]   = ItemStr[2];
            row["ItemModel"] = ItemStr[3];
            row["MWidth"]    = ItemStr[4];
            row["MWeight"]   = ItemStr[5];
            row["ColorNum"]  = ItemStr[6];
            row["ColorName"] = ItemStr[7];

            dtCode.Rows.Add(row);
            gridView1.GridControl.DataSource = dtCode;
            gridView1.GridControl.Show();
            ProcessGrid.GridViewFocus(gridView1, new string[1] {
                "GBCode"
            }, new string[1] {
                txtScan.Text.Trim()
            });
        }
Пример #3
0
 /// <summary>
 /// 撤单操作
 /// </summary>
 /// <param name="sender"></param>
 /// <param name="e"></param>
 private void btnCancelCancelOrder_Click(object sender, EventArgs e)
 {
     try
     {
         if (!FCommon.RightCheck(this.FormID, this.RightFormID, this.FormListAID, this.FormListBID, RightSub.权限3))
         {
             this.ShowMessage("没有此权限,请联系管理员");
             return;
         }
         if (SysConvert.ToInt32(gridView1.GetRowCellValue(gridView1.FocusedRowHandle, "CancelFlag")) == 0)
         {
             this.ShowMessage("此订单未撤单,不能取消!");
             return;
         }
         string FormNo = SysConvert.ToString(gridView1.GetRowCellValue(gridView1.FocusedRowHandle, "FormNo"));
         string sql    = "UPDATE Sale_SaleOrder SET CancelFlag =0";
         sql += ",CancelReason =''";
         sql += " WHERE FormNo=" + SysString.ToDBString(FormNo);
         SysUtils.ExecuteNonQuery(sql);
         btnQuery_Click(null, null);
         ProcessGrid.GridViewFocus(gridView1, new string[1] {
             "FormNo"
         }, new string[1] {
             FormNo
         });
     }
     catch (Exception E)
     {
         this.ShowMessage(E.Message);
     }
 }
Пример #4
0
        private void pictureBox1_Click(object sender, EventArgs e)
        {
            try
            {
                if (HTDataID == 0)
                {
                    this.ShowMessage("请保存产品后添加挂板!");
                    return;
                }

                frmGBAdd frm = new frmGBAdd();
                frm.ID    = HTDataID;
                frm.Owner = this;
                frm.ShowDialog();

                BindGrid();
                ProcessGrid.GridViewFocus(gridView1, new string[1] {
                    "DtsID"
                }, new string[1] {
                    frm.DID.ToString()
                });
            }
            catch (Exception E)
            {
                this.ShowMessage(E.Message);
            }
        }
Пример #5
0
        /// <summary>
        /// 刷新父窗体数据
        /// </summary>
        public override void RefreshParentData()
        {
            int tempID = HTDataID;

            this.BindGrid();
            ProcessGrid.GridViewFocus(gridView1, new string[] { "ID" }, new string[] { tempID.ToString() });
        }
Пример #6
0
 /// <summary>
 /// 修改客户抬头
 /// </summary>
 /// <param name="sender"></param>
 /// <param name="e"></param>
 private void btnUpdateWHVendor_Click(object sender, EventArgs e)
 {
     try
     {
         if (!FCommon.RightCheck(this.FormID, this.RightFormID, this.FormListAID, this.FormListBID, RightSub.权限2))
         {
             this.ShowMessage("没有此权限,请联系管理员");
             return;
         }
         frmUpdateWHVendor frm = new frmUpdateWHVendor();
         frm.StartPosition = FormStartPosition.Manual;
         frm.Location      = new Point(580, 280);
         frm.FormNo        = SysConvert.ToString(gridView1.GetRowCellValue(gridView1.FocusedRowHandle, "FormNo"));
         frm.VendorID      = SysConvert.ToString(gridView1.GetRowCellValue(gridView1.FocusedRowHandle, "VendorID"));
         frm.ShowDialog();
         txtFormNo_EditValueChanged(null, null);
         ProcessGrid.GridViewFocus(gridView1, new string[1] {
             "FormNo"
         }, new string[1] {
             frm.FormNo.ToString()
         });
     }
     catch (Exception E)
     {
         this.ShowMessage(E.Message);
     }
 }
Пример #7
0
        /// <summary>
        /// 修改合同状态
        /// </summary>
        /// <param name="sender"></param>
        /// <param name="e"></param>
        private void UpdateOrderStatusToolStripMenuItem_Click(object sender, EventArgs e)
        {
            try
            {
                if (!FCommon.RightCheck(this.FormID, this.RightFormID, this.FormListAID, this.FormListBID, RightSub.权限3))
                {
                    this.ShowMessage("没有此权限,请联系管理员");
                    return;
                }
                frmUpdateBuyFormStatus frm = new frmUpdateBuyFormStatus();
                frm.StartPosition   = FormStartPosition.Manual;
                frm.Location        = new Point(580, 280);
                frm.ID              = SysConvert.ToInt32(gridView1.GetRowCellValue(gridView1.FocusedRowHandle, "ID"));
                frm.OrderStatusName = SysConvert.ToString(gridView1.GetRowCellValue(gridView1.FocusedRowHandle, "FormStatusName"));
                frm.ShowDialog();
                GetCondtion();
                BindGrid();

                ProcessGrid.GridViewFocus(gridView1, new string[1] {
                    "ID"
                }, new string[1] {
                    frm.ID.ToString()
                });
            }
            catch (Exception E)
            {
                this.ShowMessage(E.Message);
            }
        }
Пример #8
0
        private void btnLYVendor_Click(object sender, EventArgs e)
        {
            try
            {
                string GBIDStr = "";
                this.BaseFocusLabel.Focus();
                frmUpdateLYLRVendor frm = new frmUpdateLYLRVendor();
                for (int i = 0; i < gridView1.RowCount; i++)
                {
                    if (SysConvert.ToInt32(gridView1.GetRowCellValue(i, "SelectFlag")) == 1)
                    {
                        if (GBIDStr != "")
                        {
                            GBIDStr += "or";
                        }
                        GBIDStr += " (MainID = " + SysConvert.ToString(gridView1.GetRowCellValue(i, "MainID"));
                        GBIDStr += " AND";
                        GBIDStr += " Seq = " + SysConvert.ToString(gridView1.GetRowCellValue(i, "Seq")) + ")";
                    }
                }
                frm.GBCode = GBIDStr;
                frm.ShowDialog();
                BindGrid();

                ProcessGrid.GridViewFocus(gridView1, new string[] { "GBCode" }, new string[] { GBIDStr });

                //ProcessGrid.GridViewFocus(gridView1, new string[1] { "GBCode" }, new string[1] { frm.GBCode.ToString() });
            }
            catch (Exception E)
            {
                this.ShowMessage(E.Message);
            }
        }
Пример #9
0
        private void btnSave_Click_1(object sender, EventArgs e)
        {
            try
            {
                int DtsID = SysConvert.ToInt32(gridView1.GetRowCellValue(gridView1.FocusedRowHandle, "DtsID"));
                TowelProductionPlanDts     entity = new TowelProductionPlanDts();
                TowelProductionPlanDtsRule rule   = new TowelProductionPlanDtsRule();
                entity.ID = DtsID;
                entity.SelectByID();

                entity.CardNo     = txtCardNo.Text.Trim();
                entity.CardQty    = SysConvert.ToDecimal(txtCardQty.Text.Trim());
                entity.CardTime   = SysConvert.ToDateTime(txtCardTime.DateTime);
                entity.CardOPID   = FParamConfig.LoginID;
                entity.CardOPName = FParamConfig.LoginName;
                if (entity.CardNo != "")
                {
                    entity.StepID = 1;// (int)EnumWOType.剪前检验;//保存卡号的时候就默认 第一道工序
                }

                rule.RUpdate(entity);
                this.ShowInfoMessage("保存成功");

                GetCondtion();
                BindGrid();
                ProcessGrid.GridViewFocus(gridView1, new string[] { "DtsID" }, new string[] { DtsID.ToString() });
            }
            catch (Exception E)
            {
                this.ShowMessage(E.Message);
            }
        }
Пример #10
0
 /// <summary>
 /// 清除图片
 /// </summary>
 /// <param name="sender"></param>
 /// <param name="e"></param>
 private void btnDelImage_Click(object sender, EventArgs e)
 {
     try
     {
         this.BaseFocusLabel.Focus();
         if (DialogResult.Yes == ShowConfirmMessage("是否清除该挂板图片"))
         {
             string GBCode = SysConvert.ToString(gridView1.GetRowCellValue(gridView1.FocusedRowHandle, "GBCode"));
             if (GBCode != string.Empty)
             {
                 string sql = "UPDATE Data_ItemGB SET GBPic='0' WHERE GBCode=" + SysString.ToDBString(GBCode);
                 SysUtils.Fill(sql);
                 BindGrid();
                 ProcessGrid.GridViewFocus(gridView1, new string[1] {
                     "GBCode"
                 }, new string[1] {
                     GBCode
                 });
             }
         }
     }
     catch (Exception E)
     {
         this.ShowMessage(E.Message);
     }
 }
Пример #11
0
        private void btnUpdateWHPic_Click(object sender, EventArgs e)
        {
            try
            {
                if (txtWHPicIDP.Text.Trim() == "")
                {
                    this.ShowMessage("请输入区分类");
                    txtWHPicIDP.Focus();
                    return;
                }
                WHPicRule rule   = new WHPicRule();
                WHPic     entity = this.GetEntityWHPic();
                rule.RUpdate(entity);

                FCommon.AddDBLog(this.Text, "区分类更新", "ID:" + entity.WHPicID, "新ID:" + entity.WHPicID);

                BindGridWHPic();

                ProcessGrid.GridViewFocus(gridView2, new string[1] {
                    "WHPicID"
                }, new string[1] {
                    entity.WHPicID
                });
            }
            catch (Exception E)
            {
                this.ShowMessage(E.Message);
            }
        }
Пример #12
0
 private void btnUpdate_Click_1(object sender, EventArgs e)
 {
     try
     {
         if (HTDataID == 0)
         {
             this.ShowMessage("请保存产品后修改!");
             return;
         }
         this.BaseFocusLabel.Focus();
         int ID = SysConvert.ToInt32(gridView1.GetRowCellValue(gridView1.FocusedRowHandle, "DtsID"));
         if (ID > 0)
         {
             frmGBAdd frm = new frmGBAdd();
             frm.ID    = HTDataID;
             frm.DID   = ID;
             frm.Owner = this;
             frm.ShowDialog();
             BindGrid();
             ProcessGrid.GridViewFocus(gridView1, new string[1] {
                 "DtsID"
             }, new string[1] {
                 ID.ToString()
             });
         }
         else
         {
             this.ShowMessage("请选择需要修改的挂板!");
         }
     }
     catch (Exception E)
     {
         this.ShowMessage(E.Message);
     }
 }
Пример #13
0
 /// <summary>
 /// 撤单操作
 /// </summary>
 /// <param name="sender"></param>
 /// <param name="e"></param>
 private void btnCancelOrder_Click(object sender, EventArgs e)
 {
     try
     {
         if (!FCommon.RightCheck(this.FormID, this.RightFormID, this.FormListAID, this.FormListBID, RightSub.权限3))
         {
             this.ShowMessage("没有此权限,请联系管理员");
             return;
         }
         if (SysConvert.ToInt32(gridView1.GetRowCellValue(gridView1.FocusedRowHandle, "CancelFlag")) == 1)
         {
             this.ShowMessage("此订单已撤单!");
             return;
         }
         frmCancelOrder frm = new frmCancelOrder();
         frm.StartPosition = FormStartPosition.Manual;
         frm.Location      = new Point(580, 280);
         frm.OrdeFormNo    = SysConvert.ToString(gridView1.GetRowCellValue(gridView1.FocusedRowHandle, "FormNo"));
         frm.ShowDialog();
         btnQuery_Click(null, null);
         ProcessGrid.GridViewFocus(gridView1, new string[1] {
             "FormNo"
         }, new string[1] {
             frm.OrdeFormNo.ToString()
         });
     }
     catch (Exception E)
     {
         this.ShowMessage(E.Message);
     }
 }
Пример #14
0
 /// <summary>
 /// 刷新数据(刷新数据方式,可重写)
 /// </summary>
 /// <param name="p_DataID">数据ID</param>
 public virtual void RefreshData(int p_DataID)//,FormStatus p_Status/// <param name="p_Status">状态</param>
 {
     if (_HTDataList.Columns.Count != 0)
     {
         this.BindGrid();
         ProcessGrid.GridViewFocus(HTDataList, new string[] { "ID" }, new string[] { p_DataID.ToString() });
     }
 }
Пример #15
0
        private void btnToGBDetail_Click(object sender, EventArgs e)
        {
            try
            {
                this.BaseFocusLabel.Focus();
                if (this.HTDataSubmitFlag == 0)//未提交状态才允许编辑码单
                {
                    if (HTDataID == 0)
                    {
                        this.ShowMessage("请保存单据后设置细码");
                        return;
                    }
                    int    ID        = SysConvert.ToInt32(gridView1.GetRowCellValue(gridView1.FocusedRowHandle, "ID"));
                    string WHID      = SysConvert.ToString(drpWHID.EditValue);
                    string ItemCode  = SysConvert.ToString(gridView1.GetRowCellValue(gridView1.FocusedRowHandle, "ItemCode"));
                    string ItemName  = SysConvert.ToString(gridView1.GetRowCellValue(gridView1.FocusedRowHandle, "ItemCode"));
                    string ColorNum  = SysConvert.ToString(gridView1.GetRowCellValue(gridView1.FocusedRowHandle, "ColorNum"));
                    string ColorName = SysConvert.ToString(gridView1.GetRowCellValue(gridView1.FocusedRowHandle, "ColorName"));
                    string JarNum    = SysConvert.ToString(gridView1.GetRowCellValue(gridView1.FocusedRowHandle, "JarNum"));
                    string Batch     = SysConvert.ToString(gridView1.GetRowCellValue(gridView1.FocusedRowHandle, "Batch"));

                    if (ID > 0)
                    {
                        frmLoadOutWH frm = new frmLoadOutWH();
                        frm.PackType     = (int)EnumPackType.调拨单据;
                        frm.IOFormID     = HTDataID;
                        frm.ID           = ID;
                        frm.WHID         = WHID;
                        frm.ItemCode     = ItemCode;
                        frm.ColorNum     = ColorNum;
                        frm.ColorName    = ColorName;
                        frm.JarNum       = JarNum;
                        frm.Batch        = Batch;
                        frm.KPButtonFlag = true;
                        frm.ShowDialog();
                        if (frm.SaveFlag)//如果保存则刷新数据
                        {
                            BindGridDts();
                            ProcessGrid.GridViewFocus(gridView1, new string[1] {
                                "ID"
                            }, new string[1] {
                                ID.ToString()
                            });
                            gridViewRowChanged2(gridView1);
                        }
                    }
                }
                else
                {
                    this.ShowMessage("单据已提交,不允许编辑码单");
                }
            }
            catch (Exception E)
            {
                this.ShowMessage(E.Message);
            }
        }
Пример #16
0
        /// <summary>
        /// 解锁操作
        /// </summary>
        /// <param name="sender"></param>
        /// <param name="e"></param>
        private void btnCancelLock_Click(object sender, EventArgs e)
        {
            try
            {
                if (!FCommon.RightCheck(this.FormID, this.FormListAID, this.FormListBID, RightSub.新增))
                {
                    this.ShowMessage("你没有此操作权限");
                    return;
                }
                if (saveLockID == 0)
                {
                    this.ShowMessage("请先查询要操作的记录");
                    return;
                }

                if (DialogResult.Yes != ShowConfirmMessage("解除锁定为不可恢复操作,确认要解除?"))
                {
                    return;
                }
                if (!NewCheckCorrect())
                {
                    return;
                }
                //if (!FCommon.RightCheck(this.FormID, this.FormListAID, this.FormListBID, RightSub.审核1))//不具有审核权限
                //{
                //    if (!CheckOPID(FParamConfig.LoginID, saveLockID))//检验是不是管理员 !Common.CheckAdmin(FParamConfig.LoginID) && !Common.CheckWHAdmin(FParamConfig.LoginID) &&
                //    {
                //        this.ShowMessage("你不是该单的业务员,不能操作该单据");
                //        return;
                //    }
                //}
                if (SysConvert.ToDecimal(txtLockQty.Text.Trim()) > SysConvert.ToDecimal(txtTotalLockQty.Text.Trim()))
                {
                    this.ShowMessage("解锁数量大于锁定数量,解锁失败");
                    txtLockQty.Focus();
                    return;
                }
                StorgeLockRule rule = new StorgeLockRule();
                rule.RUnLock(saveLockID, SysConvert.ToDecimal(txtLockQty.Text.Trim()), txtRemark.Text.Trim(), true);

                string tempwhid     = saveItemWHID;
                string tempitemcode = saveItemCode;
                string tempStorgeID = saveStorgeID.ToString();
                BindGrid();
                ProcessGrid.GridViewFocus(gridView1, new string[1] {
                    "ID"
                }, new string[1] {
                    tempStorgeID
                });
            }
            catch (Exception E)
            {
                this.ShowMessage(E.Message);
            }
        }
Пример #17
0
        void work_RunWorkerCompleted(object sender, RunWorkerCompletedEventArgs e)
        {
            StartM = 0;
            timer1.Stop();
            gridView1.GridControl.DataSource = GridView1Table;
            gridView1.GridControl.Show();
            ProcessGrid.GridViewFocus(gridView1, new string[] { "ID" }, new string[] { ID.ToString() });
            LabelItem label = this.ToolBarLItemGet(-1, ToolButtonName.lblFormStatus.ToString());

            label.Text = "查询结束";
        }
Пример #18
0
        /// <summary>
        /// 双击匹数
        /// </summary>
        /// <param name="sender"></param>
        /// <param name="e"></param>
        private void btnToGBDetail_Click(object sender, EventArgs e)
        {
            try
            {
                this.BaseFocusLabel.Focus();
                if (this.HTDataSubmitFlag == 0)//未提交状态才允许编辑码单
                {
                    if (HTDataID == 0)
                    {
                        this.ShowMessage("请保存单据后设置细码");
                        return;
                    }
                    int     PackFlag = SysConvert.ToInt32(gridView1.GetRowCellValue(gridView1.FocusedRowHandle, "PackFlag"));
                    int     ID       = SysConvert.ToInt32(gridView1.GetRowCellValue(gridView1.FocusedRowHandle, "ID"));
                    int     MainID   = SysConvert.ToInt32(gridView1.GetRowCellValue(gridView1.FocusedRowHandle, "MainID"));
                    int     Seq      = SysConvert.ToInt32(gridView1.GetRowCellValue(gridView1.FocusedRowHandle, "Seq"));
                    decimal Qty      = SysConvert.ToDecimal(gridView1.GetRowCellValue(gridView1.FocusedRowHandle, "Qty"));

                    if (ID > 0)
                    {
                        frmLoadJYOrderInput frm = new frmLoadJYOrderInput();
                        //frm.PackType = (int)EnumPackType.仓库单据;
                        frm.ID     = ID;
                        frm.MainID = MainID;
                        frm.Seq    = Seq;
                        frm.Qty    = Qty;
                        if (PackFlag == 1)//有码单明细
                        {
                            frm.UpdateFlag = true;
                        }
                        frm.ShowDialog();
                        if (frm.SaveFlag)//如果保存则刷新数据
                        {
                            BindGridDts();
                            ProcessGrid.GridViewFocus(gridView1, new string[1] {
                                "ID"
                            }, new string[1] {
                                ID.ToString()
                            });
                            //gridViewRowChanged2(gridView1);
                        }
                    }
                }
                else//提交状态
                {
                    this.ShowMessage("单据已提交,不允许编辑码单");
                }
            }
            catch (Exception E)
            {
                this.ShowMessage(E.Message);
            }
        }
Пример #19
0
        /// <summary>
        /// 删除位
        /// </summary>
        /// <param name="sender"></param>
        /// <param name="e"></param>
        private void btnDeleteBit_Click(object sender, EventArgs e)
        {
            try
            {
                if (txtSBit.Text.Trim() == "")
                {
                    this.ShowMessage("请选择要删除的记录");
                    return;
                }

                if (DialogResult.Yes != this.ShowConfirmMessage("确定要删除本记录?"))
                {
                    return;
                }

                SBitRule rule   = new SBitRule();
                SBit     entity = new SBit();
                entity.MainID    = HTDataID;
                entity.WHID      = txtWHID.Text.Trim();
                entity.SectionID = gridView1.GetRowCellValue(gridView1.FocusedRowHandle, "SectionID").ToString();
                entity.SBitID    = txtSBit.Text.Trim();
                //entity.OldSBitID = txtSBit.Text.Trim();

                rule.RDelete(entity);

                FCommon.AddDBLog(this.Text, "位删除", "ID:" + entity.SBitID, "");

                string tempwhid = entity.WHID;
                BindGridSBit();

                ProcessGrid.GridViewFocus(gridView1, new string[1] {
                    "SectionID"
                }, new string[1] {
                    entity.WHID
                });
                ProcessGrid.GridViewFocus(gridView3, new string[1] {
                    "SBitID"
                }, new string[1] {
                    entity.SectionID
                });
                //				GridViewFocus(gridView3,new string[1]{"SBitID"},new string[1]{entity.SBitID});
                //				Common.AddDBLog(this.Text,OPType.删除,"ID:"+entity.OldSBitID.ToString(),"位");
            }
            catch (Exception E)
            {
                this.ShowMessage(E.Message);
            }
        }
Пример #20
0
        /// <summary>
        /// 锁定库存
        /// </summary>
        /// <param name="sender"></param>
        /// <param name="e"></param>
        private void btnLockStorge_Click(object sender, EventArgs e)
        {
            try
            {
                if (!FCommon.RightCheck(this.FormID, this.FormListAID, this.FormListBID, RightSub.新增))
                {
                    this.ShowMessage("你没有此操作权限");
                    return;
                }
                if (saveStorgeID == 0)
                {
                    this.ShowMessage("请先查询要操作的记录");
                    return;
                }
                if (SysConvert.ToFloat(txtLockQty.Text.Trim()) > SysConvert.ToFloat(txtLeftQty.Text.Trim()))
                {
                    this.ShowMessage("锁定数量大于当前可使用数量,不能实现库存锁定");
                    return;
                }
                if (!NewCheckCorrect())
                {
                    return;
                }
                //if (!CheckCorrectLock())
                //{
                //    return;
                //}
                StorgeLockRule rule   = new StorgeLockRule();
                StorgeLock     entity = this.GetEntity();
                rule.RLock(entity, true);

                string tempwhid     = saveItemWHID;
                string tempitemcode = saveItemCode;
                string tempStorgeID = saveStorgeID.ToString();
                BindGrid();
                ProcessGrid.GridViewFocus(gridView1, new string[1] {
                    "ID"
                }, new string[1] {
                    tempStorgeID
                });
            }
            catch (Exception E)
            {
                this.ShowMessage(E.Message);
            }
        }
Пример #21
0
 /// <summary>
 /// 修改色卡状态
 /// </summary>
 /// <param name="sender"></param>
 /// <param name="e"></param>
 private void btnUpdateColorStatus_Click(object sender, EventArgs e)
 {
     try
     {
         if (!FCommon.RightCheck(this.FormID, this.RightFormID, this.FormListAID, this.FormListBID, RightSub.新增))
         {
             this.ShowMessage("没有此权限,请联系管理员");
             return;
         }
         //1: L/D样    2:S/D样
         if (this.FormListAID == 1)
         {
             frmUpdateColorCardStatus frm = new frmUpdateColorCardStatus();
             frm.StartPosition = FormStartPosition.Manual;
             frm.Location      = new Point(400, 280);
             frm.DtsID         = SysConvert.ToInt32(gridView1.GetRowCellValue(gridView1.FocusedRowHandle, "DtsID"));
             frm.ShowDialog();
             btnQuery_Click(null, null);
             ProcessGrid.GridViewFocus(gridView1, new string[1] {
                 "DtsID"
             }, new string[1] {
                 frm.DtsID.ToString()
             });
         }
         else if (this.FormListAID == 2)
         {
             frmUpdateColorCardStatusSD frm = new frmUpdateColorCardStatusSD();
             frm.StartPosition = FormStartPosition.Manual;
             frm.Location      = new Point(400, 280);
             frm.DtsID         = SysConvert.ToInt32(gridView1.GetRowCellValue(gridView1.FocusedRowHandle, "DtsID"));
             frm.ShowDialog();
             btnQuery_Click(null, null);
             ProcessGrid.GridViewFocus(gridView1, new string[1] {
                 "DtsID"
             }, new string[1] {
                 frm.DtsID.ToString()
             });
         }
     }
     catch (Exception E)
     {
         this.ShowMessage(E.Message);
     }
 }
Пример #22
0
        /// <summary>
        /// 更新位
        /// </summary>
        /// <param name="sender"></param>
        /// <param name="e"></param>
        private void btnUpdateBit_Click(object sender, EventArgs e)
        {
            try
            {
                if (txtSBit.Text.Trim() == "")
                {
                    this.ShowMessage("请选择要修改的记录");
                    return;
                }
                if (!CheckCorrectBit())
                {
                    return;
                }
                SBitRule rule      = new SBitRule();
                SBit     entity    = this.GetEntitySBit();
                string   OLDSBitID = SysConvert.ToString(gridView3.GetFocusedRowCellValue("SBitID"));
                //entity.MainID = HTDataID;
                //entity.WHID = txtWHID.Text.Trim();
                //entity.SectionID = txtSectionIDBit.Text.Trim();
                //entity.SBitID = txtSBit.Text.Trim();
                rule.RUpdate(entity, OLDSBitID);

                FCommon.AddDBLog(this.Text, "位更新", "ID:" + entity.SBitID, "New ID:" + entity.SBitID);
                BindGridSBit();
                //ProcessGrid.GridViewFocus(gridView1, new string[1] { "WHID" }, new string[1] { entity.WHID });
                ProcessGrid.GridViewFocus(gridView1, new string[1] {
                    "SectionID"
                }, new string[1] {
                    entity.SectionID
                });
                ProcessGrid.GridViewFocus(gridView3, new string[1] {
                    "SBitID"
                }, new string[1] {
                    entity.SBitID
                });
                //				Common.AddDBLog(this.Text,OPType.更新,"ID:"+entity.OldSBitID.ToString(),"位");
            }
            catch (Exception E)
            {
                this.ShowMessage(E.Message);
            }
        }
Пример #23
0
        /// <summary>
        /// 新增位
        /// </summary>
        /// <param name="sender"></param>
        /// <param name="e"></param>
        private void btnInsertBit_Click(object sender, EventArgs e)
        {
            try
            {
                if (!CheckCorrectBit())
                {
                    return;
                }
                SBitRule rule   = new SBitRule();
                SBit     entity = this.GetEntitySBit();


                if (SysConvert.ToInt32(drpWHPosMethodID.EditValue) == 1 || SysConvert.ToInt32(drpWHPosMethodID.EditValue) == 2)
                {
                    this.ShowMessage("物理位置不包含位无法新增");
                    return;
                }
                else
                {
                    rule.RAdd(entity);
                }
                FCommon.AddDBLog(this.Text, "位新增", "ID:" + entity.SBitID, "");

                BindGridSBit();
                // ProcessGrid.GridViewFocus(gridView1, new string[1] { "WHID" }, new string[1] { entity.WHID });
                ProcessGrid.GridViewFocus(gridView1, new string[1] {
                    "SectionID"
                }, new string[1] {
                    entity.SectionID
                });
                ProcessGrid.GridViewFocus(gridView3, new string[1] {
                    "SBitID"
                }, new string[1] {
                    entity.SBitID
                });
                //				Common.AddDBLog(this.Text,OPType.新增,"ID:"+entity.SBitID.ToString(),"位");
            }
            catch (Exception E)
            {
                this.ShowMessage(E.Message);
            }
        }
Пример #24
0
        /// <summary>
        /// 挂板修改
        /// </summary>
        /// <param name="sender"></param>
        /// <param name="e"></param>
        private void btnUpdateGB_Click(object sender, EventArgs e)
        {
            try
            {
                string GBIDStr = "";
                this.BaseFocusLabel.Focus();
                frmUpdateGB frm = new frmUpdateGB();
                GBIDStr = SysConvert.ToString(gridView1.GetRowCellValue(gridView1.FocusedRowHandle, "GBCode"));
                frm.ID  = SysConvert.ToInt32(gridView1.GetRowCellValue(gridView1.FocusedRowHandle, "DtsID"));

                frm.GBCode = GBIDStr;
                frm.ShowDialog();
                txtName_EditValueChanged(null, null);
                ProcessGrid.GridViewFocus(gridView1, new string[] { "GBCode" }, new string[] { GBIDStr });
                //ProcessGrid.GridViewFocus(gridView1, new string[1] { "GBCode" }, new string[1] { frm.GBCode.ToString() });
            }
            catch (Exception E)
            {
                this.ShowMessage(E.Message);
            }
        }
Пример #25
0
 private void txtISN_KeyDown(object sender, KeyEventArgs e)
 {
     try
     {
         if (this.HTDataID != 0 && txtISN.Text.Trim() != string.Empty)
         {
             if (e.KeyCode == Keys.Enter)
             {
                 CheckFormRule rule = new CheckFormRule();
                 if (!chkScanCancel.Checked)
                 {
                     rule.RScan(this.HTDataID, txtISN.Text.Trim(), 1, SysConvert.ToString(drpVendorID.EditValue), SysConvert.ToInt32(drpDataDHID.EditValue), System.DateTime.Now);
                     lbCount.Text = SysConvert.ToInt32((SysConvert.ToInt32(lbCount.Text) - 1)).ToString();
                 }
                 else
                 {
                     rule.RScanCancel(this.HTDataID, txtISN.Text.Trim());
                     lbCount.Text = SysConvert.ToInt32((SysConvert.ToInt32(lbCount.Text) + 1)).ToString();
                 }
                 BindGridDts();
                 lblTime.Text = "扫描时间:" + SysConvert.ToString(gridView1.GetRowCellValue(gridView1.RowCount - 1, "AddTime"));
                 //gridView1.SetRowCellValue(gridView1.FocusedRowHandle+gridView1.RowCount-1, "AddTime", System.DateTime.Now.ToString());
                 ProcessGrid.GridViewFocus(gridView1, new string[1] {
                     "GBCode"
                 }, new string[1] {
                     txtISN.Text.Trim()
                 });
                 txtISN.Text = "";
                 txtISN.Focus();
             }
         }
     }
     catch (Exception E)
     {
         this.ShowMessage(E.Message);
         txtISN.Text = "";
         txtISN.Focus();
     }
 }
Пример #26
0
 /// <summary>
 /// 工厂进阶信息添加
 /// </summary>
 /// <param name="sender"></param>
 /// <param name="e"></param>
 private void btnAddVendor_Click(object sender, EventArgs e)
 {
     try
     {
         frmVendorAdd frm = new frmVendorAdd();
         frm.StartPosition = FormStartPosition.Manual;
         frm.Location      = new Point(580, 280);
         frm.ID            = SysConvert.ToInt32(gridView1.GetRowCellValue(gridView1.FocusedRowHandle, "ID"));
         frm.VendorID      = SysConvert.ToString(gridView1.GetRowCellValue(gridView1.FocusedRowHandle, "VendorID"));
         frm.ShowDialog();
         txtName_EditValueChanged(null, null);
         ProcessGrid.GridViewFocus(gridView1, new string[1] {
             "ID"
         }, new string[1] {
             frm.ID.ToString()
         });
     }
     catch (Exception E)
     {
         this.ShowMessage(E.Message);
     }
 }
Пример #27
0
        /// <summary>
        /// 挂板批量修改
        /// </summary>
        /// <param name="sender"></param>
        /// <param name="e"></param>
        private void btnUpdateGBPL_Click(object sender, EventArgs e)
        {
            try
            {
                string GBIDStr = "";
                this.BaseFocusLabel.Focus();
                frmUpdateGBPL frm = new frmUpdateGBPL();

                for (int i = 0; i < gridView1.RowCount; i++)
                {
                    if (SysConvert.ToInt32(gridView1.GetRowCellValue(gridView1.FocusedRowHandle, "SelectFlag")) == 0)
                    {
                        this.ShowMessage("请先勾选,再进行挂板批量修改");
                        return;
                    }
                    if (SysConvert.ToInt32(gridView1.GetRowCellValue(i, "SelectFlag")) == 1)
                    {
                        if (GBIDStr != "")
                        {
                            GBIDStr += ",";
                        }
                        GBIDStr += SysConvert.ToString(gridView1.GetRowCellValue(i, "GBCode"));
                    }
                }

                //frm.ID = SysConvert.ToInt32(gridView1.GetRowCellValue(gridView1.FocusedRowHandle, "DtsID"));
                frm.GBCode = GBIDStr;
                frm.ShowDialog();
                txtName_EditValueChanged(null, null);
                ProcessGrid.GridViewFocus(gridView1, new string[] { "GBCode" }, new string[] { GBIDStr });
                //ProcessGrid.GridViewFocus(gridView1, new string[1] { "GBCode" }, new string[1] { frm.GBCode.ToString() });
            }
            catch (Exception E)
            {
                this.ShowMessage(E.Message);
            }
        }
Пример #28
0
        public override void btnLoad_Click(object sender, EventArgs e)
        {
            if (!FCommon.RightCheck(this.FormID, this.RightFormID, this.FormListAID, this.FormListBID, RightSub.权限0))
            {
                this.ShowMessage("没有此权限,请联系管理员");
                return;
            }
            ButtonItem        btn    = (ButtonItem)sender;
            PaymentHandleRule rule   = new PaymentHandleRule();
            PaymentHandle     entity = new PaymentHandle();

            entity.ID = HTDataID;
            entity.SelectByID();
            if (btn.Text == "撤销已阅")
            {
                if (entity.ReadFlag == 0)
                {
                    this.ShowMessage("该单据还未阅,无需撤销");
                    return;
                }
                entity.ReadFlag = 0;
                rule.RUpdate(entity);
            }
            if (btn.Text == "已阅")
            {
                if (entity.ReadFlag == 1)
                {
                    this.ShowMessage("该单据已阅,无需再阅");
                    return;
                }
                entity.ReadFlag = 1;
                rule.RUpdate(entity);
            }
            btnQuery_Click(null, null);
            ProcessGrid.GridViewFocus(gridView1, new string[] { "ID" }, new string[] { entity.ID.ToString() });
        }
Пример #29
0
        /// <summary>
        /// 进入下一站  更新当前站完成日期 将站别+1
        /// </summary>
        /// <param name="sender"></param>
        /// <param name="e"></param>
        private void BtnNext_Click(object sender, EventArgs e)
        {
            try
            {
                this.BaseFocusLabel.Focus();
                int MainID = SysConvert.ToInt32(gridView1.GetRowCellValue(gridView1.FocusedRowHandle, "MainID"));
                int DtsID  = SysConvert.ToInt32(gridView1.GetRowCellValue(gridView1.FocusedRowHandle, "DtsID"));
                int SubSeq = SysConvert.ToInt32(gridView1.GetRowCellValue(gridView1.FocusedRowHandle, "SubSeq"));
                int StepID = SysConvert.ToInt32(gridView1.GetRowCellValue(gridView1.FocusedRowHandle, "StepID"));
                int KBFlag = SysConvert.ToInt32(gridView1.GetRowCellValue(gridView1.FocusedRowHandle, "KBFlag"));
                int ID     = 0;

                string sql = " select * from WO_TowelProductionPlanDtsStep where 1=1 ";
                sql += " and MainID = " + MainID;
                sql += " and DtsID = " + DtsID;
                sql += " and SubSeq = " + SubSeq;
                sql += " and StepID = " + StepID;
                DataTable dt = SysUtils.Fill(sql);
                if (dt.Rows.Count == 1)
                {
                    ID = SysConvert.ToInt32(dt.Rows[0]["ID"]);
                    TowelProductionPlanDtsStep     entityStep = new TowelProductionPlanDtsStep();
                    TowelProductionPlanDtsStepRule Steprule   = new TowelProductionPlanDtsStepRule();
                    entityStep.ID = ID;
                    entityStep.SelectByID();

                    decimal QtyAll = SysConvert.ToDecimal(entityStep.ZPQty) + SysConvert.ToDecimal(entityStep.CPQty);
                    if (QtyAll <= 0)
                    {
                        this.ShowInfoMessage("请输入正品数、次品数");
                        txtZPQty.Focus();
                        return;
                    }

                    entityStep.CompleteDate = DateTime.Now;
                    Steprule.RUpdate(entityStep);
                }
                else
                {
                    this.ShowInfoMessage("请先保存数据");
                    return;
                }


                TowelProductionPlanDts     entity = new TowelProductionPlanDts();
                TowelProductionPlanDtsRule rule   = new TowelProductionPlanDtsRule();
                entity.ID = DtsID;
                entity.SelectByID();

                if (this.FormListAID == (int)EnumWOType.剪片) //在剪片这一站需要判断是否要拷边
                {
                    if (KBFlag == 1)                        //拷边标志=1  需要拷边 加一站
                    {
                        entity.StepID = StepID + 1;
                    }
                    else
                    {
                        entity.StepID = StepID + 2;
                    }
                }
                else
                {
                    entity.StepID = StepID + 1;
                }


                rule.RUpdate(entity);

                GetCondtion();
                BindGrid();
                ProcessGrid.GridViewFocus(gridView1, new string[] { "DtsID" }, new string[] { DtsID.ToString() });
            }
            catch (Exception E)
            {
                this.ShowMessage(E.Message);
            }
        }
Пример #30
0
        /// <summary>
        /// 扫描条码
        /// </summary>
        /// <param name="sender"></param>
        /// <param name="e"></param>
        private void txtScanCode_KeyDown(object sender, KeyEventArgs e)
        {
            try
            {
                if (e.KeyCode == Keys.Enter)
                {
                    if (HTFormStatus != FormStatus.查询)
                    {
                        this.ShowMessage("请先保存再扫描");
                        txtScanCode.Text = string.Empty;
                        return;
                    }

                    if (HTDataSubmitFlag != (int)YesOrNo.No)
                    {
                        this.ShowMessage("只有未提交才允许扫描");
                        txtScanCode.Text = string.Empty;
                        return;
                    }

                    string ScanCode = txtScanCode.Text.Trim();
                    txtScanCode.Text = string.Empty;
                    if (ScanCode == string.Empty)
                    {
                        this.ShowMessage("请扫描挂板条形码");
                        return;
                    }
                    if (!checkScanCode(ScanCode))
                    {
                        this.ShowMessage("挂板条形码不存在,请检查后重新扫描");
                        return;
                    }
                    if (!CheckDouble(ScanCode))
                    {
                        this.ShowMessage("请勿重复扫描");
                        return;
                    }
                    //if (!checkSameGB(ScanCode)) //深圳那边提出,剪样后可以重复扫描,sc 2013.12.18
                    //{
                    //    return;
                    //}
                    //if (!checkScanStatus(ScanCode))
                    //{
                    //    return;
                    //}

                    //插入明细数据
                    GBJCLRDts     entity = new GBJCLRDts();
                    GBJCLRDtsRule rule   = new GBJCLRDtsRule();
                    entity.MainID       = this.HTDataID;
                    entity.Seq          = SelectSeq(HTDataID);
                    entity.GBCode       = ScanCode;             //挂板条码
                    entity.GBStatusID   = (int)EnumGBStatus.借出; //挂板状态
                    entity.JCTime       = DateTime.Now.Date;    //借出时间
                    entity.GHOPID       = "";                   //归还操作人
                    entity.LYVendorID   = "";                   //留样客户编码
                    entity.LYVendorName = "";                   //留样客户名称
                    rule.RAdd(entity);
                    BindGrid();
                    ProcessGrid.GridViewFocus(gridView1, new string[1] {
                        "GBCode"
                    }, new string[1] {
                        ScanCode
                    });
                    txtScanCode.Focus();
                }
            }
            catch (Exception E)
            {
                this.ShowMessage(E.Message);
            }
        }