Пример #1
0
 public List<UserProfileModel> GetUserByUserId(ParameterModel mymodel)
 {
     List<UserProfileModel> model = new List<UserProfileModel>();
     try
     {
         cmd = new SqlCommand("GetUserByUserId_Sp", con);
         cmd.Parameters.Add("@UserId", SqlDbType.BigInt).Value = mymodel.Id;
         cmd.CommandType = CommandType.StoredProcedure;
         if (con.State == ConnectionState.Closed)
         {
             con.Open();
         }
         dr = cmd.ExecuteReader();
         while (dr.Read())
         {
             model.Add(new UserProfileModel
             {
                 UserId = Convert.ToInt32(dr["UserId"]),
                 OrgId = Convert.ToInt32(dr["OrgId"]),
                 OrgName = dr["OrgName"].ToString(),
                 OrgStreet = dr["OrgStreet"].ToString(),
                 OrgCity = dr["OrgCityName"].ToString(),
                 OrgState = dr["OrgStateName"].ToString(),
                 UserFirstName = dr["FirstName"].ToString(),
                 UserLastName = dr["LastName"].ToString(),
                 UserStreet = dr["Street"].ToString(),
                 UserCityId = Convert.ToInt32(dr["CityId"]),
                 UserStateId = Convert.ToInt32(dr["StateId"]),
                 UserCity = dr["CityName"].ToString(),
                 UserState = dr["StateName"].ToString(),
                 ProfilePhoto = dr["ProfilePhoto"].ToString(),
                 RoleId = Convert.ToInt32(dr["RoleId"]),
                 RoleName = dr["RoleName"].ToString(),
                 UserName = dr["UserName"].ToString(),
                 UserEmailId = dr["EmailId"].ToString(),
                 UserMobileNo = dr["MobileNo"].ToString(),
                 Password = PasswordSecurity.Decrypt(dr["Password"].ToString()),  //Password Decryption
                 CreatedBy = Convert.ToInt32(dr["CreatedBy"]),
                 CreatedOn = Convert.ToDateTime(dr["CreatedOn"]),
                 ModifiedBy = Convert.ToInt32(dr["ModifiedBy"]),
                 ModifiedOn = Convert.ToDateTime(dr["ModifiedOn"]),
                 IsActive = Convert.ToBoolean(dr["IsActive"]),
                 IsDelete = Convert.ToBoolean(dr["IsDelete"]),
                 RegisteredAs = dr["RegisteredAs"].ToString()
             });
         }
         if (con.State == ConnectionState.Open)
             con.Close();
     }
     catch (Exception ex)
     {
         obj.Message = ex.Message;
         ret = 0;
     }
     return model;
 }
Пример #2
0
 public List<ModulesModel> GetAllModuleListByOrgId(ParameterModel mymodel)
 {
     List<ModulesModel> model = new List<ModulesModel>();
     try
     {
         SqlCommand cmd = new SqlCommand("GetAllModuleListByOrgId_Sp", con);
         cmd.Parameters.Add("@Org_Id", SqlDbType.NVarChar, 150).Value = mymodel.Id;
         cmd.CommandType = CommandType.StoredProcedure;
         if (con.State == ConnectionState.Closed)
         {
             con.Open();
         }
         SqlDataReader dr = cmd.ExecuteReader();
         while (dr.Read())
         {
             model.Add(new ModulesModel
             {
                 ModuleId = Convert.ToInt32(dr["ModuleId"]),
                 ModuleName = dr["Module_Name"].ToString(),
                 CreatedByOrg_Id = Convert.ToInt64(dr["CreatedBy"]),
                
             });
         }
         if (con.State == ConnectionState.Open)
         {
             con.Close();
         }
     }
     catch (Exception ex)
     {
         obj.Message = ex.Message;
         ret = 0;
     }
     return model;
     // return Json(model, JsonRequestBehavior.AllowGet);
 }
Пример #3
0
 public List<ModulesModel> GetAllModuleListByOrgId(ParameterModel model)
 {
     Modules_Sp_Class objMod = new Modules_Sp_Class();
     return objMod.GetAllModuleListByOrgId(model);
 }
Пример #4
0
  public List<UserProfileModel> GetUserByUserId(ParameterModel model)
 {
      return obj.GetUserByUserId(model);
  }