public ActionResult PostCreateEditRole(role role)
 {
     try
     {
         result = new Result();
         if (role.role_id > 0)
         {
             role find = db.roles.Find(role.role_id);
             find.is_active       = role.is_active;
             find.role_name       = role.role_name;
             db.Entry(find).State = System.Data.Entity.EntityState.Modified;
             result.Message       = string.Format(BaseConst.MSG_SUCCESS_UPDATE, "Role");
         }
         else
         {
             long prevRoleBit = db.roles.Where(x => x.company_id == role.company_id).Max(x => x.role_bit);
             role.role_bit   = prevRoleBit * 2;
             role.company_id = role.company_id;
             db.roles.Add(role);
             result.Message = string.Format(BaseConst.MSG_SUCCESS_CREATE, "Role");
         }
         STUtil.SetSessionValue(UserInfo.IsCompanyAddUpdate.ToString(), "0");
         db.SaveChanges();
         STUtil.SetSessionValue(UserInfo.IsCompanyAddUpdate.ToString(), "1");
     }
     catch (Exception ex)
     {
         result.Message = ex.Message;
     }
     return(Json(result));
 }
Esempio n. 2
0
        public ActionResult StateIndex(string id)
        {
            state s = new state();

            STUtil.SetSessionValue(UserInfo.pageTitle.ToString(), "State");
            ViewBag.country_id = new SelectList(countryUtil.GetCountrySelectList(), "Value", "Text");
            return(View(s));
        }
Esempio n. 3
0
        protected override void OnActionExecuting(ActionExecutingContext filterContext)
        {
            //filterContext.ActionDescriptor.ActionName.ToUpper().Equals("INDEX") &&

            String ControllerName = filterContext.ActionDescriptor.ControllerDescriptor.ControllerName.ToUpper();
            String ActionName     = filterContext.ActionDescriptor.ActionName.ToUpper();



            List <TreeNode> AllList = Session[UserInfo.MenuList.ToString()] as List <TreeNode>;

            if (AllList != null)
            {
                var    menuData  = AllList.AsEnumerable().Where(x => (x.ControllerName ?? "").Trim().ToUpper() == ControllerName && (x.ActionName ?? "").Trim().ToUpper() == ActionName).FirstOrDefault();
                string sludge    = menuData == null ? "" : menuData.Sludge;
                string pageTitle = menuData == null ? "" : menuData.PageTitle;
                if (menuData != null)
                {
                    STUtil.SetSessionValue(UserInfo.sludge.ToString(), sludge);
                    STUtil.SetSessionValue(UserInfo.pageTitle.ToString(), pageTitle);
                }
            }

            if (STUtil.ListControllerExcluded().Contains(ControllerName))
            {
                if (ControllerName == "ACCOUNT" && ActionName == "LOGIN" && STUtil.IsAuthenticated())
                {
                    filterContext.Result = new RedirectResult("/DashBoard/Index/");
                }

                return;
            }
            else
            {
                if (STUtil.GetSessionValue(UserInfo.UserID.ToString()) == "")
                {
                    filterContext.Result = null;
                    filterContext.Result = new RedirectResult("/Account/Login/");
                    return;
                }
                if (!STUtil.CheckAuthentication(filterContext))
                {
                    filterContext.Result = null;
                    filterContext.Result = new RedirectResult("/Home/AccessDenied/");
                    return;
                }

                //if (STUtil.IsAuthenticated() && STUtil.GetSessionValue(UserInfo.IsCompanySetup.ToString()) == "0" && ActionName != "COMPANYINDEX" && ActionName != "COMPANYCREATEEDIT")
                if (STUtil.IsAuthenticated() && STUtil.GetSessionValue(UserInfo.IsCompanySetup.ToString()) == "0" && ActionName != "COMPANYACCOUNT")
                {
                    filterContext.Result = null;
                    filterContext.Result = new RedirectResult("/Settings/CompanyAccount/");
                    return;
                }
                return;
            }
        }
        public ActionResult getinvoice(int id)
        {
            ViewBag.Title = "Invoice";
            STUtil.SetSessionValue(UserInfo.pageTitle.ToString(), "Invoice");
            var li = db.package_subscription.Where(x => x.package_subscription_id == id).FirstOrDefault();

            ViewBag.admincompany = db.companies.AsEnumerable().Where(x => x.company_id == Convert.ToInt32(SessionUtil.GetCompanyID())).FirstOrDefault();
            return(View(li));
        }
