Exemple #1
0
        //Get:UserClassification By UserType
        public Model_UserClassification GetUserClassificationByUserType(string type)
        {
            var t = db.UserClassifications.Where(x => x.UserType == type && x.IsDeleted == false).FirstOrDefault();
            Model_UserClassification uc = new Model_UserClassification();

            try
            {
                if (t != null)
                {
                    uc.Id                    = t.Id;
                    uc.UserType              = t.UserType;
                    uc.MasterFileUpdation    = t.MasterFileUpdation == true ? "Enable" : "Disable";
                    uc.MasterRecordDeletion  = t.MasterRecordDeletion == true ? "Enable" : "Disable";
                    uc.PendingRecordDeletion = t.PendingRecordDeletion == true ? "Enable" : "Disable";
                    uc.Configuration         = t.Configuration == true ? "Enable" : "Disable";
                    uc.PasswordPolicy        = t.PasswordPolicy == true ? "Enable" : "Disable";
                    uc.PasswordReset         = t.PasswordReset == true ? "Enable" : "Disable";
                    uc.TransactionDeletion   = t.TransactionDeletion == true ? "Enable" : "Disable";
                    uc.GateEntry             = t.GateEntry == true ? "Enable" : "Disable";
                    uc.RFIDIssue             = t.RFIDIssue == true ? "Enable" : "Disable";
                    uc.UserCreation          = t.UserCreation == true ? "Enable" : "Disable";
                    uc.Weighment             = t.Weighment == true ? "Enable" : "Disable";
                    uc.DatabaseOperation     = t.DatabaseOperation == true ? "Enable" : "Disable";
                }
            }
            catch
            {
            }
            return(uc);
        }
        public string Get_UserClassificationByUserType(string type)
        {
            type = type.ToLower();
            Model_UserClassification uc = _ucrepo.GetUserClassificationByUserType(type.ToLower());
            string myjsonstring         = new JavaScriptSerializer().Serialize(uc);

            return(myjsonstring);
        }
        public string Check_UserClassification(string userType)
        {
            userType = userType.ToLower();
            Model_UserClassification _user = _ucrepo.GetUserClassificationByUserType(userType);
            string jsonstring = string.Empty;

            if (_user.Id != 0)
            {
                jsonstring = new JavaScriptSerializer().Serialize(_user);
            }
            return(jsonstring);
        }