Example #1
0
        protected override object GetEditObject()
        {
            this.ValidateInput();

            if (_facade == null)
            {
                _facade = new FacadeFactory(base.DataProvider).CreateReportFacade();
            }
            FactoryWeekCheck factoryWeekCheck = this._facade.CreateNewFactoryWeekCheck();

            if (this.txtCheckID.Text.Trim() != "" && this.txtCheckID.Text.Trim() != null)
            {
                factoryWeekCheck.CheckID = this.txtCheckID.Text.Trim();
                this.txtCheckID.Text     = "";
            }
            else
            {
                factoryWeekCheck.CheckID = System.Guid.NewGuid().ToString();
            }
            factoryWeekCheck.FactoryID = this.drpFactoryCodeEdit.SelectedValue;
            if (this.txtWeekNoEdit.Text.Substring(0, 2).ToUpper() == "WK")
            {
                factoryWeekCheck.WeekNo = "WK" + this.txtWeekNoEdit.Text.Substring(2);
            }
            else
            {
                factoryWeekCheck.WeekNo = "WK" + this.txtWeekNoEdit.Text;
            }
            factoryWeekCheck.Total = Convert.ToDecimal(this.txtTotalEdit.Text);
            factoryWeekCheck.LRR   = Convert.ToDecimal(this.txtLRREdit.Text);

            return(factoryWeekCheck);
        }
Example #2
0
 protected override void DeleteDomainObjects(ArrayList domainObjects)
 {
     if (_facade == null)
     {
         _facade = new FacadeFactory(base.DataProvider).CreateReportFacade();
     }
     this._facade.DeleteFactoryWeekCheck((FactoryWeekCheck[])domainObjects.ToArray(typeof(FactoryWeekCheck)));
 }
Example #3
0
 protected override void UpdateDomainObject(object domainObject)
 {
     if (_facade == null)
     {
         _facade = new FacadeFactory(base.DataProvider).CreateReportFacade();
     }
     this._facade.UpdateFactoryWeekCheck((FactoryWeekCheck)domainObject);
 }
Example #4
0
 protected override int GetRowCount()
 {
     if (_facade == null)
     {
         _facade = new FacadeFactory(base.DataProvider).CreateReportFacade();
     }
     return(this._facade.QueryFactoryWeekCheckCount(
                this.drpFactoryCodeQuery.SelectedIndex.ToString(),
                this.txtWeekNoQuery.Text.Trim()));
 }
Example #5
0
 protected override object[] LoadDataSource(int inclusive, int exclusive)
 {
     if (_facade == null)
     {
         _facade = new FacadeFactory(base.DataProvider).CreateReportFacade();
     }
     return(this._facade.QueryFactoryWeekCheck(
                this.drpFactoryCodeQuery.SelectedIndex.ToString(),
                this.txtWeekNoQuery.Text.Trim().ToUpper(),
                inclusive, exclusive));
 }
Example #6
0
        protected override object GetEditObject(Infragistics.WebUI.UltraWebGrid.UltraGridRow row)
        {
            if (_facade == null)
            {
                _facade = new FacadeFactory(base.DataProvider).CreateReportFacade();
            }
            object obj = _facade.GetFactoryWeekCheck(row.Cells[1].Text.ToString());

            this.txtCheckID.Text = row.Cells[1].Text.ToString();

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

            return(null);
        }
Example #7
0
        protected override bool ValidateInput()
        {
            PageCheckManager manager = new PageCheckManager();

            manager.Add(new LengthCheck(this.lblFactoryE, this.drpFactoryCodeEdit, 40, true));
            manager.Add(new LengthCheck(this.lblWeekNoEdit, this.txtWeekNoEdit, 40, true));
            manager.Add(new DecimalCheck(this.lblTotalEdit, this.txtTotalEdit, decimal.MinValue, decimal.MaxValue, false));
            manager.Add(new DecimalCheck(this.lblLRREdit, this.txtLRREdit, decimal.MinValue, decimal.MaxValue, false));

            if (!manager.Check())
            {
                WebInfoPublish.Publish(this, manager.CheckMessage, this.languageComponent1);
                return(false);
            }

            if (_facade == null)
            {
                _facade = new FacadeFactory(base.DataProvider).CreateReportFacade();
            }
            string factoryID = this.drpFactoryCodeEdit.SelectedValue;
            string weekNo    = "";

            if (this.txtWeekNoEdit.Text != "" && this.txtWeekNoEdit.Text.Substring(0, 2).ToUpper() == "WK")
            {
                weekNo = "WK" + this.txtWeekNoEdit.Text.Substring(2);
            }
            else
            {
                weekNo = "WK" + this.txtWeekNoEdit.Text;
            }
            int count = _facade.QueryFactoryWeekCheckCount(factoryID, weekNo);

            if (count != 0 && PageAction == PageActionType.Add)
            {
                WebInfoPublish.Publish(this, factoryID + " $Factory_WeekNo_Exist", this.languageComponent1);
            }

            return(true);
        }