Esempio n. 1
0
        private object GetEditObject()
        {
            if (this.ValidateInput())
            {
                MaterialReceive materialReceive = this._IQCFacade.CreateNewMaterialReceive();

                materialReceive.IQCNo     = FormatHelper.PKCapitalFormat(FormatHelper.CleanString(txtIQCNoEdit.Text));
                materialReceive.STLine    = int.Parse(txtIQCLineEdit.Text);
                materialReceive.OrderNo   = FormatHelper.PKCapitalFormat(FormatHelper.CleanString(txtPurchaseOrderNoEdit.Text));
                materialReceive.OrderLine = int.Parse(txtPurchaseOrderLineEdit.Text);

                materialReceive.StorageID      = FormatHelper.PKCapitalFormat(FormatHelper.CleanString(txtStorageIDEdit.Text));
                materialReceive.RealReceiveQty = int.Parse(txtRealReceiveQtyEdit.Text);
                materialReceive.ReceiveMemo    = txtReceiveMemoEdit.Text;

                materialReceive.AccountDate = FormatHelper.TODateInt(datAccountDateEdit.Text);
                materialReceive.VoucherDate = FormatHelper.TODateInt(datVoucherDateEdit.Text);

                IQCDetail iqcDetail = (IQCDetail)this._IQCFacade.GetIQCDetail(materialReceive.IQCNo, materialReceive.STLine);
                if (iqcDetail != null)
                {
                    materialReceive.STNo           = iqcDetail.STNo;
                    materialReceive.OrganizationID = iqcDetail.OrganizationID;
                    materialReceive.ItemCode       = iqcDetail.ItemCode;
                    materialReceive.Unit           = iqcDetail.Unit;
                }

                return(materialReceive);
            }
            else
            {
                return(null);
            }
        }
Esempio n. 2
0
        public IQCDetail CreateNewIQCDetail()
        {
            IQCDetail detail = new IQCDetail();

            detail.CheckStatus = "WaitCheck";
            return(detail);
        }
Esempio n. 3
0
 public void AddIQCDetail(IQCDetail iQCDetail, string user)
 {
     iQCDetail.PIC          = user;
     iQCDetail.STDStatus    = "WaitCheck";
     iQCDetail.MaintainDate = FormatHelper.TODateInt(DateTime.Now);
     iQCDetail.MaintainTime = FormatHelper.TOTimeInt(DateTime.Now);
     this._helper.AddDomainObject(iQCDetail);
 }
Esempio n. 4
0
 public bool IsIQCDetailExist(IQCDetail iQCDetail)
 {
     if (this.DataProvider.CustomSearch(typeof(IQCDetail), new object[] { iQCDetail.IQCNo, iQCDetail.STLine }) != null)
     {
         return(true);
     }
     else
     {
         return(false);
     }
 }
Esempio n. 5
0
        private decimal GetReceiveQty(string iqcNo, int stLine)
        {
            decimal returnValue = 0;

            IQCDetail iqcDetail = (IQCDetail)_IQCFacade.GetIQCDetail(iqcNo, stLine);

            if (iqcDetail != null)
            {
                returnValue = GetReceiveQty(iqcDetail);
            }

            return(returnValue);
        }
Esempio n. 6
0
        private object GetEditObject(Infragistics.WebUI.UltraWebGrid.UltraGridRow row)
        {
            object obj = this._IQCFacade.GetMaterialReceive(row.Cells.FromKey("IQCNo").Text, int.Parse(row.Cells.FromKey("ASNLine").Text));

            if (obj == null)
            {
                obj = this._IQCFacade.GetIQCDetail(row.Cells.FromKey("IQCNo").Text, int.Parse(row.Cells.FromKey("ASNLine").Text));
                if (obj != null)
                {
                    MaterialReceive materialReceive = this._IQCFacade.CreateNewMaterialReceive();

                    materialReceive.IQCNo     = ((IQCDetail)obj).IQCNo;
                    materialReceive.STLine    = ((IQCDetail)obj).STLine;
                    materialReceive.OrderNo   = ((IQCDetail)obj).OrderNo;
                    materialReceive.OrderLine = ((IQCDetail)obj).OrderLine;

                    materialReceive.StorageID      = ((IQCDetail)obj).StorageID;
                    materialReceive.RealReceiveQty = int.Parse(GetReceiveQty(((IQCDetail)obj).IQCNo, ((IQCDetail)obj).STLine).ToString("0"));
                    materialReceive.ReceiveMemo    = string.Empty;

                    materialReceive.AccountDate = FormatHelper.TODateInt(DateTime.Now);
                    materialReceive.VoucherDate = FormatHelper.TODateInt(DateTime.Now);

                    IQCDetail iqcDetail = (IQCDetail)this._IQCFacade.GetIQCDetail(materialReceive.IQCNo, materialReceive.STLine);
                    if (iqcDetail != null)
                    {
                        materialReceive.STNo           = iqcDetail.STNo;
                        materialReceive.OrganizationID = iqcDetail.OrganizationID;
                        materialReceive.ItemCode       = iqcDetail.ItemCode;
                        materialReceive.Unit           = iqcDetail.Unit;
                    }

                    obj = materialReceive;
                }
            }

            if (obj != null)
            {
                return((MaterialReceive)obj);
            }

            return(null);
        }
