Ejemplo n.º 1
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);
    }