Esempio n. 5
0
        public ActionResult PackageIndex()
        {
            STUtil.SetSessionValue(UserInfo.pageTitle.ToString(), "Package");
            package package = new package();

            ViewBag.duration_days_id = durationDaysUtil.GetDurationDaysSelectList();
            ViewBag.package_id       = packageUtil.GetPackage();
            ViewBag.Currency         = currencyUtil.GetCurrencyListForDropdown();
            return(View(package));
        }
        // GET: /CompanySetting/
        public ActionResult EditCompany(string id = "")
        {
            STUtil.SetSessionValue(UserInfo.pageTitle.ToString(), "Company Setting");
            int     company_id = (Int32)SessionUtil.GetCompanyID();
            company company    = db.companies.Find(company_id);

            ViewBag.Title = "Company Edit";
            ViewBag.id    = company != null ? company.company_id : 0;
            return(View());
        }
Esempio n. 7
0
        public ActionResult JobType(string id)
        {
            STUtil.SetSessionValue(UserInfo.pageTitle.ToString(), "Job Type");
            job_type c = new job_type();

            if (id != null && id != "")
            {
                c = db.job_type.Find(Convert.ToInt32(id));
            }
            return(View(c));
        }
Esempio n. 8
0
        public ActionResult CityIndex(string id)
        {
            city s = new city();

            STUtil.SetSessionValue(UserInfo.pageTitle.ToString(), "City");
            IList <SelectListItem> list = new List <SelectListItem>();

            ViewBag.country_id = new SelectList(countryUtil.GetCountrySelectList(), "Value", "Text");
            ViewBag.state_id   = list;
            return(View(s));
        }
Esempio n. 9
0
        public ActionResult PaymentStatus(string id)
        {
            STUtil.SetSessionValue(UserInfo.pageTitle.ToString(), "Payment Status");
            payment_status c = new payment_status();

            if (id != null && id != "")
            {
                c = db.payment_status.Find(Convert.ToInt32(id));
            }
            return(View(c));
        }
Esempio n. 10
0
        public ActionResult IndustryTypeIndex(string id)
        {
            STUtil.SetSessionValue(UserInfo.pageTitle.ToString(), "Industry Type");
            industry_type c = new industry_type();

            if (id != null && id != "")
            {
                c = db.industry_type.Find(Convert.ToInt32(id));
            }

            return(View(c));
        }
Esempio n. 11
0
        public ActionResult CountryIndex(string id)
        {
            STUtil.SetSessionValue(UserInfo.pageTitle.ToString(), "Country");
            country c = new country();

            if (id != null && id != "")
            {
                c = db.countries.Find(Convert.ToInt32(id));
            }

            return(View(c));
        }
Esempio n. 12
0
        public ActionResult NationalityIndex(string id)
        {
            STUtil.SetSessionValue(UserInfo.pageTitle.ToString(), "Nationality");
            nationality c = new nationality();

            if (id != null && id != "")
            {
                c = db.nationalities.Find(Convert.ToInt32(id));
            }

            return(View(c));
        }
Esempio n. 13
0
        public ActionResult ReligionIndex(string id)
        {
            STUtil.SetSessionValue(UserInfo.pageTitle.ToString(), "Religion");
            religion c = new religion();

            if (id != null && id != "")
            {
                c = db.religions.Find(Convert.ToInt32(id));
            }

            return(View(c));
        }
Esempio n. 14
0
        public ActionResult LanguageIndex(string id)
        {
            STUtil.SetSessionValue(UserInfo.pageTitle.ToString(), "Language");
            language c = new language();

            if (id != null && id != "")
            {
                c = db.languages.Find(Convert.ToInt32(id));
            }

            return(View(c));
        }