Esempio n. 7
0
        private bool ValidateInput()
        {
            string checkMessage = string.Empty;

            PageCheckManager manager = new PageCheckManager();

            manager.Add(new LengthCheck(lblStorageIDEdit, txtStorageIDEdit, 4, true));
            manager.Add(new NumberCheck(lblRealReceiveQtyEdit, txtRealReceiveQtyEdit, 1, 9999999999999, true));
            manager.Add(new DateCheck(lblAccountDateEdit, datAccountDateEdit.Text, true));
            manager.Add(new DateCheck(lblVoucherDateEdit, datVoucherDateEdit.Text, true));

            if (!manager.Check())
            {
                checkMessage += manager.CheckMessage;
            }

            if (checkMessage.Trim().Length > 0)
            {
                WebInfoPublish.Publish(this, checkMessage, languageComponent1);
                return(false);
            }

            //实际接收数量不能大于预计送货数量
            IQCDetail iqcDetail = (IQCDetail)_IQCFacade.GetIQCDetail(FormatHelper.PKCapitalFormat(FormatHelper.CleanString(txtIQCNoEdit.Text)), int.Parse(txtIQCLineEdit.Text));

            if (iqcDetail != null && long.Parse(txtRealReceiveQtyEdit.Text) > GetReceiveQty((IQCDetail)iqcDetail))
            {
                WebInfoPublish.Publish(this, "$Error_RealReceiveQtyCannotBiggerThanReceiveQty", languageComponent1);
                return(false);
            }

            //检查入库库别(页面上输入的是tblstorage.sapstorage)
            string sapStorage = FormatHelper.PKCapitalFormat(FormatHelper.CleanString(txtStorageIDEdit.Text));

            object[] storageList = this.InvFacade.QueryStorageByOrgId(iqcDetail.OrganizationID, sapStorage);
            if (storageList == null)
            {
                WebInfoPublish.Publish(this, "$INVALID_STORGE", languageComponent1);
                return(false);
            }

            return(true);
        }
Esempio n. 8
0
        private decimal GetReceiveQty(IQCDetail iqcDetail)
        {
            decimal returnValue = 0;

            if (iqcDetail.CheckStatus == IQCCheckStatus.IQCCheckStatus_Qualified)
            {
                //合格时,接收数量为采购数量
                returnValue = iqcDetail.ReceiveQty;
            }
            else if (iqcDetail.CheckStatus == IQCCheckStatus.IQCCheckStatus_UnQualified)
            {
                if (iqcDetail.ConcessionStatus == "Y")
                {
                    //让步接收时,,接收数量为让步接收数量
                    returnValue = iqcDetail.ConcessionQty;
                }
            }

            return(returnValue);
        }
Esempio n. 9
0
        private object GetEditObject()
        {
            if (this.ValidateInput())
            {
                IQCDetail iqcDetail = this._IQCFacade.CreateNewIQCDetail();

                iqcDetail.IQCNo        = FormatHelper.PKCapitalFormat(FormatHelper.CleanString(this.txtIQCNo.Text));
                iqcDetail.STNo         = FormatHelper.PKCapitalFormat(FormatHelper.CleanString(this.txtSTNO.Text));
                iqcDetail.STLine       = System.Int32.Parse(FormatHelper.CleanString(this.txtPageLineNumber.Text));
                iqcDetail.Attribute    = FormatHelper.CleanString(this.DrpControlserverType.SelectedValue);
                iqcDetail.ReceiveQty   = Math.Round(Convert.ToDecimal(FormatHelper.CleanString(this.txtSendQty.Text)), 2);
                iqcDetail.PurchaseMEMO = FormatHelper.PKCapitalFormat(FormatHelper.CleanString(this.txtPurchaseMEMO.Text));

                return(iqcDetail);
            }
            else
            {
                return(null);
            }
        }
