Exemple #1
0
 public decimal UserFunctionInsert(UserFunction_Info pInfo)
 {
     try
     {
         return(CommonData.c_serviceWCF.UserFunctionInsert(pInfo.User_Id, pInfo.Func_Id, pInfo.lstFunction, pInfo.Group_Id, pInfo.Created_By));
     }
     catch (Exception ex)
     {
         NaviCommon.Common.log.Error(ex.ToString());
         return(-3);
     }
 }
Exemple #2
0
        public ActionResult AddFunctionGroupsUser(string pStrFunction, int pIdGroups, int pIdUser)
        {
            try
            {
                ViewBag.tabFocus = 2;
                string          FunctionInUser = "******" + pIdGroups.ToString() + pIdUser.ToString();
                string          FuncInGroup    = "FuncInGroup" + pIdGroups.ToString() + pIdUser.ToString();
                GroupFunctionBL _funcg         = new GroupFunctionBL();
                UserFunctionBL  _userfunc      = new UserFunctionBL();
                decimal         preturn        = 0;
                if (pStrFunction != null)
                {
                    // xoa di r insert tung thang vao
                    if (_userfunc.Delete_UserFunction_ByUser(pIdUser))
                    {
                        string[] _arr_func = pStrFunction.Split(',');
                        foreach (string item in _arr_func)
                        {
                            UserFunction_Info pinfo = new UserFunction_Info();

                            pinfo.lstFunction = pStrFunction.Trim(',');
                            pinfo.User_Id     = pIdUser;
                            pinfo.Group_Id    = pIdGroups;
                            pinfo.Created_By  = SessionData.CurrentUser.User_Name;
                            preturn           = _userfunc.UserFunctionInsert(pinfo);
                        }
                    }
                }

                if (preturn > 0)
                {
                    //danh sachs chuc nang thuoc nhom dc phan quen cho user
                    Session[FunctionInUser] = _userfunc.UserFunctionGetAll(pIdUser, pIdGroups);

                    //danh sach chuc nang thuoc nhom
                    Session[FuncInGroup] = _funcg.FunctionInGroupsGetAllToList(pIdGroups);
                }
                ViewBag.IDGroup = pIdGroups;
                return(Json(new { success = true, status = preturn }));
            }
            catch (Exception ex)
            {
                NaviCommon.Common.log.Error(ex.ToString());
                return(Json(new { success = false, status = -3 }));
            }
        }