Ejemplo n.º 1
0
    override protected Boolean LoadData()
    {
        try
        {
            // Load Data For Page.
            DALogTableAllow daLogTableAllow = new DALogTableAllow();
            daLogTableAllow.USP_LogTableAllow_GetFullID(this.KeyID);
            //
            fTableName.Value = daLogTableAllow.fTableName.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);
    }
Ejemplo n.º 2
0
 override protected int DeleteByID(int pID)
 {
     try
     {
         DALogTableAllow DALogTableAllow = new DALogTableAllow();
         DALogTableAllow.USP_LogTableAllow_Delete(pID);
         return(1);
     }
     catch { return(0); }
 }
Ejemplo n.º 3
0
    private DALogTableAllow CreateObjectFromPage()
    {
        // check
        DALogTableAllow daLogTableAllow = new DALogTableAllow();

        //
        daLogTableAllow.fTableName = fTableName.Value.Trim();

        //

        return(daLogTableAllow);
    }
Ejemplo n.º 4
0
 override protected Boolean CheckDuplicate()
 {
     if (this.KeyID == 0)
     {
         DALogTableAllow daLogTableAllow = new DALogTableAllow();
         if (daLogTableAllow.USP_LogTableAllow_CheckDuplicate(fTableName.Value) == 1)
         {
             ShowErrorMes("Bảng này đã tồn tại");
             return(false);
         }
     }
     return(true);
 }
Ejemplo n.º 5
0
    override protected int ExecUpdate()
    {
        // Update with ID = this.ID
        try
        {
            DALogTableAllow DALogTableAllow = CreateObjectFromPage();
            DALogTableAllow.fID = this.KeyID;

            DALogTableAllow.USP_LogTableAllow_Update();
            return(1);
        }
        catch { return(0); }
    }
Ejemplo n.º 6
0
    override protected Boolean GetDataComboBox()
    {
        try
        {
            DALogTableAllow daLogTableAllow = new DALogTableAllow();
            fTableName.DataSource = daLogTableAllow.USP_LogTableAllow_GetDataForComboBox();
            fTableName.DataBind();

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

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

            DALogTableAllow.USP_LogTableAllow_Insert();
            return(1);
        }
        catch { return(0); }
    }