Esempio n. 10
0
 public void UpdateIQCDetail(IQCDetail iQCDetail)
 {
     iQCDetail.MaintainDate = FormatHelper.TODateInt(DateTime.Now);
     iQCDetail.MaintainTime = FormatHelper.TOTimeInt(DateTime.Now);
     this._helper.UpdateDomainObject(iQCDetail);
 }
Esempio n. 11
0
        protected override void SetEditObject(object obj)
        {
            if (obj == null)
            {
                this.txtIQCLineNo.Text  = "";
                this.txtItemNo.Text     = "";
                this.txtItemName.Text   = "";
                this.datePlanDate.Text  = "";
                this.txtPlanQty.Text    = "";
                this.txtUnit.Text       = "";
                this.txtOrderNo.Text    = "";
                this.txtOrderLine.Text  = "";
                this.txtReceiveQty.Text = "";

                this.lblStatusQualified.Checked   = false;
                this.lblStatusUnqualified.Checked = false;
                this.lblStatusWaitCheck.Checked   = false;
                this.txtSampleQty.Text            = "";
                this.txtNGQty.Text                  = "";
                this.txtMemoEx.Text                 = "";
                this.txtMemo.Text                   = "";
                this.txtPIC.Text                    = "";
                this.txtAction.Text                 = "";
                this.lblStatusSTS.Checked           = false;
                this.drpItemAttribute.SelectedIndex = -1;
                return;
            }

            IQCDetail iqcDetail = (IQCDetail)obj;

            this.txtIQCLineNo.Text = iqcDetail.STLine.ToString();
            this.txtItemNo.Text    = iqcDetail.ItemCode;
            //this.datePlanDate.Text = iqcDetail.PlanDate.ToString().Insert(6, "/").Insert(4, "/");
            //this.txtPlanQty.Text = iqcDetail.PlanQty.ToString();
            this.txtUnit.Text       = iqcDetail.Unit;
            this.txtOrderNo.Text    = iqcDetail.OrderNo;
            this.txtOrderLine.Text  = iqcDetail.OrderLine.ToString();
            this.txtReceiveQty.Text = iqcDetail.ReceiveQty.ToString();

            this.lblStatusQualified.Checked   = false;
            this.lblStatusUnqualified.Checked = false;
            this.lblStatusWaitCheck.Checked   = false;
            if (iqcDetail.CheckStatus.Trim().ToUpper().Equals("WAITCHECK"))
            {
                this.lblStatusWaitCheck.Checked = true;
            }
            if (iqcDetail.CheckStatus.Trim().ToUpper().Equals("QUALIFIED"))
            {
                this.lblStatusQualified.Checked = true;
            }
            if (iqcDetail.CheckStatus.Trim().ToUpper().Equals("UNQUALIFIED"))
            {
                this.lblStatusUnqualified.Checked = true;
            }

            this.txtSampleQty.Text = iqcDetail.SampleQty.ToString();
            this.txtNGQty.Text     = iqcDetail.NGQty.ToString();
            this.txtMemoEx.Text    = iqcDetail.MemoEx;
            this.txtMemo.Text      = iqcDetail.Memo;
            this.txtPIC.Text       = iqcDetail.PIC;
            this.txtAction.Text    = iqcDetail.Action;
            try
            {
                this.drpItemAttribute.SelectedValue = iqcDetail.Attribute;
            }
            catch
            {
                this.drpItemAttribute.SelectedIndex = -1;
            }


            this.txtSTDStatus.Text = iqcDetail.STDStatus;
        }
