Exemplo n.º 1
0
        protected override object GetEditObject()
        {
            //this.ValidateInput();
            if (_facade == null)
            {
                _facade = new InterfaceModelFacadeFactory(base.DataProvider).Create();
            }
            IQCHead iqcHead = this._facade.CreateNewIQCHead();

            iqcHead.IQCNo         = FormatHelper.CleanString(this.txtIQCNoEdit.Text, 50);
            iqcHead.STNo          = FormatHelper.CleanString(this.txtASNNoEdit.Text, 40);
            iqcHead.ROHS          = this.lblROHSEdit.Checked.ToString().ToUpper();
            iqcHead.InventoryUser = FormatHelper.CleanString(this.txtInvUserEdit.Text, 100);
            iqcHead.Applicant     = FormatHelper.CleanString(this.txtApplicantEdit.Text, 100);
            iqcHead.Inspector     = FormatHelper.CleanString(this.txtInspectorEdit.Text, 100);
            iqcHead.LotNo         = FormatHelper.CleanString(this.txtLotNoEdit.Text, 100);
            iqcHead.InspectDate   = FormatHelper.TODateInt(this.dateInspectDateEdit.Text);
            iqcHead.ProduceDate   = FormatHelper.TODateInt(this.dateProductDateEdit.Text);
            iqcHead.Standard      = FormatHelper.CleanString(this.txtStandardEdit.Text, 100);
            iqcHead.Method        = FormatHelper.CleanString(this.txtMethodEdit.Text, 100);
            iqcHead.Result        = FormatHelper.CleanString(this.txtResultEdit.Text, 100);
            iqcHead.ReceiveDate   = FormatHelper.TODateInt(this.dateReceiveDateEdit.Text);
            iqcHead.PIC           = FormatHelper.CleanString(this.txtPICEdit.Text, 100);
            iqcHead.Status        = this.txtStatus.Text;
            return(iqcHead);
        }
Exemplo n.º 2
0
        public void AddIQCHead(IQCHead iQCHead, string user)
        {
            this.DataProvider.BeginTransaction();
            string sql = "";

            sql += "INSERT INTO tblasniqc";
            sql += "            (iqcno, stno, invuser,";
            sql += "             status, applicant, appdate, apptime, lotno, inspdate, proddate,";
            sql += "             STANDARD, method, RESULT, receivedate, pic, inspector, rohs,";
            sql += "             mdate, mtime, muser";
            sql += "            )";
            sql += "     VALUES ('" + iQCHead.IQCNo + "', '" + iQCHead.STNo + "', '" + iQCHead.InventoryUser + "',";
            sql += "             'WaitCheck', '" + iQCHead.Applicant + "', TO_NUMBER (TO_CHAR (SYSDATE, 'yyyyMMdd')), TO_NUMBER (TO_CHAR (SYSDATE, 'hh24mmss')), '" + iQCHead.LotNo + "', " + iQCHead.InspectDate + ", " + iQCHead.ProduceDate + ",";
            sql += "             '" + iQCHead.Standard + "', '" + iQCHead.Method + "', '" + iQCHead.Result + "', " + iQCHead.ReceiveDate + ", '" + iQCHead.PIC + "', '" + iQCHead.Inspector + "', '" + iQCHead.ROHS + "',";
            sql += "               TO_NUMBER (TO_CHAR (SYSDATE, 'yyyyMMdd')),";
            sql += "                   TO_NUMBER (TO_CHAR (SYSDATE, 'hh24mmss')), '" + user + "'";
            sql += "            )";
            this.DataProvider.CustomExecute(new SQLCondition(sql));

            sql  = "";
            sql += "INSERT INTO tblasn";
            sql += "            (stno, orgid, ";
            sql += "             ststatus,";
            sql += "             mdate, mtime, muser, syncstatus";
            sql += "            )";
            sql += "     VALUES ('" + iQCHead.STNo + "', " + GlobalVariables.CurrentOrganizations.First().OrganizationID + ", ";
            sql += "             'WaitCheck',";
            sql += "             TO_NUMBER (TO_CHAR (SYSDATE, 'yyyyMMdd')), TO_NUMBER (TO_CHAR (SYSDATE, 'hh24mmss')), '" + user + "', 'Closed'";
            sql += "            )";
            this.DataProvider.CustomExecute(new SQLCondition(sql));

            this.DataProvider.CommitTransaction();
        }
Exemplo n.º 3
0
        protected void cmdReturn_ServerClick(object sender, EventArgs e)
        {
            //Response.Redirect(this.MakeRedirectUrl("FCreateIQCMP.aspx?iqcno=" + this.txtIQCNo.Text.Trim().ToUpper()));

            string  asnPO   = string.Empty;
            IQCHead iqcHead = (IQCHead)_IQCFacade.GetIQCHead(this.txtIQCNo.Text.Trim().ToUpper());

            if (iqcHead != null)
            {
                ASN asn = (ASN)_IQCFacade.GetASN(iqcHead.STNo);
                if (asn != null)
                {
                    asnPO = asn.STNo;
                }
            }

            if (asnPO.Trim().Length > 0)
            {
                Response.Redirect(this.MakeRedirectUrl("FCreateIQCMP.aspx?asnpo=" + asnPO));
            }
            else
            {
                Response.Redirect(this.MakeRedirectUrl("FCreateIQCMP.aspx"));
            }
        }