Esempio n. 15
0
        public ActionResult TimeFormatIndex(string id)
        {
            STUtil.SetSessionValue(UserInfo.pageTitle.ToString(), "Time Format");
            time_format c = new time_format();

            if (id != null && id != "")
            {
                c = db.time_format.Find(Convert.ToInt32(id));
            }

            return(View(c));
        }
Esempio n. 16
0
        public ActionResult PaymentModeIndex(string id)
        {
            STUtil.SetSessionValue(UserInfo.pageTitle.ToString(), "Payment Mode");
            payment_mode c = new payment_mode();

            if (id != null && id != "")
            {
                c = db.payment_mode.Find(Convert.ToInt32(id));
            }

            return(View(c));
        }
Esempio n. 17
0
        public ActionResult DurationDaysIndex(string id)
        {
            STUtil.SetSessionValue(UserInfo.pageTitle.ToString(), "Duration Days");
            duration_days c = new duration_days();

            if (id != null && id != "")
            {
                c = db.duration_days.Find(Convert.ToInt32(id));
            }

            return(View(c));
        }
Esempio n. 18
0
        public ActionResult SubareaIndex(string id)
        {
            sub_area s = new sub_area();

            STUtil.SetSessionValue(UserInfo.pageTitle.ToString(), "SubArea");
            IList <SelectListItem> list = new List <SelectListItem>();

            ViewBag.country_id = new SelectList(countryUtil.GetCountrySelectList(), "Value", "Text");
            ViewBag.state_id   = list;
            ViewBag.city_id    = list;
            ViewBag.area_id    = list;
            return(View(s));
        }
Esempio n. 19
0
        public ActionResult CreateEdit(company company, HttpPostedFileBase company_logo, FormCollection frmUser)
        {
            try
            {
                string  AWSProfileName     = STUtil.GetWebConfigValue("AWSProfileName");
                string  SystemImagePath    = STUtil.GetWebConfigValue("SystemImagePath");
                company CompanyInformation = db.companies.Find(company.company_id);
                if (company_logo != null)
                {
                    string GenFileName       = STUtil.GetTodayDate().ToString("yyyyMMdd") + "_" + CompanyInformation.company_id.ToString() + "_" + Path.GetFileName(company_logo.FileName).Replace(" ", "_");
                    String companyFolderName = CompanyInformation.company_folder_name.ToString().Replace("/", "");
                    //// AWSUtil.UploadFile(company_logo.InputStream, AWSProfileName, companyFolderName, GenFileName);
                    CompanyInformation.company_logo = GenFileName;
                    UploadFile(companyFolderName, company_logo);
                }
                CompanyInformation.business_name = company.business_name;
                CompanyInformation.licence_no    = company.licence_no;
                //CompanyInformation.application_type_id = company.application_type_id;
                CompanyInformation.time_zone    = company.time_zone;
                CompanyInformation.country_code = company.country_code;
                CompanyInformation.phone        = company.phone;
                CompanyInformation.state_id     = company.state_id;
                CompanyInformation.city         = company.city;
                CompanyInformation.address      = company.address;
                CompanyInformation.zip          = company.zip;
                CompanyInformation.is_active    = company.is_active;

                db.Entry(CompanyInformation).State = System.Data.Entity.EntityState.Modified;
                result.Message = string.Format(BaseConst.MSG_SUCCESS_UPDATE, "Company");
                STUtil.SetSessionValue(UserInfo.IsCompanyAddUpdate.ToString(), "0");
                db.SaveChanges();

                #region FolderCreation
                string ImagePath = STUtil.GetWebConfigValue("ImagePath");
                //AWSUtil.FolderCreation(AWSProfileName, companyInfo.company_folder_name);
                #endregion

                STUtil.SetSessionValue(UserInfo.IsCompanyAddUpdate.ToString(), "1");
            }
            catch (Exception ex)
            {
                STUtil.SetSessionValue(UserInfo.IsCompanyAddUpdate.ToString(), "1");
                result.Message = ex.Message;
            }
            return(RedirectToAction("EditCompany", "Company", new { id = company.company_id, Result = result.Message, MessageType = result.MessageType }));
        }
