Ejemplo n.º 1
0
        private object GetEditObject()
        {
            if (this.ValidateInput())
            {
                if (_shelfFacade == null)
                {
                    _shelfFacade = new FacadeFactory(base.DataProvider).CreateShelfFacade();
                }

                Shelf shelf = this._shelfFacade.CreateNewShelf();

                shelf.ShelfNO = FormatHelper.PKCapitalFormat(FormatHelper.CleanString(this.txtShelfNOEdit.Text, 6));

                shelf.Status = ShelfStatus.BurnOut;

                shelf.Memo = FormatHelper.CleanString(this.txtMemoEdit.Text, 100);

                shelf.MaintainUser = this.GetUserCode();

                return(shelf);
            }
            else
            {
                return(null);
            }
        }
Ejemplo n.º 2
0
 private int GetRowCount()
 {
     if (_shelfFacade == null)
     {
         _shelfFacade = new FacadeFactory(base.DataProvider).CreateShelfFacade();
     }
     return(this._shelfFacade.QueryShelfCount(FormatHelper.PKCapitalFormat(FormatHelper.CleanString(this.txtShelfNOQuery.Text))));
 }
Ejemplo n.º 3
0
 private object[] LoadDataSource(int inclusive, int exclusive)
 {
     if (_shelfFacade == null)
     {
         _shelfFacade = new FacadeFactory(base.DataProvider).CreateShelfFacade();
     }
     return(this._shelfFacade.QueryShelf(
                FormatHelper.PKCapitalFormat(FormatHelper.CleanString(this.txtShelfNOQuery.Text)), inclusive, exclusive));
 }
Ejemplo n.º 4
0
        private object GetEditObject(Infragistics.WebUI.UltraWebGrid.UltraGridRow row)
        {
            if (_shelfFacade == null)
            {
                _shelfFacade = new FacadeFactory(base.DataProvider).CreateShelfFacade();
            }
            object obj = this._shelfFacade.GetShelf(row.Cells.FromKey("ShelfNO").Text.ToString());

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

            return(null);
        }
Ejemplo n.º 5
0
        private void SetEditObject(object obj)
        {
            if (_shelfFacade == null)
            {
                _shelfFacade = new FacadeFactory(base.DataProvider).CreateShelfFacade();
            }
            if (obj == null)
            {
                this.txtShelfNOEdit.Text = String.Empty;
                this.txtMemoEdit.Text    = String.Empty;
                return;
            }

            this.txtShelfNOEdit.Text = (obj as Shelf).ShelfNO;
            this.txtMemoEdit.Text    = (obj as Shelf).Memo;
        }
Ejemplo n.º 6
0
        protected void cmdSave_ServerClick(object sender, System.EventArgs e)
        {
            if (_shelfFacade == null)
            {
                _shelfFacade = new FacadeFactory(base.DataProvider).CreateShelfFacade();
            }
            object shelf = this.GetEditObject();

            if (shelf != null)
            {
                this._shelfFacade.UpdateShelfMemo(shelf as Shelf);
                this.gridHelper.GridBind(this.pagerToolBar.PageIndex, this.pagerToolBar.PageSize);
                this.RequestData();
                this.buttonHelper.PageActionStatusHandle(PageActionType.Save);
            }
        }
Ejemplo n.º 7
0
        protected void cmdDelete_ServerClick(object sender, System.EventArgs e)
        {
            ArrayList array = this.gridHelper.GetCheckedRows();

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

                foreach (UltraGridRow row in array)
                {
                    object shelf = this.GetEditObject(row);
                    if (shelf != null)
                    {
                        shelfs.Add((Shelf)shelf);
                    }
                }

                if (_shelfFacade == null)
                {
                    _shelfFacade = new FacadeFactory(base.DataProvider).CreateShelfFacade();
                }
                int iUsed = 0;
                foreach (Shelf sh in shelfs)
                {
                    iUsed += this._shelfFacade.ShelfIsUsed(sh.ShelfNO);
                }

                if (iUsed == 0)
                {
                    this._shelfFacade.DeleteShelf((Shelf[])shelfs.ToArray(typeof(Shelf)));

                    this.gridHelper.GridBind(this.pagerToolBar.PageIndex, this.pagerToolBar.PageSize);
                    this.RequestData();
                    this.buttonHelper.PageActionStatusHandle(PageActionType.Delete);
                }
                else
                {
                    WebInfoPublish.Publish(this, "$CS_SHELF_IS_USED", languageComponent1);
                }
            }
        }