Exemplo n.º 4
0
 private object GetEditObject()
 {
     if (this.ValidateInput())
     {
         IQCHead iqcHead = (IQCHead)this._IQCFacade.GetIQCHead(FormatHelper.PKCapitalFormat(FormatHelper.CleanString(txtIQCNoEdit.Text)));
         iqcHead.Attribute = this.drpIQCHeadAttributeEdit.SelectedValue;
         return(iqcHead);
     }
     else
     {
         return(null);
     }
 }
Exemplo n.º 5
0
        public void UpdateIQCHead(IQCHead iQCHead)
        {
            string sql = "";

            sql += string.Format("UPDATE tblasniqc SET applicant='{0}', ", iQCHead.Applicant);
            sql += string.Format(" inspector='{0}', ", iQCHead.Inspector);
            sql += string.Format(" lotno='{0}', ", iQCHead.LotNo);
            sql += string.Format(" inspdate='{0}', ", iQCHead.InspectDate);
            sql += string.Format(" proddate='{0}', ", iQCHead.ProduceDate);
            sql += string.Format(" standard='{0}', ", iQCHead.Standard);
            sql += string.Format(" method='{0}', ", iQCHead.Method);
            sql += string.Format(" result='{0}', ", iQCHead.Result);
            sql += string.Format(" receivedate='{0}', ", iQCHead.ReceiveDate);
            sql += string.Format(" pic='{0}' ", iQCHead.PIC);
            sql += string.Format(" WHERE iqcno='{0}'", iQCHead.IQCNo);
            this.DataProvider.CustomExecute(new SQLCondition(sql));
        }
Exemplo n.º 6
0
        //protected void cmdCreateIQCFromPO_ServerClick(object sender, System.EventArgs e)
        //{
        //    if (!ValidateInputForCreateIQCByPO())
        //    {
        //        return;
        //    }

        //    string poNo = FormatHelper.PKCapitalFormat(FormatHelper.CleanString(this.txtPOEdit.Text));
        //    string materialList = txtPOMaterialEdit.Text;

        //    if (_IQCFacade.CreateIQCFromSRM("PO", poNo, materialList, this.GetUserCode()))
        //    {
        //        this.txtPOEdit.Text = string.Empty;
        //        this.txtPOMaterialEdit.Text = string.Empty;

        //        this.txtIQCNoQuery.Text = string.Empty;
        //        this.txtASNPOQuery.Text = "PO" + poNo;
        //        this.txtVendorCodeQuery.Text = string.Empty;
        //        this.drpIQCStatusQuery.SelectedValue = "New";
        //        this.drpROHSQuery.SelectedIndex = 0;
        //        this.drpShipToStockQuery.SelectedIndex = 0;
        //        this.datAppDateFromQuery.Text = string.Empty;
        //        this.datAppDateToQuery.Text = string.Empty;

        //        this.RequestData();
        //        this.buttonHelper.PageActionStatusHandle(PageActionType.Query);
        //    }
        //    else
        //    {
        //        WebInfoPublish.PublishInfo(this, "$Error_InvalidPOToCreateIQC", languageComponent1);
        //    }
        //}

        protected void cmdDelete_ServerClick(object sender, System.EventArgs e)
        {
            ArrayList array = this.gridHelper.GetCheckedRows();

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

                foreach (GridRecord row in array)
                {
                    IQCHead iqcHead = (IQCHead)this.GetEditObject(row);
                    if (iqcHead != null)
                    {
                        if (this._IQCFacade.IsFromASN(iqcHead.STNo))
                        {
                            WebInfoPublish.Publish(this, "$ONLY_PO_CAN_DELETE $IQCNo:" + iqcHead.IQCNo, this.languageComponent1);
                            this.RequestData();
                            return;
                        }

                        if (iqcHead.Status != IQCStatus.IQCStatus_New)
                        {
                            WebInfoPublish.Publish(this, "$ONLY_NewIQC_CAN_DELETE $IQCNo:" + iqcHead.IQCNo, this.languageComponent1);
                            this.RequestData();
                            return;
                        }

                        items.Add((IQCHead)iqcHead);
                    }
                }

                this._IQCFacade.DeleteIQCHeadAll((IQCHead[])items.ToArray(typeof(IQCHead)));

                this.gridHelper.GridBind(this.pagerToolBar.PageIndex, this.pagerToolBar.PageSize);
                this.RequestData();
                this.buttonHelper.PageActionStatusHandle(PageActionType.Delete);
            }
        }