Esempio n. 20
0
 public ActionResult AddCompany(company company, HttpPostedFileBase company_logo, FormCollection frmUser)
 {
     try
     {
         string AWSProfileName = STUtil.GetWebConfigValue("AWSProfileName");
         string userName       = frmUser["user_name"];
         string loginID        = frmUser["login_id"];
         string emailID        = frmUser["email_id"];
         string mobile         = frmUser["mobile"];
         string password       = frmUser["password"];
         string gender         = frmUser["gender"];
         STUtil.SetSessionValue(UserInfo.IsCompanyAddUpdate.ToString(), "1");
         result = companyUtil.PostCompanyCreateEdit(company, company_logo, userName, loginID, emailID, mobile, gender, password);
         var companyEdit = db.companies.Find(company.company_id);
         //if (company_logo != null)
         //{
         //    string fileName = string.Empty;
         //
         //    String companyFolderName = companyEdit.company_folder_name.Replace("/", "");
         //    fileName = company.company_logo;
         //    var path = Path.Combine(Server.MapPath("~/Files/" + companyFolderName), fileName);
         //    company_logo.SaveAs(path);
         //}
         string GenFileName = "";
         if (company_logo != null)
         {
             GenFileName          = STUtil.GetTodayDate().ToString("yyyyMMdd") + "_" + company.company_id.ToString() + "_" + Path.GetFileName(company_logo.FileName).Replace(" ", "_");
             company.company_logo = GenFileName;
         }
         UploadFile(companyEdit.company_folder_name, company_logo, GenFileName);
         STUtil.SetSessionValue(UserInfo.IsCompanySetup.ToString(), "1");
     }
     catch (Exception ex)
     {
         STUtil.SetSessionValue(UserInfo.IsCompanyAddUpdate.ToString(), "1");
         result.Message = ex.Message;
     }
     return(RedirectToAction("Index", "Company", new { Result = result.Message, MessageType = result.MessageType }));
 }
 public ActionResult AddCompany(company company, HttpPostedFileBase company_logo, FormCollection frmUser)
 {
     try
     {
         string AWSProfileName = STUtil.GetWebConfigValue("AWSProfileName");
         string userName       = frmUser["user_name"];
         string loginID        = frmUser["login_id"];
         string emailID        = frmUser["email_id"];
         string mobile         = frmUser["mobile"];
         string password       = frmUser["password"];
         string gender         = frmUser["gender"];
         STUtil.SetSessionValue(UserInfo.IsCompanyAddUpdate.ToString(), "1");
         result = companyUtil.PostCompanyCreateEdit(company, company_logo, userName, loginID, emailID, mobile, gender, password);
         UploadFile(SessionUtil.GetCompanyFolderName().ToString(), company_logo);
         STUtil.SetSessionValue(UserInfo.IsCompanySetup.ToString(), "1");
     }
     catch (Exception ex)
     {
         STUtil.SetSessionValue(UserInfo.IsCompanyAddUpdate.ToString(), "1");
         result.Message = ex.Message;
     }
     return(RedirectToAction("EditCompany", "CompanySetting", new { Result = result.Message, MessageType = result.MessageType }));
 }