Esempio n. 12
0
        protected override object GetEditObject()
        {
            //this.ValidateInput();
            if (_facade == null)
            {
                _facade = new InterfaceModelFacadeFactory(base.DataProvider).Create();
            }
            IQCDetail iqcDetail = this._facade.CreateNewIQCDetail();

            iqcDetail.STLine   = int.Parse(FormatHelper.CleanString(this.txtIQCLineNo.Text, 6));
            iqcDetail.ItemCode = FormatHelper.CleanString(this.txtItemNo.Text, 40);
            //iqcDetail.PlanDate = FormatHelper.TODateInt(this.datePlanDate.Text);
            //if (FormatHelper.CleanString(this.txtPlanQty.Text).Length != 0)
            //{
            //    iqcDetail.PlanQty = decimal.Parse(FormatHelper.CleanString(this.txtPlanQty.Text));
            //}
            //else
            //{
            //    iqcDetail.PlanQty = 0;
            //}
            iqcDetail.Unit      = FormatHelper.CleanString(this.txtUnit.Text, 40);
            iqcDetail.OrderNo   = FormatHelper.CleanString(this.txtOrderNo.Text, 40);
            iqcDetail.OrderLine = int.Parse(FormatHelper.CleanString(this.txtOrderLine.Text, 22));
            if (FormatHelper.CleanString(this.txtReceiveQty.Text).Length != 0)
            {
                iqcDetail.ReceiveQty = decimal.Parse(FormatHelper.CleanString(this.txtReceiveQty.Text));
            }
            else
            {
                iqcDetail.ReceiveQty = 0;
            }
            if (this.lblStatusQualified.Checked)
            {
                iqcDetail.CheckStatus = "Qualified";
            }
            if (this.lblStatusUnqualified.Checked)
            {
                iqcDetail.CheckStatus = "UnQualified";
            }
            if (this.lblStatusWaitCheck.Checked)
            {
                iqcDetail.CheckStatus = "WaitCheck";
            }

            if (FormatHelper.CleanString(this.txtSampleQty.Text).Length != 0)
            {
                iqcDetail.SampleQty = decimal.Parse(FormatHelper.CleanString(this.txtSampleQty.Text));
            }
            else
            {
                iqcDetail.SampleQty = 0;
            }
            if (FormatHelper.CleanString(this.txtNGQty.Text).Length != 0)
            {
                iqcDetail.NGQty = decimal.Parse(FormatHelper.CleanString(this.txtNGQty.Text));
            }
            else
            {
                iqcDetail.NGQty = 0;
            }
            iqcDetail.MemoEx = FormatHelper.CleanString(this.txtMemoEx.Text, 100);
            iqcDetail.Memo   = FormatHelper.CleanString(this.txtMemo.Text, 100);
            iqcDetail.PIC    = FormatHelper.CleanString(this.txtPIC.Text, 100);
            iqcDetail.Action = FormatHelper.CleanString(this.txtAction.Text, 100);

            iqcDetail.IQCNo     = FormatHelper.CleanString(this.txtIQCNo.Text, 50);
            iqcDetail.STNo      = FormatHelper.CleanString(this.txtASNNo.Text, 40);
            iqcDetail.Attribute = this.drpItemAttribute.SelectedValue;
            iqcDetail.STDStatus = this.txtSTDStatus.Text;
            return(iqcDetail);
        }
Esempio n. 13
0
        protected void cmdIQCCancel_ServerClick(object sender, System.EventArgs e)
        {
            ArrayList array = this.gridHelper.GetCheckedRows();

            if (array.Count > 0)
            {
                ArrayList items       = new ArrayList();
                ArrayList itemsFailed = new ArrayList();

                foreach (GridRecord row in array)
                {
                    IQCDetail iqcDetail = (IQCDetail)this.GetEditObject(row);
                    if (iqcDetail != null)
                    {
                        if (iqcDetail.STDStatus == IQCStatus.IQCStatus_New)
                        {
                            items.Add(iqcDetail);
                        }
                        else if (iqcDetail.STDStatus == IQCStatus.IQCStatus_WaitCheck)
                        {
                            if (iqcDetail.ConcessionStatus == "Y")
                            {
                                itemsFailed.Add((IQCDetail)iqcDetail);
                            }
                            else if (_IQCFacade.GetMaterialReceive(iqcDetail.IQCNo, iqcDetail.STLine) == null)
                            {
                                items.Add((IQCDetail)iqcDetail);
                            }
                            else
                            {
                                itemsFailed.Add((IQCDetail)iqcDetail);
                            }
                        }
                        else
                        {
                            itemsFailed.Add(iqcDetail);
                        }
                    }
                }

                _IQCFacade.CancelIQCDetail((IQCDetail[])items.ToArray(typeof(IQCDetail)), this.GetUserCode());

                this.RequestData();
                this.buttonHelper.PageActionStatusHandle(PageActionType.Query);

                string message = string.Empty;

                if (items != null && items.Count > 0)
                {
                    message += "$Message_IQCCancelOK" + " : \n";
                    foreach (IQCDetail item in items)
                    {
                        message += item.IQCNo + "," + item.STLine + "\n";
                    }
                }

                if (itemsFailed != null && itemsFailed.Count > 0)
                {
                    if (message.Trim().Length > 0)
                    {
                        message += "\n";
                    }

                    message += "$Message_IQCCancelFailed" + " : \n";
                    foreach (IQCDetail item in itemsFailed)
                    {
                        message += item.IQCNo + "," + item.STLine + "\n";
                    }
                }

                if (message.Trim().Length > 0)
                {
                    WebInfoPublish.PublishInfo(this, message, languageComponent1);
                }
            }
        }