Exemplo n.º 1
0
 public String SitePermission(String CLIENTID, String USERID, String SITEID)
 {
     if (Session["Login"] != null)
     {
         SitePermissionclass permission = new SitePermissionclass();
         LoginSession loginsession = (LoginSession)Session["Login"];
         permission.CreateBy = Convert.ToInt64(loginsession.UserID);
         if ((CLIENTID != null) && (USERID != null) && (SITEID!= null))
         {
             permission.ClientID = CLIENTID;
             permission.SiteID = SITEID;
             permission.UserID = USERID;
             if (BAL.RegistrationModels.CreateSitePermission(permission))
             {
                 return "true";
             }
             else
             {
                 return "false";
             }
         }
         else
         { return "false"; }
     }
     else
     {
         RedirectToAction("Index", "Home");
         return "false";
     }
 }
Exemplo n.º 2
0
        // create sitePermission
        public static Boolean CreateSitePermission(SitePermissionclass permissionobj)
        {
            Boolean flag = false;
            SitePermissionclass permission = (SitePermissionclass)permissionobj;
            try
            {
                SitePermission _permission = new SitePermission();

                if (permission.ClientID != null)
                {
                    _permission.ClientID = Convert.ToInt64(permission.ClientID);
                }
                if (permission.SiteID != null)
                {
                    _permission.SiteID = Convert.ToInt64(permission.SiteID);
                }
                if (permission.UserID != null)
                {
                    _permission.UserID = Convert.ToInt64(permission.UserID);
                }
                _permission.CreateDate = DateTime.Now;
                _permission.CreateBy = permission.CreateBy;
                if ((_permission.UserID != null)&&(_permission.SiteID != null)&&(_permission.ClientID != null))
                {
                    flag = DAL.DALUserReg.CreateSitePermission(_permission);
                }
            }
            catch (Exception ex)
            {
                throw;
            }
            return flag;
        }