Example #1
0
 private void SetActived(int CategoryID, bool IsActived)
 {
     Libs.Data data = new Libs.Data(Global.ConnectionSql);
     try
     {
         Category objcategory = new Category();
         objcategory.DataObject = data;
         objcategory.CategoryID = CategoryID;
         objcategory.IsActived  = IsActived;
         if (objcategory.SetActived()) //no error
         {
             this.BindingCategory();
         }
         else
         {
             return;
         }
     }
     catch (Exception ex)
     {
         Global.WriteLogError("SetActived() " + ex);
     }
     finally
     {
         data.DeConnect();
     }
 }
Example #2
0
 private void SetActived(int NewsID, bool IsActived)
 {
     try
     {
         Libs.Data data = new Libs.Data(Global.ConnectionSql);
         Products  obj  = new Products();
         obj.DataObject = data;
         obj.NewsID     = NewsID;
         obj.IsActived  = IsActived;
         if (obj.SetActived()) //no error
         {
             this.BindingData();
             ScriptManager.RegisterStartupScript(this.Page, this.GetType(), "sucess", "messagesucess();", true);
         }
         else
         {
             lblmessage.Text = "Sửa dữ liệu không thành công";
             mdPopup.Show();
         }
     }
     catch (Exception ex)
     {
         Global.WriteLogError("SetActived() " + ex);
         lblmessage.Text = "Lỗi xảy ra trong quá trình lưu dữ liệu. Liên hệ với người quản trị để khắc phục";
         mdPopup.Show();
     }
 }
Example #3
0
 private void SetActived(int NewsID, bool IsActived)
 {
     Libs.Data data = new Libs.Data(Global.ConnectionSql);
     try
     {
         Products obj = new Products();
         obj.DataObject = data;
         obj.NewsID     = NewsID;
         obj.IsActived  = IsActived;
         if (obj.SetActived()) //no error
         {
             this.BindingData();
         }
         else
         {
             Global.WriteLogError("SetActived() " + "error");
         }
     }
     catch (Exception ex)
     {
         Global.WriteLogError("SetActived() " + ex);
     }
     finally
     {
         data.DeConnect();
     }
 }
Example #4
0
 private void Getsubmenu(Repeater rpt, int parentid)
 {
     Libs.Data objdata = new Libs.Data(Global.ConnectionSql);
     try
     {
         Category objsubjectItem = new Category();
         objsubjectItem.DataObject = objdata;
         CategoryCollection col = objsubjectItem.Getlist(parentid);
         if (col == null)
         {
             return;
         }
         rpt.DataSource = col;
         rpt.DataBind();
     }
     catch (Exception ex)
     {
         Global.WriteLogError("Getsubmenu()" + ex);
     }
     finally
     {
         objdata.DeConnect();
     }
 }
Example #5
0
    //private TypesCollection LoadDataType(string stextsearch)
    //{
    //    Data objdata = new Data(Global.ConnectionSql);
    //    TypesCollection col = null;
    //    try
    //    {
    //        Types obj = new Types();
    //        obj.DataObject = objdata;
    //        col = obj.Getlist(stextsearch);
    //    }
    //    catch (Exception ex)
    //    {
    //        Global.WriteLogError("LoadDataType()" + ex);
    //    }
    //    finally {
    //        objdata.DeConnect();
    //    }
    //    return col;
    //}

    //private void BindingDataType()
    //{
    //    try
    //    {
    //        TypesCollection col = null;
    //        col = this.LoadDataType(string.Empty);
    //        if (col == null)
    //        {
    //            col = new TypesCollection();
    //            // lblCount.Text = "Có 0" + " record";
    //            rptDataTypes.DataSource = col;
    //            rptDataTypes.DataBind();
    //        }
    //        else
    //        {
    //            rptDataTypes.DataSource = col;
    //            rptDataTypes.DataBind();
    //        }

    //    }
    //    catch (Exception ex)
    //    {
    //        Global.WriteLogError("BindingData()" + ex);
    //    }
    //}

    private void LoadParent()
    {
        Libs.Data objdata = new Libs.Data(Global.ConnectionSql);
        try
        {
            Category objsubject = new Category();
            objsubject.DataObject = objdata;
            CategoryCollection colparent = objsubject.GetlistParent();
            if (colparent == null)
            {
                return;
            }
            rptParent.DataSource = colparent;
            rptParent.DataBind();
        }
        catch (Exception ex)
        {
            Global.WriteLogError("LoadParent() " + ex);
        }
        finally
        {
            objdata.DeConnect();
        }
    }