Esempio n. 22
0
        public ActionResult EditProfile(user user, HttpPostedFileBase user_photo)
        {
            try
            {
                if (user_photo != null)
                {
                    string AWSProfileName    = STUtil.GetWebConfigValue("AWSProfileName");
                    string GenFileName       = STUtil.GetTodayDate().ToString("yyyyMMdd") + "_" + SessionUtil.GetCompanyID().ToString() + "_" + Path.GetFileName(user_photo.FileName).Replace(" ", "_");
                    String companyFolderName = STUtil.GetSessionValue(UserInfo.CompanyFolderName.ToString()).ToString().Replace("/", "");
                    UploadFile(SessionUtil.GetCompanyFolderName().ToString(), user_photo);
                    user.user_photo = GenFileName;
                }
                else
                {
                }
                result = userUtil.PostProfileEdit(user);
                ViewBag.action_name = STUtil.GetListAllActionByController("");
                switch (result.MessageType)
                {
                case MessageType.Success:
                    STUtil.SetSessionValue(UserInfo.FullName.ToString(), Convert.ToString(user.user_name));
                    STUtil.SetSessionValue(UserInfo.Mobile.ToString(), Convert.ToString(user.mobile));
                    STUtil.SetSessionValue(UserInfo.UserPhoto.ToString(), Convert.ToString(user.user_photo));
                    STUtil.SetSessionValue(UserInfo.Gender.ToString(), Convert.ToString(user.gender));

                    return(RedirectToAction("MyProfile", "MyProfile", new { Result = result.Message, MessageType = result.MessageType }));

                default:
                    return(RedirectToAction("MyProfile", "MyProfile", new { Result = result.Message, MessageType = result.MessageType }));
                }
                return(View(user));
            }
            catch
            {
                return(View(user));
            }
        }
Esempio n. 23
0
 public ActionResult ChangePassword()
 {
     STUtil.SetSessionValue(UserInfo.pageTitle.ToString(), "Change Password");
     ViewBag.Title = "Change Password";
     return(View());
 }
Esempio n. 24
0
        //public ActionResult IsScoreColumnExist(string id)
        //{
        //    //id="country_name,country_id"
        //    string[] info = id.Split(',');
        //    string scorecolumnname = id;
        //    int scorecolumnid = 0;
        //    if (info.Length == 2)
        //    {

        //        scorecolumnname = info[0];
        //        scorecolumnid = info[1] != "" ? Convert.ToInt32(info[1]) : scorecolumnid;
        //    }
        //    return Json(scoreColumnUtil.GetScoreColumnByScoreId(scorecolumnname, scorecolumnid) == null ? false : true);
        //}
        #endregion


        public ActionResult ChangeTheme(string id)
        {
            Result result       = new Result();
            var    colorCss     = "";
            int    themeColorId = Convert.ToInt32(id);

            switch ((ThemeColor)(themeColorId))
            {
            case ThemeColor.default_them:
                colorCss = "default.css";
                break;

            case ThemeColor.green:
                colorCss = "green.css";
                break;

            case ThemeColor.red:
                colorCss = "red.css";
                break;

            case ThemeColor.blue:
                colorCss = "blue.css";
                break;

            case ThemeColor.purple:
                colorCss = "purple.css";
                break;

            case ThemeColor.megna:
                colorCss = "megna.css";
                break;

            case ThemeColor.default_dark:
                colorCss = "default-dark.css";
                break;

            case ThemeColor.green_dark:
                colorCss = "green-dark.css";
                break;

            case ThemeColor.blue_dark:
                colorCss = "blue-dark.css";
                break;

            case ThemeColor.purple_dark:
                colorCss = "purple-dark.css";
                break;

            case ThemeColor.megna_dark:
                colorCss = "megna-dark.css";
                break;

            default:
                break;
            }
            STUtil.SetSessionValue(UserInfo.theme_color.ToString(), Convert.ToString(colorCss));
            user u = db.users.Find((Int32)SessionUtil.GetUserID());

            u.theme_color_id  = themeColorId;///colorCss.ToString();
            db.Entry(u).State = System.Data.Entity.EntityState.Modified;
            db.SaveChanges();
            result.MessageType = MessageType.Success;
            result.Message     = "Theme Apply Successfully";
            return(RedirectToAction("Index", "DashBoard", new { Result = result.Message, MessageType = result.MessageType }));
        }
