Exemplo n.º 1
0
    protected void btnCreate_Click(object sender, EventArgs e)
    {
        try
        {
            string shelfCode = this.tbShelfCode.Text.Trim();
            string itemCode  = this.tbItem.Text.Trim();

            if (!this.rfvItem.IsValid)
            {
                return;
            }
            ShelfItem shelfItem = new ShelfItem();
            if (shelfItem != null)
            {
                shelfItem.Shelf = TheShelfMgr.LoadShelf(shelfCode);
                shelfItem.Item  = TheItemMgr.LoadItem(itemCode);
            }

            TheShelfItemMgr.CreateShelfItem(shelfItem);
            ShowSuccessMessage("Mes.ShelfItem.Insert.Successfully");
            if (CreateEvent != null)
            {
                CreateEvent(sender, e);
            }
        }
        catch (BusinessErrorException ex)
        {
            ShowErrorMessage(ex);
        }
    }
Exemplo n.º 2
0
 protected void FV_Shelf_DataBound(object sender, EventArgs e)
 {
     if (this.Code != null && this.Code != string.Empty)
     {
         Shelf shelf = TheShelfMgr.LoadShelf(this.Code);
         this.UpdateView(shelf);
     }
 }
Exemplo n.º 3
0
    protected void CV_ServerValidate(object source, ServerValidateEventArgs args)
    {
        TextBox tbCode = (TextBox)this.FV_Shelf.FindControl("tbCode");
        Shelf   shelf  = TheShelfMgr.LoadShelf(tbCode.Text.Trim());

        if (shelf != null)
        {
            args.IsValid = false;
        }
    }
Exemplo n.º 4
0
    protected void ODS_Shelf_Updating(object sender, ObjectDataSourceMethodEventArgs e)
    {
        Shelf            oldShelef     = TheShelfMgr.LoadShelf(this.Code);
        Shelf            shelf         = (Shelf)e.InputParameters[0];
        Controls_TextBox tbProductLine = (Controls_TextBox)this.FV_Shelf.FindControl("tbProductLine");

        shelf.ProductLine      = TheFlowMgr.LoadFlow(tbProductLine.Text.Trim());
        shelf.Capacity         = oldShelef.Capacity;
        shelf.CurrentCartons   = oldShelef.CurrentCartons;
        shelf.OriginalCartonNo = oldShelef.OriginalCartonNo;
        shelf.Code             = oldShelef.Code;
    }
Exemplo n.º 5
0
    protected void ODS_ShelfItem_Updating(object sender, ObjectDataSourceMethodEventArgs e)
    {
        string shelfCode = ((TextBox)(this.FV_ShelfItem.FindControl("tbShelf"))).Text.Trim();
        string itemCode  = ((TextBox)(this.FV_ShelfItem.FindControl("tbItem"))).Text.Trim();


        ShelfItem shelfItem = (ShelfItem)e.InputParameters[0];

        if (shelfItem != null)
        {
            shelfItem.Shelf = TheShelfMgr.LoadShelf(shelfCode);
            shelfItem.Item  = TheItemMgr.LoadItem(itemCode);
        }
    }
Exemplo n.º 6
0
    protected void lbtnDelete_Click(object sender, EventArgs e)
    {
        string code = ((LinkButton)sender).CommandArgument;

        try
        {
            TheShelfMgr.DeleteShelf(code);
            ShowSuccessMessage("Mes.Shelf.Delete.Successfully", code);
            UpdateView();
        }
        catch (Castle.Facilities.NHibernateIntegration.DataException ex)
        {
            ShowErrorMessage("Mes.Shelf.Delete.Failed", code);
        }
    }