Пример #1
0
        private bool SaveData()
        {
            bsTempMaterial.EndEdit();

            if (!CheckInput())
            {
                return(false);
            }

            string strErr = string.Empty;

            if (Warehouse_Func.SaveTempMaterial(ref _tempmaterial, ref strErr))
            {
                Common.Common_Func.ErrorMessage("临时物料保存成功!" + Environment.NewLine + "临时物料编号为:" + _tempmaterial.TempMaterialNo, "保存成功");
                bsTempMaterial.DataSource = _tempmaterial;
                InitForm();
                _back = Common.Common_Func.ConvertToModel <TempMaterialInfo>(_tempmaterial);
                return(true);
            }
            else
            {
                Common.Common_Func.ErrorMessage(strErr, "保存失败");
                bsTempMaterial.DataSource = _tempmaterial;
                return(false);
            }
        }
Пример #2
0
        public FrmTempMaterialAlter(TempMaterialInfo model)
        {
            _tempmaterial = model;

            InitializeComponent();

            bsTempMaterial.DataSource = _tempmaterial;
        }
Пример #3
0
        private void InitMainQuery()
        {
            _serverMainPage = new DividPage();
            queryMain       = new TempMaterialInfo();
            lstMain         = new List <TempMaterialInfo>();

            pageList.GetShowCountsByDGV(dgvList);
            bsMain.DataSource = queryMain;
        }
Пример #4
0
        private void ShowFileForm(TempMaterialInfo tempmaterail)
        {
            using (FrmTempMaterialFile frm = new FrmTempMaterialFile(tempmaterail))
            {
                frm.ShowDialog();
            }

            GetListQueryData();
        }
Пример #5
0
        private void InitForm()
        {
            _sapmaterial = new TempMaterialInfo();

            bsTempMaterial.ResetBindings(false);
            bsTempMaterial.EndEdit();

            txtMaterialNo.Focus();
            txtMaterialNo.SelectAll();
        }
Пример #6
0
 private void SetNewModel()
 {
     if (_tempmaterial == null)
     {
         _tempmaterial = new TempMaterialInfo();
     }
     _tempmaterial.ID = 0;
     _tempmaterial.TempMaterialStatus = 1;
     _tempmaterial.IsDel = 1;
 }
Пример #7
0
        private void EditListRow(int iRowIndex)
        {
            TempMaterialInfo warehouse = GetListRowModel(iRowIndex);

            if (warehouse == null)
            {
                return;
            }

            ShowFileForm(warehouse);
        }
Пример #8
0
        private void AddTempMaterial()
        {
            TempMaterialInfo tempmaterial = new TempMaterialInfo()
            {
                ID = 0
            };

            string strError = string.Empty;

            //Warehouse_Func.GetTempMaterialNo(ref tempmaterial, ref strError);
            ShowFileForm(tempmaterial);
        }
Пример #9
0
        private void ClearForm()
        {
            _tempmaterial = new TempMaterialInfo();
            SetNewModel();

            string strError = string.Empty;

            //Warehouse_Func.GetTempMaterialNo(ref _tempmaterial, ref strError);
            bsTempMaterial.DataSource = _tempmaterial;
            bsTempMaterial.EndEdit();

            txtTempMaterialNo.Focus();
        }
Пример #10
0
        private TempMaterialInfo GetListRowModel(int iRowIndex)
        {
            string           strErr       = string.Empty;
            TempMaterialInfo tempmaterial = new TempMaterialInfo();

            tempmaterial.ID = lstMain[iRowIndex].ID;

            if (!Warehouse_Func.GetTempMaterialByID(ref tempmaterial, ref strErr))
            {
                Common.Common_Func.ErrorMessage(strErr, "读取失败");
                GetListQueryData();
                return(null);
            }

            return(tempmaterial);
        }
Пример #11
0
        public FrmTempMaterialFile(TempMaterialInfo model)
        {
            if (model == null)
            {
                model = new TempMaterialInfo();
            }
            _tempmaterial = model;
            if (model.ID == 0)
            {
                SetNewModel();
            }

            _back = Common.Common_Func.ConvertToModel <TempMaterialInfo>(_tempmaterial);

            InitializeComponent();

            bsTempMaterial.DataSource = _tempmaterial;
        }
Пример #12
0
        private void GetSAPMaterial()
        {
            _sapmaterial            = new TempMaterialInfo();
            _sapmaterial.MaterialNo = txtMaterialNo.Text.Trim();
            string strError = string.Empty;

            if (Warehouse_Func.GetMaterialInfo(ref _sapmaterial, ref strError))
            {
                _tempmaterial.MaterialNo   = _sapmaterial.MaterialNo;
                _tempmaterial.MaterialDesc = _sapmaterial.MaterialDesc;
            }
            else
            {
                _sapmaterial = null;
                _tempmaterial.MaterialDesc = "";

                MessageBox.Show(strError, "获取SAP物料失败");
            }
        }
