Exemplo n.º 1
0
 protected void lbtnUpdate_Click(object sender, EventArgs e)
 {
     if (this.objCheckPermision.Permission(this.objCheckPermision.LayQuyen("strgTinhNangChucNang_Sua")))
     {
         try
         {
             string function_ID;
             foreach (ListViewItem lvit in this.lv_ThongTinSP.Items)
             {
                 if (((HiddenField)lvit.FindControl("hfFunction_ID")).Value != "")
                 {
                     function_ID = ((HiddenField)lvit.FindControl("hfFunction_ID")).Value;
                 }
                 else
                 {
                     this.ltr_Notice.Text = this.objComm.ShowNotice(
                         false, "Cập nhật thông tin thất bại.\nLỗi trong quá trình nhận dạng nhóm chức năng");
                     return;
                 }
                 TBT_AdminFunction ctit = MemberGroupDAO.LayTinhNangChucNangById(Int32.Parse(function_ID));
                 ctit.FunctionCode = ((TextBox)lvit.FindControl("txt_FunctionCode")).Text;
                 ctit.FunctionDesc = ((TextBox)lvit.FindControl("txt_FunctionDesc")).Text;
                 this.DongBoReSource(ctit.FunctionDesc, ctit.FunctionCode);
                 MemberGroupDAO.Update();
             }
             this.ltr_Notice.Text = this.objComm.ShowNotice(true, "Cập nhật thông tin thành công!");
         }
         catch
         {
             if (!this.Page.ClientScript.IsStartupScriptRegistered("popup"))
             {
                 this.Page.ClientScript.RegisterStartupScript(
                     this.GetType(),
                     "popup",
                     "popup('Cập nhật thất bại! Bạn hãy tải lại trang để thử lại cập nhật.');",
                     true);
             }
         }
     }
     else
     {
         this.objComm.wr(
             "<script language='javascript'>alert('Bạn không có quyền thực hiện chức năng này.');location.href='/AppAdmin/Article/Index.aspx';</script>");
     }
 }
Exemplo n.º 2
0
 protected void lv_ThongTinSP_ItemInserting(object sender, ListViewInsertEventArgs e)
 {
     if (this.objCheckPermision.Permission(this.objCheckPermision.LayQuyen("strTinhNangChucNang_Them")))
     {
         int functionName_ID = 0;
         var txt1            = (e.Item.FindControl("ddl_FunctionName")) as DropDownList;
         if (txt1 != null)
         {
             functionName_ID = Int32.Parse(txt1.SelectedValue);
         }
         if (!MemberGroupDAO.KiemTraTonTaiTinhNangChucNang(functionName_ID, function_Group_ID))
         {
             var it  = new TBT_AdminFunction();
             var txt = (e.Item.FindControl("txt_FunctionCode")) as TextBox;
             if (txt != null)
             {
                 it.FunctionCode = txt.Text;
             }
             it.FunctionName_ID = functionName_ID;
             txt = (e.Item.FindControl("txt_FunctionGroupDesc")) as TextBox;
             if (txt != null)
             {
                 it.FunctionDesc = txt.Text;
             }
             it.Function_Group_ID = function_Group_ID;
             MemberGroupDAO.ThemTinhNangChucNang(it);
             this.lv_ThongTinSP.EditIndex = -1;
             this.BinList();
         }
         else
         {
             this.Page.ClientScript.RegisterStartupScript(
                 this.GetType(), "popup", "popup('Tính năng chức năng này đã tồn tại!.');", true);
         }
     }
     else
     {
         this.iRightAccess.Visible = false;
         this.objControl.LoadMyControl(this.idNotPermissionAccess, NotPermissControl);
     }
 }
Exemplo n.º 3
0
 public static void ThemTinhNangChucNang(TBT_AdminFunction obj)
 {
     BNBDataContext.Instance.TBT_AdminFunctions.InsertOnSubmit(obj);
     BNBDataContext.Instance.SubmitChanges();
 }