Esempio n. 25
0
        public static String CheckUserFrofile(String LoginID, String PWD, Int32 userID = 0)
        {
            String result = "Invalid Login ID or Password ";

            var userInfo = (from U in db.USP_Login(LoginID, PWD, true)
                            select new
            {
                UserID = U.user_id,
                IsActive = U.is_active,
                CompanyActive = U.CompanyActive,
                FullName = U.user_name,
                LoginID = U.email_id,
                Email = U.email_id,
                gender = U.gender,
                Mobile = U.mobile,
                RoleBit = U.role_bit,
                RoleName = U.role_name,
                RoleID = U.role_id,
                CompanyID = U.company_id,
                CompanyName = U.business_name,
                CompanyFolderName = U.company_folder_name,
                company_logo = U.company_logo,

                time_zone = U.time_zone,
                currency_id = (int)U.currency_id,
                currency_name = U.currency_name,
                currency_symbol = U.currency_symbol,
                date_format_id = (int)U.date_format_id,
                date_format_name = U.date_format_name,
                date_format_code_csharp = U.date_format_code_csharp,
                date_format_code_js = U.date_format_code_js,
                time_format_id = (int)U.time_format_id,
                time_format_name = U.time_format_name,
                time_format_code_csharp = U.time_format_code_csharp,
                time_format_code_js = U.time_format_code_js,

                Photo = U.user_photo,

                last_login_date = U.last_login_date,
                password_failed_attempt = U.password_failed_attempt,
                is_account_locked = U.is_account_locked,

                system_company_folder = U.system_company_folder,
                company_doc_file_name = U.company_doc_file_name,

                create_work_order_access_id = U.create_work_order_access_id,
                view_work_order_access_id = U.view_work_order_access_id,
                is_change_requester = U.is_change_requester,
                is_service_provider = U.is_service_provider,

                theme_color = U.theme_color,
            }).FirstOrDefault();

            #region AutoLogin By UserID


            if (userID > 0)
            {
                userInfo = (from U in db.users.AsEnumerable()
                            join C in db.companies.AsEnumerable() on U.company_id equals C.company_id
                            join R in db.roles.AsEnumerable() on U.role_bit equals R.role_bit
                            join CU in db.currencies.AsEnumerable() on C.currency_id equals CU.currency_id into curr
                            from CU in curr.DefaultIfEmpty()
                            join DF in db.date_format.AsEnumerable() on C.date_format_id equals DF.date_format_id into DateFo
                            from DF in DateFo.DefaultIfEmpty()
                            join TF in db.time_format.AsEnumerable() on C.time_format_id equals TF.time_format_id into TimeFo
                            from TF in TimeFo.DefaultIfEmpty()
                            where U.user_id == userID
                            select new
                {
                    UserID = U.user_id,
                    IsActive = U.is_active,
                    CompanyActive = C.is_active,
                    FullName = U.user_name,
                    LoginID = U.email_id,
                    Email = U.email_id,
                    gender = U.gender,
                    Mobile = U.mobile,
                    RoleBit = U.role_bit,
                    RoleName = R.role_name,
                    RoleID = R.role_id,

                    CompanyID = U.company_id,
                    CompanyName = C.business_name,
                    CompanyFolderName = C.company_folder_name,
                    company_logo = C.company_logo,

                    time_zone = C.time_zone,
                    currency_id = CU != null ? CU.currency_id : 0,
                    currency_name = CU != null ? CU.currency_name : "",
                    currency_symbol = CU != null ? CU.currency_symbol : "",

                    date_format_id = DF != null ? DF.date_format_id : 0,
                    date_format_name = DF != null ? DF.date_format_name : "",
                    date_format_code_csharp = DF != null ? DF.date_format_code_csharp : "",
                    date_format_code_js = DF != null ? DF.date_format_code_js : "",

                    time_format_id = TF != null ? TF.time_format_id : 0,
                    time_format_name = TF != null ? TF.time_format_name : "",
                    time_format_code_csharp = TF != null ? TF.time_format_code_csharp : "",
                    time_format_code_js = TF != null ? TF.time_format_code_js : "",

                    Photo = U.user_photo,

                    last_login_date = U.last_login_date,
                    password_failed_attempt = U.password_failed_attempt,
                    is_account_locked = U.is_account_locked,

                    system_company_folder = C.system_company_folder,
                    company_doc_file_name = C.company_doc_file_name,

                    create_work_order_access_id = U.create_work_order_access_id,
                    view_work_order_access_id = U.view_work_order_access_id,
                    is_change_requester = U.is_change_requester,
                    is_service_provider = U.is_service_provider,

                    theme_color = U.theme_color_id == null ? C.theme_color.theme_css : U.theme_color.theme_css,
                }).FirstOrDefault();
            }
            #endregion
            if (userInfo == null)
            {
                var userRecord = (from U in db.users
                                  join C in db.companies on U.company_id equals C.company_id
                                  where (U.login_id == LoginID)
                                  select U).FirstOrDefault();
                if (userRecord != null)
                {
                    result = STUtil.UserLoginPolicy(userRecord.user_id, true);
                }
            }
            try
            {
                if (userInfo != null)
                {
                    if (userInfo.is_account_locked)
                    {
                        result = "Your acount has been locked. Due to multiple invalid password ! Please contact to Admin";
                    }
                    else
                    {
                        if (userInfo.IsActive)
                        {
                            STUtil.SetSessionValue(UserInfo.UserID.ToString(), Convert.ToString(userInfo.UserID));
                            STUtil.SetSessionValue(UserInfo.FullName.ToString(), Convert.ToString(userInfo.FullName));

                            STUtil.SetSessionValue(UserInfo.LoginID.ToString(), Convert.ToString(userInfo.LoginID));
                            STUtil.SetSessionValue(UserInfo.EmailID.ToString(), Convert.ToString(userInfo.Email));
                            STUtil.SetSessionValue(UserInfo.Mobile.ToString(), Convert.ToString(userInfo.Mobile));
                            STUtil.SetSessionValue(UserInfo.RoleBit.ToString(), Convert.ToString(userInfo.RoleBit));
                            STUtil.SetSessionValue(UserInfo.RoleID.ToString(), Convert.ToString(userInfo.RoleID));
                            STUtil.SetSessionValue(UserInfo.RoleName.ToString(), Convert.ToString(userInfo.RoleName));
                            STUtil.SetSessionValue(UserInfo.CompanyID.ToString(), Convert.ToString(userInfo.CompanyID));

                            STUtil.SetSessionValue(UserInfo.CompanyName.ToString(), Convert.ToString(userInfo.CompanyName));
                            STUtil.SetSessionValue(UserInfo.CompanyFolderName.ToString(), Convert.ToString(userInfo.CompanyFolderName));
                            STUtil.SetSessionValue(UserInfo.CompanyLogo.ToString(), Convert.ToString(userInfo.company_logo));

                            STUtil.SetSessionValue(UserInfo.UserPhoto.ToString(), Convert.ToString(userInfo.Photo));
                            STUtil.SetSessionValue(UserInfo.Gender.ToString(), Convert.ToString(userInfo.gender.ToUpper()));

                            STUtil.SetSessionValue(UserInfo.time_zone.ToString(), Convert.ToString(userInfo.time_zone));

                            STUtil.SetSessionValue(UserInfo.currency_id.ToString(), Convert.ToString(userInfo.currency_id));
                            STUtil.SetSessionValue(UserInfo.currency_name.ToString(), Convert.ToString(userInfo.currency_name));
                            STUtil.SetSessionValue(UserInfo.currency_symbol.ToString(), Convert.ToString(userInfo.currency_symbol));

                            STUtil.SetSessionValue(UserInfo.date_format_id.ToString(), Convert.ToString(userInfo.date_format_id));
                            STUtil.SetSessionValue(UserInfo.date_format_name.ToString(), Convert.ToString(userInfo.date_format_name));
                            STUtil.SetSessionValue(UserInfo.date_format_code_csharp.ToString(), Convert.ToString(userInfo.date_format_code_csharp));
                            STUtil.SetSessionValue(UserInfo.date_format_code_js.ToString(), Convert.ToString(userInfo.date_format_code_js));

                            STUtil.SetSessionValue(UserInfo.time_format_id.ToString(), Convert.ToString(userInfo.time_format_id));
                            STUtil.SetSessionValue(UserInfo.time_format_name.ToString(), Convert.ToString(userInfo.time_format_name));
                            STUtil.SetSessionValue(UserInfo.time_format_code_csharp.ToString(), Convert.ToString(userInfo.time_format_code_csharp));
                            STUtil.SetSessionValue(UserInfo.time_format_code_js.ToString(), Convert.ToString(userInfo.time_format_code_js));

                            STUtil.SetSessionValue(UserInfo.system_company_folder.ToString(), Convert.ToString(userInfo.system_company_folder));

                            STUtil.SetSessionValue(UserInfo.company_doc_file_name.ToString(), Convert.ToString(userInfo.company_doc_file_name));

                            STUtil.SetSessionValue(UserInfo.create_work_order_access_id.ToString(), Convert.ToString(userInfo.create_work_order_access_id));
                            STUtil.SetSessionValue(UserInfo.view_work_order_access_id.ToString(), Convert.ToString(userInfo.view_work_order_access_id));
                            STUtil.SetSessionValue(UserInfo.is_change_requester.ToString(), Convert.ToString(userInfo.is_change_requester));
                            STUtil.SetSessionValue(UserInfo.is_service_provider.ToString(), Convert.ToString(userInfo.is_service_provider));

                            STUtil.SetSessionValue(UserInfo.theme_color.ToString(), Convert.ToString(userInfo.theme_color));

                            STUtil.SetSessionValue(UserInfo.SERVER_TIME_ZONE.ToString(), STUtil.GetWebConfigValue("SERVER_TIME_ZONE"));

                            STUtil.SetSessionValue(UserInfo.SuperAdmin.ToString(), Convert.ToString(RoleUtil.IsInRole(Role.SuperAdmin, userInfo.RoleBit)));

                            STUtil.SetSessionValue(UserInfo.IsCompanySetup.ToString(), "1");
                            //STUtil.SetSessionValue(UserInfo.IsCompanySetup.ToString(), string.IsNullOrEmpty(userInfo.time_zone) ? "0" : "1");
                            //STUtil.SetSessionValue(UserInfo.IsCompanySetup.ToString(), string.IsNullOrEmpty(userInfo.currency_name) ? "0" : "1");
                            //STUtil.SetSessionValue(UserInfo.IsCompanySetup.ToString(), string.IsNullOrEmpty(userInfo.time_format_name) ? "0" : "1");
                            //STUtil.SetSessionValue(UserInfo.IsCompanySetup.ToString(), string.IsNullOrEmpty(userInfo.date_format_name) ? "0" : "1");
                            //STUtil.SetSessionValue(UserInfo.IsCompanySetup.ToString(), string.IsNullOrEmpty(userInfo.system_company_folder) ? "0" : "1");
                            //STUtil.SetSessionValue(UserInfo.IsCompanySetup.ToString(), userInfo.default_contact_id == null ? "0" : "1");

                            STUtil.SetSessionValue(UserInfo.IsCompanyAddUpdate.ToString(), "1");

                            //STUtil.SetSessionValue(UserInfo.Admin.ToString(), Convert.ToString(RoleUtil.IsInRole(Role.Admin, userInfo.RoleBit)));
                            //STUtil.SetSessionValue(UserInfo.CRMExecutive.ToString(), Convert.ToString(RoleUtil.IsInRole(Role.CRMExecutive, userInfo.RoleBit)));
                            //STUtil.SetSessionValue(UserInfo.Account.ToString(), Convert.ToString(RoleUtil.IsInRole(Role.Account, userInfo.RoleBit)));
                            //STUtil.SetSessionValue(UserInfo.Manager.ToString(), Convert.ToString(RoleUtil.IsInRole(Role.Manager, userInfo.RoleBit)));
                            //STUtil.SetSessionValue(UserInfo.Agent.ToString(), Convert.ToString(RoleUtil.IsInRole(Role.Agent, userInfo.RoleBit)));


                            STUtil.UserLoginPolicy(userInfo.UserID, false);
                            result = "PASS";
                        }
                        else
                        {
                            result = !userInfo.IsActive ? "Your are Inactive! Please contact to Admin" : String.Empty;
                        }
                    }
                }
            }
            catch (Exception ex)
            {
                throw ex;
                //// ExceptionLogging.SendErrorToText(ex);
            }

            return(result);
        }