예제 #1
0
    override protected Boolean LoadData()
    {
        try
        {
            // Load Data For Page.
            DARecordType daRecordType = new DARecordType();
            daRecordType.USP_RecordType_GetFullID(this.KeyID);
            //
            fRecordType.Value  = daRecordType.fRecordType.ToString();
            fTableName.Value   = daRecordType.fTableName.ToString();
            fDescription.Value = daRecordType.fDescription.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);
    }
예제 #2
0
 override protected int DeleteByID(int pID)
 {
     try
     {
         DARecordType DARecordType = new DARecordType();
         DARecordType.USP_RecordType_Delete(pID);
         return(1);
     }
     catch { return(0); }
 }
예제 #3
0
    override protected int ExecUpdate()
    {
        // Update with ID = this.ID
        try
        {
            DARecordType DARecordType = CreateObjectFromPage();
            DARecordType.fID = this.KeyID;

            DARecordType.USP_RecordType_Update();
            return(1);
        }
        catch { return(0); }
    }
예제 #4
0
    private DARecordType CreateObjectFromPage()
    {
        // check
        DARecordType daRecordType = new DARecordType();

        //
        daRecordType.fRecordType  = fRecordType.Value.Trim();
        daRecordType.fTableName   = fTableName.Value.Trim();
        daRecordType.fDescription = fDescription.Value.Trim();

        //

        return(daRecordType);
    }
    override protected Boolean GetDataComboBox()
    {
        try
        {
            DARecordType daRecordType = new DARecordType();
            fRecordTypeID.DataSource = daRecordType.USP_RecordType_GetComboBox_ByTableName("ProductOptionGroup");
            fRecordTypeID.DataBind();

            return(true);
        }
        catch (Exception ex)
        {
            ShowErrorMes("Lỗi hệ thống: " + ex.Message);
            return(false);
        }
    }
예제 #6
0
    override protected Boolean GetDataComboBox()
    {
        try
        {
            DARecordType daDiscountType = new DARecordType();
            fDiscountTypeID.DataSource = daDiscountType.USP_RecordType_GetComboBox_ByTableName("Discount");
            fDiscountTypeID.DataBind();

            //DARecordType daCouponType = new DARecordType();
            //fCouponTypeID.DataSource = daDiscountType.USP_RecordType_GetComboBox_ByTableName("Coupon");
            //fCouponTypeID.DataBind();

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

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

            DARecordType.USP_RecordType_Insert();
            return(1);
        }
        catch { return(0); }
    }