Ejemplo n.º 1
0
    protected void btnSave_Click(object sender, EventArgs e)
    {
        string  childerItemCode = this.tbCode.Text.Trim();
        decimal Qty             = 0;

        try
        {
            Qty = Convert.ToDecimal(this.tbQty.Text.Trim());
        }
        catch (Exception)
        {
            ShowErrorMessage("Common.Validator.Valid.Number");
            return;
        }
        if (TheItemKitMgr.LoadItemKit(this.ParentItemCode, childerItemCode) == null)
        {
            ItemKit itemKit = new ItemKit();
            itemKit.ChildItem  = TheItemMgr.LoadItem(childerItemCode);
            itemKit.ParentItem = TheItemMgr.LoadItem(this.ParentItemCode);
            itemKit.IsActive   = this.cbIsActive.Checked;
            itemKit.Qty        = Qty;
            TheItemKitMgr.CreateItemKit(itemKit);
            ShowSuccessMessage("MasterData.Item.AddItem.Successfully", childerItemCode);
        }
        else
        {
            ShowErrorMessage("Common.Code.Exist", childerItemCode);
            return;
        }
        NewEvent(this, e);
    }
Ejemplo n.º 2
0
    protected void btnSave_Click(object sender, EventArgs e)
    {
        decimal Qty = 0;

        try
        {
            Qty = Convert.ToDecimal(this.tbQty.Text.Trim());
        }
        catch (Exception)
        {
            ShowErrorMessage("Common.Validator.Valid.Number");
            return;
        }
        if (TheItemKitMgr.LoadItemKit(this.ParentItemCode, this.ChildItemCode) != null)
        {
            ItemKit itemKit = new ItemKit();
            itemKit.ChildItem  = TheItemMgr.LoadItem(this.ChildItemCode);
            itemKit.ParentItem = TheItemMgr.LoadItem(this.ParentItemCode);
            itemKit.IsActive   = this.cbIsActive.Checked;
            itemKit.Qty        = Qty;
            TheItemKitMgr.UpdateItemKit(itemKit);
        }
        else
        {
            ShowErrorMessage("Common.Code.Exist", ChildItemCode);
        }
        EditEvent(this, e);
    }
Ejemplo n.º 3
0
    public void PageCleanup(string code)
    {
        ItemKit kit = TheItemKitMgr.LoadItemKit(this.ParentItemCode, code);

        this.ChildItemCode = code;
        this.tbCode.Text   = code;

        this.tbQty.Text         = kit.Qty.ToString("0.########");
        this.cbIsActive.Checked = kit.IsActive;
    }