override protected Boolean LoadData()
    {
        try
        {
            // Load Data For Page.
            DAProductOptionGroup daProductOptionGroup = new DAProductOptionGroup();
            daProductOptionGroup.USP_ProductOptionGroup_GetFullID(this.KeyID);
            //
            fProductOptionGroup.Value = daProductOptionGroup.fProductOptionGroup.ToString();
            fDescription.Value        = daProductOptionGroup.fDescription.ToString();
            fRecordTypeID.Value       = daProductOptionGroup.fRecordTypeID.ToString();

            //

            // Khi cần enabled cột nào
            //if (this.KeyID > 0)
            //{
            //    if (mode != Act.Clone)
            //        fUserName.Enabled = false;
            //    else
            //        fUserName.Text = "";
            //}
        }
        catch (Exception e)
        {
            ShowErrorMes("Lỗi hệ thống: " + e.ToString());
            return(false);
        }

        return(true);
    }
 override protected int DeleteByID(int pID)
 {
     try
     {
         DAProductOptionGroup DAProductOptionGroup = new DAProductOptionGroup();
         DAProductOptionGroup.USP_ProductOptionGroup_Delete(pID);
         return(1);
     }
     catch { return(0); }
 }
    override protected int ExecUpdate()
    {
        // Update with ID = this.ID
        try
        {
            DAProductOptionGroup DAProductOptionGroup = CreateObjectFromPage();
            DAProductOptionGroup.fID = this.KeyID;

            DAProductOptionGroup.USP_ProductOptionGroup_Update();
            return(1);
        }
        catch { return(0); }
    }
    private DAProductOptionGroup CreateObjectFromPage()
    {
        // check
        DAProductOptionGroup daProductOptionGroup = new DAProductOptionGroup();

        //
        daProductOptionGroup.fProductOptionGroup = fProductOptionGroup.Value.Trim();
        daProductOptionGroup.fDescription        = fDescription.Value.Trim();
        daProductOptionGroup.fRecordTypeID       = Convert.ToInt32(fRecordTypeID.Value.Trim());

        //

        return(daProductOptionGroup);
    }
    override protected Boolean GetDataComboBox()
    {
        try
        {
            DAProductOptionGroup daProductOptionGroup = new DAProductOptionGroup();
            fProductOptionGroupID.DataSource = daProductOptionGroup.USP_ProductOptionGroup_GetDataForComboBox();
            fProductOptionGroupID.DataBind();

            return(true);
        }
        catch (Exception ex)
        {
            ShowErrorMes("Lỗi hệ thống: " + ex.Message);
            return(false);
        }
    }
    override protected int ExecInsert()
    {
        try
        {
            DAProductOptionGroup DAProductOptionGroup = CreateObjectFromPage();

            if (this.mode == ActParam.New)
            {
                DAProductOptionGroup.fID = DAProductOptionGroup.USP_GetKey();
                this.KeyID = DAProductOptionGroup.fID; // --> Update new SessionID for continue edit.
            }
            else
            {
                DAProductOptionGroup.fID = 0;
            }

            DAProductOptionGroup.USP_ProductOptionGroup_Insert();
            return(1);
        }
        catch { return(0); }
    }