public List <DCUsers> GetClientDetails() { objDatabaseHelper = new DatabaseHelper(); objDCUsers = new DCUsers(); lstDCUsers = new List <DCUsers>(); try { DbDataReader reader = objDatabaseHelper.ExecuteReader(BLDBRoutines.SP_GETCLIENTDETAILS, CommandType.StoredProcedure); if (reader.HasRows) { while (reader.Read()) { objDCUsers = new DCUsers(); objDCUsers.ClientDetailsId = reader.IsDBNull(reader.GetOrdinal("ClientDetailsId")) ? 0 : reader.GetInt32(reader.GetOrdinal("ClientDetailsId")); objDCUsers.ClientName = reader.IsDBNull(reader.GetOrdinal("ClientName")) ? string.Empty : reader.GetString(reader.GetOrdinal("ClientName")); lstDCUsers.Add(objDCUsers); } } return(lstDCUsers); } catch (Exception exec) { throw exec; } finally { if (objDatabaseHelper != null) { objDatabaseHelper.Dispose(); } } }
public List <DCUsers> GetProtocolDetails(int SponserDetailsId) { objDatabaseHelper = new DatabaseHelper(); objDCUsers = new DCUsers(); lstDCUsers = new List <DCUsers>(); try { objDatabaseHelper.AddParameter("pSponserDetailsId", SponserDetailsId == 0 ? DBNull.Value : (object)SponserDetailsId); DbDataReader reader = objDatabaseHelper.ExecuteReader(BLDBRoutines.SP_GETPROTOCOLDETAILS, CommandType.StoredProcedure); if (reader.HasRows) { while (reader.Read()) { objDCUsers = new DCUsers(); objDCUsers.ProtocalDetailsId = reader.IsDBNull(reader.GetOrdinal("ProtocalDetailsId")) ? 0 : reader.GetInt32(reader.GetOrdinal("ProtocalDetailsId")); objDCUsers.ProtocalName = reader.IsDBNull(reader.GetOrdinal("ProtocalName")) ? string.Empty : reader.GetString(reader.GetOrdinal("ProtocalName")); objDCUsers.SponserDetailsId = reader.IsDBNull(reader.GetOrdinal("SponserDetailsId")) ? 0 : reader.GetInt32(reader.GetOrdinal("SponserDetailsId")); lstDCUsers.Add(objDCUsers); } } return(lstDCUsers); } catch (Exception exec) { throw exec; } finally { if (objDatabaseHelper != null) { objDatabaseHelper.Dispose(); } } }
public ActionResult AddRCMitigation(FormCollection frmcol) { if (Session["UserLogon"] != null) { if (!string.IsNullOrEmpty(frmcol["btnAddMitigation"])) { DCUsers objDCUsers = (DCUsers)Session["UserLogon"]; objBLRiskCriteria = new BLRiskCriteria(); objDCRiskCriteria = new DCRiskCriteria(); objDCRiskCriteria.RiskCriteria = frmcol["hdnRiskCriteria"]; objDCRiskCriteria.RiskCriteriaDescription = frmcol["ddlRiskCriteriaDescription"]; objDCRiskCriteria.Mitigation = frmcol["txtMitigation"]; objDataOperationResponse = objBLRiskCriteria.AddRCMitigation(objDCRiskCriteria); if (objDataOperationResponse.Code > 0) { TempData["successMessage"] = objDataOperationResponse.Message; } else { TempData["errorMessage"] = objDataOperationResponse.Message; } TempData["activetab"] = "3"; // return Redirect("/RiskCriteria/ViewRiskCriteria"); return(Redirect("/RiskCriteria/AddRCMitigation")); } } return(View()); }
/// <summary> /// This method is used for Delete Sections /// </summary> /// <param name="RefKey"></param> /// <returns></returns> public string DeleteSDVDetails(string RefKey) { objBLSDVDetails = new BLSDVDetails(); objDCUsers = (DCUsers)Session["UserLogon"]; objDataOperationResponse = objBLSDVDetails.DeleteSDVDetails(Convert.ToInt32(RefKey), objDCUsers.UserId); return(objDataOperationResponse.Message); }
/// <summary> /// This method is used for Login /// </summary> /// <param name="frmColl"></param> /// <returns></returns> public ActionResult Login(FormCollection frmColl) { if (!string.IsNullOrEmpty(frmColl["btnLogin"]) && (string.Compare(frmColl["btnLogin"].ToUpper(), "LOGIN") == 0)) { objBLUsers = new BLUsers(); DCUsers objDCUsers = objBLUsers.UserLogon(frmColl["txtEmailAddress"], frmColl["txtPassword"]); if (objDCUsers.Code > 0) { Session["UserLogon"] = objDCUsers; switch (objDCUsers.UserType) { case UserType.A: return(Redirect("RiskCriteria/ViewRiskCriteria")); case UserType.U: return(Redirect("ClientInfo/AddUpdateClientInfo")); } } else { TempData["errorMessage"] = "The UserID/Password is Incorrect."; } } return(View()); }
/// <summary> /// This method is used for Get CAPA Details /// </summary> /// <param name="strSectionId"></param> /// <param name="strRiskScoreId"></param> /// <returns></returns> public JsonResult GetCAPADetails(string strSectionId, string strRiskScoreId, string strAssessmentType) { lstDCCAPADetails = new List <DCCAPADetails>(); objBLCAPADetails = new BLCAPADetails(); objDCUsers = (DCUsers)Session["UserLogon"]; lstDCCAPADetails = objBLCAPADetails.GetCAPADetails(Convert.ToInt32(strSectionId), Convert.ToInt32(strRiskScoreId), objDCUsers.UserId, Convert.ToInt32(strAssessmentType)); return(Json(lstDCCAPADetails, JsonRequestBehavior.AllowGet)); }
/// <summary> /// This method is used for Get SDV Details /// </summary> /// <param name="strSectionId"></param> /// <param name="strRiskScoreId"></param> /// <returns></returns> public JsonResult GetSDVDetails(string strSectionId, string strRefKey) { lstDCSDVDetails = new List <DCSDVDetails>(); objBLSDVDetails = new BLSDVDetails(); objDCUsers = (DCUsers)Session["UserLogon"]; lstDCSDVDetails = objBLSDVDetails.GetSDVDetails(Convert.ToInt32(strSectionId), objDCUsers.UserId, Convert.ToInt32(strRefKey)); return(Json(lstDCSDVDetails, JsonRequestBehavior.AllowGet)); }
/// <summary> /// This function is Used to Get SDV_Sections Details /// </summary> /// <returns></returns> public JsonResult GetSDV_Sections(string strAssessmentTypeId, string strSectionId) { objBLSDVDetails = new BLSDVDetails(); lstDCSections = new List <DCSections>(); objDCUsers = (DCUsers)Session["UserLogon"]; lstDCSections = objBLSDVDetails.GetSDV_Sections(objDCUsers.UserId, Convert.ToInt32(strAssessmentTypeId), Convert.ToInt32(strSectionId)); return(Json(lstDCSections, JsonRequestBehavior.AllowGet)); }
/// <summary> /// 转换为用户名持久化对象 /// </summary> /// <param name="entity">用户名实体</param> public static DCUsersPo ToPo(this DCUsers entity) { if (entity == null) { return(null); } return(entity.MapTo <DCUsersPo>()); }
///// <summary> ///// 转换为用户名实体 ///// </summary> ///// <param name="dto">用户名数据传输对象</param> //public static DCUsers ToEntity3( this DCUsersDto dto ) { // if( dto == null ) // return new DCUsers(); // return DCUsersFactory.Create( // // // id : dto.Id.ToLong(), // // // name : dto.Name, // // // nickName : dto.NickName, // // // email : dto.Email, // // // passwordVersion : dto.PasswordVersion, // // // password : dto.Password, // // // salt : dto.Salt, // // // description : dto.Description, // // // isSystemAdministrator : dto.IsSystemAdministrator, // // // creationTime : dto.CreationTime, // // // creatId : dto.CreatId, // // // lastModifiTime : dto.LastModifiTime, // // // lastModifiId : dto.LastModifiId, // // // isDeleted : dto.IsDeleted, // // // version : dto.Version // // ); //} /// <summary> /// 转换为用户名数据传输对象 /// </summary> /// <param name="entity">用户名实体</param> public static DCUsersDto ToDto(this DCUsers entity) { if (entity == null) { return(new DCUsersDto()); } return(entity.MapTo <DCUsersDto>()); }
public JsonResult GetClientInfo() { lstDCClientInfo = new List <DCClientInfo>(); objBLClientInfo = new BLClientInfo(); objDCUsers = (DCUsers)Session["UserLogon"]; lstDCClientInfo = objBLClientInfo.GetClientInfo(objDCUsers.UserId); var result = Json(lstDCClientInfo, JsonRequestBehavior.AllowGet); result.MaxJsonLength = int.MaxValue; return(result); }
/// <summary> ///This method is used for Get Questions /// </summary> /// <returns></returns> public JsonResult GetUserAssessmentTypes() { lstDCAssessment = new List <DCAssessment>(); objBLAssessment = new BLAssessment(); objDCUsers = (DCUsers)Session["UserLogon"]; lstDCAssessment = objBLAssessment.GetUserAssessmentTypes(objDCUsers.UserId); var result = Json(lstDCAssessment, JsonRequestBehavior.AllowGet); result.MaxJsonLength = int.MaxValue; return(result); }
/// <summary> /// Add Risk Criteria /// </summary> /// <returns></returns> /// public ActionResult AddRiskCriteria(FormCollection frmColl) { if (Session["UserLogon"] != null) { if (!string.IsNullOrEmpty(frmColl["btnAddRiskCriteria"]) || !string.IsNullOrEmpty(frmColl["btnAddAttribute"])) { DCUsers objDCUsers = (DCUsers)Session["UserLogon"]; objBLRiskCriteria = new BLRiskCriteria(); objDCRiskCriteria = new DCRiskCriteria(); if (string.IsNullOrEmpty(frmColl["ddlAttribute"]) && string.IsNullOrEmpty(frmColl["ddlRiskCriteria"])) { objDCRiskCriteria.Attribute = "RC"; objDCRiskCriteria.DataValue = frmColl["txtRiskCriteria"]; objDCRiskCriteria.RiskCriteria = frmColl["txtRiskCriteria"]; } else { objDCRiskCriteria.Attribute = frmColl["ddlAttribute"]; objDCRiskCriteria.DataValue = frmColl["txtAttributeDescription"]; objDCRiskCriteria.RiskCriteria = frmColl["hdnRiskCriteria"]; } objDCRiskCriteria.CreatedBy = objDCUsers.UserId; objDataOperationResponse = objBLRiskCriteria.AddRiskCriteria(objDCRiskCriteria); if (objDataOperationResponse.Code > 0) { if (string.IsNullOrEmpty(frmColl["ddlAttribute"]) && string.IsNullOrEmpty(frmColl["ddlRiskCriteria"])) { TempData["successMessage"] = "Risk Criteria Added Successfully"; TempData["activetab"] = "1"; } else { TempData["successMessage"] = "Risk Criteria Attribute Added Successfully"; TempData["activetab"] = "2"; } } else { if (string.IsNullOrEmpty(frmColl["ddlAttribute"]) && string.IsNullOrEmpty(frmColl["ddlRiskCriteria"])) { TempData["errorMessage"] = objDataOperationResponse.Message; TempData["activetab"] = "1"; } else { TempData["errorMessage"] = objDataOperationResponse.Message; TempData["activetab"] = "2"; } } } } return(View()); }
/// <summary> /// This method is used for user login /// </summary> /// <param name="strEmailAddress"></param> /// <param name="strPassword"></param> /// <returns></returns> public DCUsers UserLogon(string strEmailAddress, string strPassword) { DatabaseHelper dbHelper = new DatabaseHelper(); DCUsers dcUsers = new DCUsers(); try { dbHelper.AddParameter("pEmailAddress", strEmailAddress); dbHelper.AddParameter("pUserPassword", strPassword); DbDataReader reader = dbHelper.ExecuteReader(BLDBRoutines.SP_LOGIN, CommandType.StoredProcedure); if (reader.HasRows) { string strUserType = string.Empty; while (reader.Read()) { dcUsers.UserId = reader.IsDBNull(reader.GetOrdinal("UserID")) ? 0 : reader.GetInt32(reader.GetOrdinal("UserID")); dcUsers.FirstName = reader.IsDBNull(reader.GetOrdinal("FirstName")) ? string.Empty : reader.GetString(reader.GetOrdinal("FirstName")); dcUsers.LastName = reader.IsDBNull(reader.GetOrdinal("LastName")) ? string.Empty : reader.GetString(reader.GetOrdinal("LastName")); dcUsers.EmailAddress = reader.IsDBNull(reader.GetOrdinal("EmailAddress")) ? string.Empty : reader.GetString(reader.GetOrdinal("EmailAddress")); strUserType = reader.IsDBNull(reader.GetOrdinal("UserType")) ? string.Empty : reader.GetString(reader.GetOrdinal("UserType")); switch (strUserType) { case "U": dcUsers.UserType = UserType.U; break; case "A": dcUsers.UserType = UserType.A; break; } } dcUsers.Code = GetSuccessCode; } else { dcUsers.Code = GetErrorCode; } return(dcUsers); } catch (Exception exception) { dcUsers.Code = GetErrorCode; dcUsers.Message = exception.Message; return(dcUsers); } finally { if (dbHelper != null) { dbHelper.Dispose(); } } }
/// <summary> /// This method is used for Add Update Question /// </summary> /// <param name="frmColl"></param> /// <param name="QuestionId"></param> /// <returns></returns> public string AddUpdateQuestion(DCQuestions objDCQuestions, string UserId) { if (Session["UserLogon"] != null) { objBLQuestions = new BLQuestions(); if (objDCQuestions.QuestionId == 0) { objDCQuestions.QuestionId = 0; } else { objDCQuestions.QuestionId = Convert.ToInt32(objDCQuestions.QuestionId); } DCUsers objDCUsers = (DCUsers)Session["UserLogon"]; objDCQuestions.CreatedBy = objDCUsers.UserId; //string ActionItems = objBLQuestions.ConvertStringArrayToStringJoin(objDCQuestions.ActionItems); StringBuilder objStrBuilder = new StringBuilder(); //if (!string.IsNullOrEmpty(objDCQuestions.ActionItems)) //string[] separatingChars = { "$$" }; //string[] strQueActionItems = objDCQuestions.ActionItems.Split(separatingChars, System.StringSplitOptions.None); List <string> strQueActionItems = objDCQuestions.ActionItems; objStrBuilder.Append("<QueActionItems>"); foreach (string actionItems in strQueActionItems) { objStrBuilder.Append("<ActionItem>" + actionItems + "</ActionItem>"); } objStrBuilder.Append("</QueActionItems>"); string XMLData = objStrBuilder.ToString(); StringBuilder objStrMitigation = new StringBuilder(); List <string> strQueMitigation = objDCQuestions.Mitigation; objStrMitigation.Append("<QueMitigations>"); foreach (string mitigation in strQueMitigation) { objStrMitigation.Append("<Mitigation>" + mitigation + "</Mitigation>"); } objStrMitigation.Append("</QueMitigations>"); string XMLQueMitigation = objStrMitigation.ToString(); objDataOperationResponse = objBLQuestions.AddUpdateQuestions(objDCQuestions, XMLData, XMLQueMitigation); if (objDataOperationResponse.Code > 0) { return(objDataOperationResponse.Message); } } return(objDataOperationResponse.Message); }
/// <summary> /// This method is used for Get Sections /// </summary> /// <returns></returns> public JsonResult GetSections(string strAssessmentTypeId) { if (Session["UserLogon"] != null) { DCUsers objDCUsers = (DCUsers)Session["UserLogon"]; lstDCSections = new List <DCSections>(); objBLSections = new BLSections(); lstDCSections = objBLSections.GetSections(Convert.ToInt32(strAssessmentTypeId), objDCUsers.UserId); } var result = Json(lstDCSections, JsonRequestBehavior.AllowGet); result.MaxJsonLength = int.MaxValue; return(result); }
/// <summary> /// This method is used for Get Section Name By SectionId /// </summary> /// <param name="strSectionId"></param> /// <returns></returns> public JsonResult GetSectionNameBySectionId(string strSectionId) { objBLSections = new BLSections(); DCUsers objDCUsers = (DCUsers)Session["UserLogon"]; if (Session["UserLogon"] != null) { lstDCSections = objBLSections.GetSectionNameBySectionId(Convert.ToInt32(strSectionId), objDCUsers.UserId); } var result = Json(lstDCSections, JsonRequestBehavior.AllowGet); result.MaxJsonLength = int.MaxValue; return(result); }
public JsonResult QuestionsSortingBySortKey(int QuestionId, int SectionId, string Arrow, string AssessmentTypeId) { lstDCQuestions = new List <DCQuestions>(); objBLQuestions = new BLQuestions(); objDCSections = new DCSections(); if (Session["UserLogon"] != null) { DCUsers objDCUsers = (DCUsers)Session["UserLogon"]; lstDCQuestions = objBLQuestions.QuestionsSortingBySortKey(QuestionId, SectionId, Arrow, Convert.ToInt32(AssessmentTypeId), objDCUsers.UserId); } var result = Json(lstDCQuestions, JsonRequestBehavior.AllowGet); result.MaxJsonLength = int.MaxValue; return(result); }
/// <summary> ///This method is used for Get Questions /// </summary> /// <returns></returns> public JsonResult GetQuestions(string strQuestionID) { lstDCQuestions = new List <DCQuestions>(); objBLQuestions = new BLQuestions(); objDCSections = new DCSections(); if (Session["UserLogon"] != null) { DCUsers objDCUsers = (DCUsers)Session["UserLogon"]; lstDCQuestions = objBLQuestions.GetQuestions(Convert.ToInt32(strQuestionID)); } var result = Json(lstDCQuestions, JsonRequestBehavior.AllowGet); result.MaxJsonLength = int.MaxValue; return(result); }
/// <summary> ///This method is used for Get Questions /// </summary> /// <returns></returns> public JsonResult GetQuestionsBySectionId(int SectionId) { lstDCQuestions = new List <DCQuestions>(); objBLQuestions = new BLQuestions(); objDCSections = new DCSections(); if (Session["UserLogon"] != null) { DCUsers objDCUsers = (DCUsers)Session["UserLogon"]; lstDCQuestions = objBLQuestions.GetQuestionsBySectionId(SectionId, objDCUsers.UserId); } var result = Json(lstDCQuestions, JsonRequestBehavior.AllowGet); result.MaxJsonLength = int.MaxValue; return(result); }
/// <summary> /// This method is used for Add Update CAPA Details /// </summary> /// <param name="objDCCAPADetails"></param> /// <returns></returns> /// public ActionResult AddUpdateCAPADetails(FormCollection frmColl, string mitigationData) { objDCUsers = (DCUsers)Session["UserLogon"]; objDataOperationResponse = new DataOperationResponse(); if (Session["UserLogon"] != null) { objDCCAPADetails = new DCCAPADetails(); objDCCAPADetails.AssessmentTypeId = string.IsNullOrEmpty(frmColl["hdnAssessmentTypesId"]) ? 0 : Convert.ToInt32(frmColl["hdnAssessmentTypesId"]); objDCCAPADetails.RiskScoreId = string.IsNullOrEmpty(frmColl["hdnRiskScoreId"]) ? 0 : Convert.ToInt32(frmColl["hdnRiskScoreId"]); objDCCAPADetails.SectionId = string.IsNullOrEmpty(frmColl["hdnSectionId"]) ? 0 : Convert.ToInt32(frmColl["hdnSectionId"]); objDCCAPADetails.CAPADetailsId = string.IsNullOrEmpty(frmColl["hdnCAPADetailsId"]) ? 0 : Convert.ToInt32(frmColl["hdnCAPADetailsId"]); objDCCAPADetails.ConfirmationOfComplianceImprovement = frmColl["ddlConfirmationOfComplianceImprovement"]; objDCCAPADetails.Impact = frmColl["ddlImpact"]; StringBuilder objStrBuilder = new StringBuilder(); if (!string.IsNullOrEmpty(frmColl["ddlMitigation"])) { string[] strMitigationIds = frmColl["ddlMitigation"].Split(','); objStrBuilder.Append("<MitigationIds>"); foreach (string MitigationId in strMitigationIds) { objStrBuilder.Append("<MitigationId>" + Convert.ToInt32(MitigationId) + "</MitigationId>"); } objStrBuilder.Append("</MitigationIds>"); } objDCCAPADetails.Mitigation = Convert.ToString(objStrBuilder); objDCCAPADetails.RiskCriteria = frmColl["ddlRiskCriteria"]; objDCCAPADetails.RiskCriteriaDescription = frmColl["ddlRiskCriteriaDescription"]; objBLCAPADetails = new BLCAPADetails(); objDCCAPADetails.CreatedBy = objDCUsers.UserId; objDataOperationResponse = objBLCAPADetails.AddUpdateCAPADetails(objDCCAPADetails); if (objDataOperationResponse.Code > 0) { TempData["successMessage"] = objDataOperationResponse.Message; return(Redirect("~/CAPADetails/ViewCapaDetails")); } else { TempData["errorMessage"] = objDataOperationResponse.Message; return(View("ViewCapaDetails")); } } else { return(Redirect("~/Account/Login")); } }
/// <summary> /// Author : Satish /// Description : GetUsers() this method used to get all the users from DataBase /// Date : 07/09/2016 /// </summary> /// <returns></returns> public List <DCUsers> GetUsers(int intEmpId) { objDatabaseHelper = new DatabaseHelper(); objDCUsers = new DCUsers(); lstDCUsers = new List <DCUsers>(); try { objDatabaseHelper.AddParameter("pUserId", intEmpId == 0 ? DBNull.Value : (object)intEmpId); DbDataReader reader = objDatabaseHelper.ExecuteReader(BLDBRoutines.SP_GETUSERS, CommandType.StoredProcedure); if (reader.HasRows) { while (reader.Read()) { objDCUsers = new DCUsers(); objDCUsers.UserId = reader.IsDBNull(reader.GetOrdinal("UserID")) ? 0 : reader.GetInt32(reader.GetOrdinal("UserID")); objDCUsers.AssessmentType = reader.IsDBNull(reader.GetOrdinal("AssessmentTypeId")) ? string.Empty : reader.GetString(reader.GetOrdinal("AssessmentTypeId")); objDCUsers.FirstName = reader.IsDBNull(reader.GetOrdinal("FirstName")) ? string.Empty : reader.GetString(reader.GetOrdinal("FirstName")); objDCUsers.LastName = reader.IsDBNull(reader.GetOrdinal("LastName")) ? string.Empty : reader.GetString(reader.GetOrdinal("LastName")); objDCUsers.EmailAddress = reader.IsDBNull(reader.GetOrdinal("EmailAddress")) ? string.Empty : reader.GetString(reader.GetOrdinal("EmailAddress")); objDCUsers.ClientName = reader.IsDBNull(reader.GetOrdinal("ClientName")) ? string.Empty : reader.GetString(reader.GetOrdinal("ClientName")); objDCUsers.SponserName = reader.IsDBNull(reader.GetOrdinal("SponserName")) ? string.Empty : reader.GetString(reader.GetOrdinal("SponserName")); objDCUsers.ProtocalName = reader.IsDBNull(reader.GetOrdinal("ProtocalName")) ? string.Empty : reader.GetString(reader.GetOrdinal("ProtocalName")); objDCUsers.Status = reader.IsDBNull(reader.GetOrdinal("Status")) ? string.Empty : reader.GetString(reader.GetOrdinal("Status")); objDCUsers.SponsorApproval = reader.IsDBNull(reader.GetOrdinal("SponsorApproval")) ? string.Empty : reader.GetString(reader.GetOrdinal("SponsorApproval")); if (reader.IsDBNull(reader.GetOrdinal("ExpiryDate")) == false) { objDCUsers.ExpiryDate = reader.GetDateTime(reader.GetOrdinal("ExpiryDate")); } lstDCUsers.Add(objDCUsers); } } return(lstDCUsers); } catch (Exception exc) { throw exc; } finally { if (objDatabaseHelper != null) { objDatabaseHelper.Dispose(); } } }
/// <summary> /// Forgot Password /// </summary> /// <returns></returns> public List <DCUsers> ForgotPassword(string strEmailAddress) { lstDCUsers = new List <DCUsers>(); objDataOperationResponse = new DataOperationResponse(); objDatabaseHelper = new DatabaseHelper(); try { objDCUsers = new DCUsers(); objDatabaseHelper.AddParameter("pEmailAddress", strEmailAddress); DbDataReader reader = objDatabaseHelper.ExecuteReader(BLDBRoutines.SP_FORGOTPASSWORD, CommandType.StoredProcedure);; if (reader.HasRows) { while (reader.Read()) { objDCUsers.FirstName = reader.IsDBNull(reader.GetOrdinal("FirstName")) ? string.Empty : reader.GetString(reader.GetOrdinal("FirstName")); objDCUsers.LastName = reader.IsDBNull(reader.GetOrdinal("LastName")) ? string.Empty : reader.GetString(reader.GetOrdinal("LastName")); objDCUsers.UserId = reader.IsDBNull(reader.GetOrdinal("UserId")) ? 0 : reader.GetInt32(reader.GetOrdinal("UserId")); objDCUsers.EmailAddress = reader.IsDBNull(reader.GetOrdinal("EmailAddress")) ? string.Empty : reader.GetString(reader.GetOrdinal("EmailAddress")); if (reader.IsDBNull(reader.GetOrdinal("ExpiryDate")) == false) { objDCUsers.ExpiryDate = reader.GetDateTime(reader.GetOrdinal("ExpiryDate")); } lstDCUsers.Add(objDCUsers); } objDCUsers.Code = GetSuccessCode; } else { objDCUsers.Code = GetErrorCode; } return(lstDCUsers); } catch (Exception exce) { throw exce; } finally { if (objDatabaseHelper != null) { objDatabaseHelper.Dispose(); } } }
/// <summary> /// This method is used for Add Update Sections /// </summary> /// <param name="strSectionName"></param> /// <param name="hdnSectionId"></param> /// <param name="strSectionNumber"></param> /// <returns></returns> public string AddUpdateSections(string strSectionName, string hdnSectionId, string strSectionNumber, string strAssessmentType, string strDescription, string strCritical) { objBLSections = new BLSections(); objDCSections = new DCSections(); if (Session["UserLogon"] != null) { DCUsers objDCUsers = (DCUsers)Session["UserLogon"]; objDCSections.SectionName = strSectionName; objDCSections.CreatedBy = objDCUsers.UserId; objDCSections.SectionNumber = strSectionNumber; objDCSections.AssessmentTypeId = Convert.ToInt32(strAssessmentType); objDCSections.SectionId = string.IsNullOrEmpty(hdnSectionId) ? 0 : Convert.ToInt32(hdnSectionId); objDCSections.Description = strDescription; objDCSections.Critical = strCritical; objDataOperationResponse = objBLSections.AddUpdateSections(objDCSections); } return(objDataOperationResponse.Message); }
public List <DCUsers> GetVersionsByProtocolId(int ClientDetailsId, int SponserDetailsId, int ProtocalDetailsId) { objDatabaseHelper = new DatabaseHelper(); objDCUsers = new DCUsers(); lstDCUsers = new List <DCUsers>(); try { objDatabaseHelper.AddParameter("pClientDetailsId", ClientDetailsId == 0 ? DBNull.Value : (object)ClientDetailsId); objDatabaseHelper.AddParameter("pSponserDetailsId", SponserDetailsId == 0 ? DBNull.Value : (object)SponserDetailsId); objDatabaseHelper.AddParameter("pProtocalDetailsId", ProtocalDetailsId == 0 ? DBNull.Value : (object)ProtocalDetailsId); DbDataReader reader = objDatabaseHelper.ExecuteReader(BLDBRoutines.SP_GETVERSIONSBYPROTOCOLID, CommandType.StoredProcedure); if (reader.HasRows) { while (reader.Read()) { objDCUsers = new DCUsers(); objDCUsers.UserId = reader.IsDBNull(reader.GetOrdinal("UserId")) ? 0 : reader.GetInt32(reader.GetOrdinal("UserId")); objDCUsers.VersionName = reader.IsDBNull(reader.GetOrdinal("VersionName")) ? string.Empty : reader.GetString(reader.GetOrdinal("VersionName")); objDCUsers.AddAssesment = reader.IsDBNull(reader.GetOrdinal("AddAssesment")) ? string.Empty : reader.GetString(reader.GetOrdinal("AddAssesment")); objDCUsers.AssessmentType = reader.IsDBNull(reader.GetOrdinal("AssessmentType")) ? string.Empty : reader.GetString(reader.GetOrdinal("AssessmentType")); objDCUsers.VersionNo = reader.IsDBNull(reader.GetOrdinal("VersionNo")) ? 0 : reader.GetInt32(reader.GetOrdinal("VersionNo")); objDCUsers.AssessmentTypeAbbr = reader.IsDBNull(reader.GetOrdinal("AssessmentTypeAbbr")) ? string.Empty : reader.GetString(reader.GetOrdinal("AssessmentTypeAbbr")); objDCUsers.AssessmentTypeId = reader.IsDBNull(reader.GetOrdinal("AssessmentTypeId")) ? 0 :reader.GetInt32(reader.GetOrdinal("AssessmentTypeId")); objDCUsers.ClientDetailsId = reader.IsDBNull(reader.GetOrdinal("ClientDetailsId")) ? 0 : reader.GetInt32(reader.GetOrdinal("ClientDetailsId")); objDCUsers.SponserDetailsId = reader.IsDBNull(reader.GetOrdinal("SponserDetailsId")) ? 0 : reader.GetInt32(reader.GetOrdinal("SponserDetailsId")); objDCUsers.ProtocalDetailsId = reader.IsDBNull(reader.GetOrdinal("ProtocalDetailsId")) ? 0 : reader.GetInt32(reader.GetOrdinal("ProtocalDetailsId")); lstDCUsers.Add(objDCUsers); } } return(lstDCUsers); } catch (Exception exec) { throw exec; } finally { if (objDatabaseHelper != null) { objDatabaseHelper.Dispose(); } } }
/// <summary> /// This method is used for Add Update Client Info /// </summary> /// <param name="frmColl"></param> /// <returns></returns> public ActionResult AddUpdateClientInfo(FormCollection frmColl) { if (Session["Userlogon"] != null) { objDCClientInfo = new DCClientInfo(); lstDCClientInfo = new List <DCClientInfo>(); if (!string.IsNullOrEmpty(frmColl["btnSave"])) { objDataOperationResponse = new DataOperationResponse(); objBLClientInfo = new BLClientInfo(); objDCUsers = (DCUsers)Session["UserLogon"]; objDCClientInfo.ClientId = string.IsNullOrEmpty(frmColl["hdnClientId"]) ? 0 : Convert.ToInt32(frmColl["hdnClientId"]); objDCClientInfo.FirstName = frmColl["txtCCFirstName"]; objDCClientInfo.LastName = frmColl["txtCCLastName"]; objDCClientInfo.ContactTitle = frmColl["txtContactTitle"]; objDCClientInfo.EmailAddress = frmColl["txtEmail"]; objDCClientInfo.CompanyName = frmColl["txtCompanyName"]; objDCClientInfo.Addressline1 = frmColl["txtAddress1"]; objDCClientInfo.Addressline2 = frmColl["txtAddress2"]; objDCClientInfo.Addressline3 = frmColl["txtAddress3"]; objDCClientInfo.CityProvince = frmColl["txtCityProvince"]; objDCClientInfo.Country = frmColl["txtCountry"]; objDCClientInfo.State = frmColl["txtState"]; objDCClientInfo.ZipCode = frmColl["txtZipCode"]; objDCClientInfo.OfficePhone = frmColl["txtOfficePhone"]; objDCClientInfo.MobilePhone = frmColl["txtMobilePhone"]; objDCClientInfo.UserId = objDCUsers.UserId; lstDCClientInfo = objBLClientInfo.AddUpdateClientInfo(objDCClientInfo); TempData["activetab"] = "1"; if (lstDCClientInfo.Count > 0) { TempData["successMessage"] = objDCClientInfo.ClientId == 0 ? "Client Details Added Succesfully" : "Client Details Updated Successfully"; } return(View(lstDCClientInfo[0])); } } else { return(Redirect("~/Account/Login")); } return(View(new DCClientInfo())); }
/// <summary> /// Author : Satish /// Description : AddUpdateEmployee this method used to add or update the Employees /// Date : 07/09/2016 /// </summary> /// <returns></returns> public DataOperationResponse AddUpdateUser(DCUsers objDCUsers, string XMLData) { try { objDatabaseHelper = new DatabaseHelper(); objDataOperationResponse = new DataOperationResponse(); objDatabaseHelper.AddParameter("pUserId", objDCUsers.UserId == 0 ? DBNull.Value : (object)objDCUsers.UserId); objDatabaseHelper.AddParameter("pFirstName", string.IsNullOrEmpty(objDCUsers.FirstName) ? DBNull.Value : (object)objDCUsers.FirstName); objDatabaseHelper.AddParameter("pLastName", string.IsNullOrEmpty(objDCUsers.LastName) ? DBNull.Value : (object)objDCUsers.LastName); objDatabaseHelper.AddParameter("pEmailAddress", string.IsNullOrEmpty(objDCUsers.EmailAddress) ? DBNull.Value : (object)objDCUsers.EmailAddress); objDatabaseHelper.AddParameter("pUserPassword", string.IsNullOrEmpty(objDCUsers.LastName) ? DBNull.Value : (object)objDCUsers.LastName); objDatabaseHelper.AddParameter("pExpiryDate", objDCUsers.ExpiryDate == null ? DBNull.Value : (object)objDCUsers.ExpiryDate); objDatabaseHelper.AddParameter("pUserAssessmentXMLData", string.IsNullOrEmpty(XMLData) ? DBNull.Value : (object)XMLData); objDatabaseHelper.AddParameter("pClientName", string.IsNullOrEmpty(objDCUsers.ClientName) ? DBNull.Value : (object)objDCUsers.ClientName); objDatabaseHelper.AddParameter("pSponserName", string.IsNullOrEmpty(objDCUsers.SponserName) ? DBNull.Value : (object)objDCUsers.SponserName); objDatabaseHelper.AddParameter("pProtocalName", string.IsNullOrEmpty(objDCUsers.ProtocalName) ? DBNull.Value : (object)objDCUsers.ProtocalName); objDatabaseHelper.AddParameter("pClientNameAbbr", string.IsNullOrEmpty(objDCUsers.ClientNameAbbr) ? DBNull.Value : (object)objDCUsers.ClientNameAbbr); objDatabaseHelper.AddParameter("pSponserNameAbbr", string.IsNullOrEmpty(objDCUsers.SponserNameAbbr) ? DBNull.Value : (object)objDCUsers.SponserNameAbbr); objDatabaseHelper.AddParameter("pProtocalNameAbbr", string.IsNullOrEmpty(objDCUsers.ProtocolNameAbbr) ? DBNull.Value : (object)objDCUsers.ProtocolNameAbbr); objDatabaseHelper.AddParameter("pSponsorApproval", string.IsNullOrEmpty(objDCUsers.SponsorApproval) ? DBNull.Value : (object)objDCUsers.SponsorApproval); objDatabaseHelper.AddParameter("oRegisterMessage", string.Empty, ParameterDirection.Output); int result = objDatabaseHelper.ExecuteNonQuery(BLDBRoutines.SP_ADDUPDATEUSERS, CommandType.StoredProcedure); string strMessage = Convert.ToString(objDatabaseHelper.Command.Parameters["oRegisterMessage"].Value); if (result >= 0 && strMessage.Contains("success")) { objDataOperationResponse.Code = GetSuccessCode; objDataOperationResponse.Message = strMessage; } else { objDataOperationResponse.Code = GetErrorCode; objDataOperationResponse.Message = strMessage; } } catch (Exception exce) { throw exce; } return(objDataOperationResponse); }
public ActionResult UploadLogo(FormCollection frmcol, HttpPostedFileBase fleUpload) { objDCClientInfo = new DCClientInfo(); objBLClientInfo = new BLClientInfo(); objDCUsers = (DCUsers)Session["UserLogon"]; objDataOperationResponse = new DataOperationResponse(); objDCClientInfo.UserId = objDCUsers.UserId; objDCClientInfo.ClientUploadId = string.IsNullOrEmpty(frmcol["hdnClientUploadId"]) ? 0 : Convert.ToInt32(frmcol["hdnClientUploadId"]); objDCClientInfo.Description = frmcol["txtDescription"]; if (frmcol["btnLogoSave"] == "Save") { objDCClientInfo.FileType = "Logo"; } else { objDCClientInfo.FileType = "Document"; } if (fleUpload != null && fleUpload.ContentLength > 0) { //Save to folder string UniqueFileName = Guid.NewGuid() + "-" + Path.GetFileName(fleUpload.FileName); string path = Path.Combine(Server.MapPath("~/Uploads/LogoUpload/"), UniqueFileName); var FileVirtualPath = "/Uploads/LogoUpload/" + UniqueFileName; fleUpload.SaveAs(path); //Save to database objDCClientInfo.UploadLogo = FileVirtualPath; } objDataOperationResponse = objBLClientInfo.UploadLogo(objDCClientInfo); TempData["activetab"] = "2"; if (objDataOperationResponse.Code > 0) { TempData["successMessage"] = objDataOperationResponse.Message; return(RedirectToAction("AddUpdateClientInfo")); } else { TempData["errorMessage"] = objDataOperationResponse.Message; return(RedirectToAction("AddUpdateClientInfo")); } }
/// <summary> /// 创建用户名 /// </summary> /// <param name="id">编号</param> /// <param name="name">用户名</param> /// <param name="nickName">昵称</param> /// <param name="email">邮箱</param> /// <param name="passwordVersion">密码版本</param> /// <param name="password">密码</param> /// <param name="salt">盐值</param> /// <param name="description">描述</param> /// <param name="isSystemAdministrator">是否系统管理员</param> /// <param name="creationTime">创建时间</param> /// <param name="creatId">创建人编号</param> /// <param name="lastModifiTime">最后修改时间</param> /// <param name="lastModifiId">最后修改人编号</param> /// <param name="isDeleted">软删除,数据不会被物理删除</param> /// <param name="version">处理并发问题</param> public static DCUsers Create( long id, string name, string nickName, string email, short?passwordVersion, string password, string salt, string description, bool?isSystemAdministrator, DateTime?creationTime, int?creatId, DateTime?lastModifiTime, int?lastModifiId, bool isDeleted, Byte[] version ) { DCUsers result; result = new DCUsers(id); result.Name = name; result.NickName = nickName; result.Email = email; result.PasswordVersion = passwordVersion; result.Password = password; result.Salt = salt; result.Description = description; result.IsSystemAdministrator = isSystemAdministrator; result.CreationTime = creationTime; result.CreatId = creatId; result.LastModifiTime = lastModifiTime; result.LastModifiId = lastModifiId; result.IsDeleted = isDeleted; result.Version = version; return(result); }
/// <summary> /// 转换为用户名持久化对象 /// </summary> /// <param name="entity">用户名实体</param> private static DCUsersPo ToPo2(this DCUsers entity) { if (entity == null) { return(null); } return(new DCUsersPo { Id = entity.Id, Name = entity.Name, NickName = entity.NickName, Email = entity.Email, PasswordVersion = entity.PasswordVersion, Password = entity.Password, Salt = entity.Salt, Description = entity.Description, IsSystemAdministrator = entity.IsSystemAdministrator, CreationTime = entity.CreationTime, CreatId = entity.CreatId, LastModifiTime = entity.LastModifiTime, LastModifiId = entity.LastModifiId, IsDeleted = entity.IsDeleted, Version = entity.Version, }); }