Пример #13
0
        private void ShowAlterForm(int iRowIndex)
        {
            TempMaterialInfo tempmaterial = GetListRowModel(iRowIndex);

            if (tempmaterial == null)
            {
                return;
            }

            if (!string.IsNullOrEmpty(tempmaterial.MaterialNo))
            {
                Common.Common_Func.ErrorMessage(string.Format("临时物料【{0}】已与SAP物料【{1}】发生绑定,不允许重新替换", tempmaterial.TempMaterialDesc, tempmaterial.MaterialDesc), "替换失败");
                return;
            }

            using (FrmTempMaterialAlter frm = new FrmTempMaterialAlter(tempmaterial))
            {
                frm.ShowDialog();
            }

            GetListQueryData();
        }
Пример #14
0
        private bool GetMaterialInfo()
        {
            TempMaterialInfo material = new TempMaterialInfo();

            material.MaterialNo = txtMaterialNo.Text.Trim();
            string strError = string.Empty;

            if (Print_Func.GetMaterialInfo(ref material, 3, ref strError))
            {
                parameter.MATERIALNO   = material.MaterialNo;
                parameter.MATERIALDESC = material.MaterialDesc;
                parameter.Unit         = material.Unit;
                parameter.ISROHS       = material.IsRohs;

                txtMaterialNo.Enabled   = false;
                btnGetMaterial.Enabled  = false;
                txtBatchNo.Enabled      = true;
                txtSupCode.Enabled      = true;
                txtSupName.Enabled      = true;
                txtOutPackQty.Enabled   = true;
                cbxPlatedSilver.Enabled = true;
                cbxPlatedTin.Enabled    = true;
                cbxOther.Enabled        = true;
                txtPrintQty.Enabled     = true;
                tsmiPrint.Enabled       = true;

                txtBatchNo.Focus();
                txtBatchNo.SelectAll();
                return(true);
            }
            else
            {
                txtMaterialNo.Focus();
                txtMaterialNo.SelectAll();

                return(false);
            }
        }
Пример #15
0
 private void GetQueryMain()
 {
     if (queryMain == null)
     {
         queryMain = new TempMaterialInfo(); bsMain.DataSource = queryMain;
     }
     if (dtpStartTime.Checked)
     {
         queryMain.StartTime = dtpStartTime.Value;
     }
     else
     {
         queryMain.StartTime = null;
     }
     if (dtpEndTime.Checked)
     {
         queryMain.EndTime = dtpEndTime.Value;
     }
     else
     {
         queryMain.EndTime = null;
     }
 }
Пример #16
0
        private void DeleteListRow(int iRowIndex)
        {
            TempMaterialInfo tempmaterial = GetListRowModel(iRowIndex);

            if (tempmaterial == null)
            {
                return;
            }

            if (MessageBox.Show(string.Format("是否确认删除临时物料【{0}】?", tempmaterial.TempMaterialDesc), "确认删除", MessageBoxButtons.YesNo, MessageBoxIcon.Asterisk) == DialogResult.No)
            {
                return;
            }

            try
            {
                if (tempmaterial.IsDel != 2)
                {
                    string strErr = string.Empty;
                    if (!Warehouse_Func.DeleteTempMaterialByID(tempmaterial, ref strErr))
                    {
                        Common.Common_Func.ErrorMessage(strErr, "删除失败");
                        return;
                    }
                }

                Common.Common_Func.ErrorMessage("删除临时物料成功", "删除成功");
            }
            catch (Exception ex)
            {
                Common.Common_Func.ErrorMessage(ex.Message);
            }
            finally
            {
                GetListQueryData();
            }
        }
Пример #17
0
 public static bool GetMaterialInfo(ref TempMaterialInfo model, ref string strError)
 {
     return(WMSWebService.service.GetMaterialInfo(ref model, 1, Common_Var.CurrentUser, ref strError));
 }
Пример #18
0
 public static bool GetTempMaterialListByPage(ref List <TempMaterialInfo> modelList, TempMaterialInfo model, ref DividPage page, ref string strError)
 {
     //TempMaterialInfo[] modelArray = modelList.ToArray();
     //bool bResult = WMSWebService.service.GetAreaListByPage(ref modelArray, model, ref page, Common_Var.CurrentUser, ref strError);
     //if (bResult) modelList = modelArray.ToList();
     //return bResult;
     return(WMSWebService.service.GetTempMaterialListByPage(ref modelList, model, ref page, Common_Var.CurrentUser, ref strError));
 }
Пример #19
0
 public static bool DeleteTempMaterialByID(TempMaterialInfo model, ref string strError)
 {
     return(WMSWebService.service.DeleteTempMaterialByID(model, Common_Var.CurrentUser, ref strError));
 }