public int?AddEdit(int?pageId, string languageCode, string menuName, string metaTagTitle, string metaTagKeywords, string metaTagDescription, string robots, string htmlCode) { int?result; using (AdoHelper db = new AdoHelper()) { var returnValue = db.CreateParamReturnValue("returnValue"); string lastInsertedId = db.ExecScalarProc("sp_cms_pages_languages_insert_update", "@PageId", pageId, "@LanguageCode", languageCode, "@MenuName", menuName, "@MetaTagTitle", metaTagTitle, "@MetaTagKeywords", metaTagKeywords, "@MetaTagDescription", metaTagDescription, "@Robots", robots, "@HtmlCode", htmlCode, returnValue).ConvertTo <string>(string.Empty, true); result = db.GetParamReturnValue(returnValue); if (result == 0) { _AllItems = GetAllItems(true); } return(result); } }
public bool CheckLoanExisted(int grouID, int slAHID, string loanNumber) { bool IsLoanExisted = false; AdoHelper objAdo = new AdoHelper(); SqlParameter[] parms = new SqlParameter[3]; parms[0] = new SqlParameter("@GroupID", grouID); parms[0].SqlDbType = System.Data.SqlDbType.Int; parms[1] = new SqlParameter("@slAHID", slAHID); parms[1].SqlDbType = System.Data.SqlDbType.Int; parms[2] = new SqlParameter("@loanNumber", loanNumber); parms[2].SqlDbType = System.Data.SqlDbType.VarChar; parms[2].Direction = ParameterDirection.Output; int LoanExisted = Convert.ToInt32(objAdo.ExecScalarProc("uspCheckBankLoanExisted", parms)); loanNumber = Convert.ToString(parms[2].Value); if (LoanExisted == 1) { IsLoanExisted = true; } return(IsLoanExisted); }
/// <summary> /// /// </summary> /// <param name="HTGroupName"></param> /// <param name="SelectedRecords"></param> /// <returns></returns> public HttpResponseMessage Get(string GroupName, string SelectedRecords, string GroupType) { // dynamic ds = null; // bool isSuccess = false; try { CurrentUser user = ApiUser; AdoHelper ado = new AdoHelper(); SqlParameter param1 = new SqlParameter("@SelectedRecords", SelectedRecords); SqlParameter param2 = new SqlParameter("@GroupName", GroupName); SqlParameter param3 = new SqlParameter("@GroupType", GroupType); //if (recId in SelectedRecords ) ado.ExecScalarProc("RNDGroupName_Insert", "RND", new object[] { param1, param2, param3 }); // ado.ExecScalarProc("RNDGroupName_Insert", "RND", new object[] { param1, param3 }); } catch (Exception ex) { _logger.Error(ex.Message); return(new HttpResponseMessage(HttpStatusCode.InternalServerError)); } return(Serializer.ReturnContent(HttpStatusCode.OK, this.Configuration.Services.GetContentNegotiator(), this.Configuration.Formatters, this.Request)); }
public int?AddEdit(int?newsId, DateTime?newsDate, string userName, bool?isActive, int?categoryId, string mainImageFilePath, string languageCode, string newsTitle, string newsContent, out int?lastInsertedId) { int?result; using (AdoHelper db = new AdoHelper()) { var returnValue = db.CreateParamReturnValue("returnValue"); lastInsertedId = db.ExecScalarProc("sp_cms_news_insert_update", "@NewsId", newsId, "@NewsDate", newsDate, "@UserName", userName, "@IsActive", isActive, "@CategoryId", categoryId, "@MainImageFilePath", mainImageFilePath, "@LanguageCode", languageCode, "@NewsTitle", newsTitle, "@NewsContent", newsContent, returnValue).ConvertTo <int?>(null, true); result = db.GetParamReturnValue(returnValue); if (result == 0) { _AllItems = GetAllItems(true); } return(result); } }
/// <summary> /// Update the existing register user details /// </summary> /// <param name="login"></param> /// <returns></returns> public HttpResponseMessage Put(RNDLogin login) { try { if (login != null) { AdoHelper ado = new AdoHelper(); CurrentUser user = ApiUser; SqlParameter param1 = new SqlParameter("@UserId", login.UserId); SqlParameter param2 = new SqlParameter("@FirstName", login.FirstName); SqlParameter param3 = new SqlParameter("@LastName", login.LastName); SqlParameter param4 = new SqlParameter("@UserType", login.UserType); SqlParameter param5 = new SqlParameter("@PermissionLevel", login.PermissionLevel); var id = ado.ExecScalarProc("RNDLogin_Update", "RND", new object[] { param1, param2, param3, param4, param5 }); return(Serializer.ReturnContent(MessageConstants.UserRegistered, this.Configuration.Services.GetContentNegotiator(), this.Configuration.Formatters, this.Request)); } } catch (Exception ex) { _logger.Error(ex.Message); return(new HttpResponseMessage(HttpStatusCode.InternalServerError)); } return(Serializer.ReturnContent(HttpStatusCode.NotImplemented, this.Configuration.Services.GetContentNegotiator(), this.Configuration.Formatters, this.Request)); }
public HttpResponseMessage Get(string UserName, string UserAnswer) { // SqlDataReader reader = null; RNDLogin dbUser = null; ApiViewModel VM = null; try { VM = new ApiViewModel(); if (!string.IsNullOrEmpty(UserName) && !string.IsNullOrEmpty(UserAnswer)) { AdoHelper ado = new AdoHelper(); SqlParameter param1 = new SqlParameter("@UserName", UserName); SqlParameter param2 = new SqlParameter("@UserAnswer", UserAnswer); using (SqlDataReader reader = ado.ExecDataReaderProc("RNDResetPassword", "RND", new object[] { param1, param2 })) { if (reader.HasRows && reader.Read()) { dbUser = new RNDLogin(); dbUser.UserId = Convert.ToInt32(reader["UserId"]); dbUser.FirstName = Convert.ToString(reader["FirstName"]); dbUser.LastName = Convert.ToString(reader["LastName"]); dbUser.UserType = Convert.ToString(reader["UserType"]); dbUser.PermissionLevel = Convert.ToString(reader["PermissionLevel"]); dbUser.IssueDate = (!string.IsNullOrEmpty(reader["IssueDate"].ToString())) ? Convert.ToDateTime(reader["IssueDate"]) : (DateTime?)null; dbUser.CreatedBy = Convert.ToInt32(reader["CreatedBy"]); dbUser.CreatedOn = Convert.ToDateTime(reader["CreatedOn"]); dbUser.StatusCode = Convert.ToString(reader["StatusCode"]); VM.Custom = dbUser; string token = Guid.NewGuid().ToString("D") + Guid.NewGuid().ToString("D"); dbUser.UserName = UserName; dbUser.Token = token; VM.Custom = dbUser; ado = new AdoHelper(); SqlParameter param3 = new SqlParameter("@UserId", dbUser.UserId); SqlParameter param4 = new SqlParameter("@Token", token); ado.ExecScalarProc("RNDSecurityTokens_Insert", "RND", new object[] { param3, param4 }); } else { VM.Message = MessageConstants.InvalidUser; } if (ado._conn != null && ado._conn.State == System.Data.ConnectionState.Open) { ado._conn.Close(); ado._conn.Dispose(); } } } } catch (Exception ex) { _logger.Error(ex.Message); return(new HttpResponseMessage(HttpStatusCode.InternalServerError)); } return(Serializer.ReturnContent(VM, this.Configuration.Services.GetContentNegotiator(), this.Configuration.Formatters, this.Request)); }
/// <summary> /// Save the new register user details /// </summary> /// <param name="login"></param> /// <returns></returns> public HttpResponseMessage Post(RNDLogin login) { try { if (login != null) { bool exists = CheckIfUserExists(login.UserName); if (exists) { return(Serializer.ReturnContent("UserName already exists.", this.Configuration.Services.GetContentNegotiator(), this.Configuration.Formatters, this.Request)); } AdoHelper ado = new AdoHelper(); string strCurrentDate = DateTime.Now.ToString(); byte[] passwordSalt = Encryptor.EncryptText(strCurrentDate, login.UserName); string se = Convert.ToBase64String(passwordSalt); byte[] passwordHash = Encryptor.GenerateHash(login.Password, se.ToString()); login.IsSecurityApplied = true; login.PasswordHash = passwordHash; login.PasswordSalt = passwordSalt; login.CreatedOn = DateTime.Now; CurrentUser user = ApiUser; int UserID = 1; string DefaultStatus = "A"; SqlParameter param1 = new SqlParameter("@UserName", login.UserName); SqlParameter param2 = new SqlParameter("@FirstName", login.FirstName); SqlParameter param3 = new SqlParameter("@LastName", login.LastName); SqlParameter param4 = new SqlParameter("@PasswordHash", login.PasswordHash); SqlParameter param5 = new SqlParameter("@PasswordSalt", login.PasswordSalt); // SqlParameter param6 = new SqlParameter("@UserType", login.UserType); SqlParameter param6 = new SqlParameter("@UserType", login.PermissionLevel); SqlParameter param7 = new SqlParameter("@PermissionLevel", login.PermissionLevel); if (user != null) { UserID = user.UserId; DefaultStatus = "DR"; } SqlParameter param8 = new SqlParameter("@CreatedBy", UserID); SqlParameter param9 = new SqlParameter("@CreatedOn", DateTime.Now); // SqlParameter param10 = new SqlParameter("@StatusCode", "DR"); SqlParameter param10 = new SqlParameter("@StatusCode", DefaultStatus); var id = ado.ExecScalarProc("RNDLogin_Insert", "RND", new object[] { param1, param2, param3, param4, param5, param6, param7, param8, param9, param10 }); if (id != null) { login.UserId = Convert.ToInt32(id); return(Serializer.ReturnContent(MessageConstants.UserRegistered, this.Configuration.Services.GetContentNegotiator(), this.Configuration.Formatters, this.Request)); } } } catch (Exception ex) { _logger.Error(ex.Message); return(new HttpResponseMessage(HttpStatusCode.InternalServerError)); } return(Serializer.ReturnContent(HttpStatusCode.NotImplemented, this.Configuration.Services.GetContentNegotiator(), this.Configuration.Formatters, this.Request)); }
public int Add(KeHoachCT keHoachCT) { const string storeName = "st_InsertKeHoachCT"; const string storeNameThamDu = "st_InsertThamDu"; int idKeHoach = 0; using (var conn = new AdoHelper()) { conn.BeginTransaction(); SqlParameter[] objectParam = new SqlParameter[] { new SqlParameter("@TenKeHoach", keHoachCT.TenKeHoach), new SqlParameter("@UserName", keHoachCT.UserName), new SqlParameter("@TuNgay", keHoachCT.TuNgayModel), new SqlParameter("@TuGio", keHoachCT.TuGio), new SqlParameter("@DenGio", keHoachCT.DenGio), new SqlParameter("@CaNgay", keHoachCT.CaNgay), new SqlParameter("@DenNgay", keHoachCT.DenNgayModel), new SqlParameter("@KeHoachCongTac", keHoachCT.KeHoachCongTac), new SqlParameter("@DiaDiem", keHoachCT.DiaDiem), new SqlParameter("@MucDo", keHoachCT.MucDo), new SqlParameter("@LapLai", keHoachCT.LapLai), new SqlParameter("@Deadline", keHoachCT.Deadline), new SqlParameter("@Type", keHoachCT.Type), }; idKeHoach = int.Parse(conn.ExecScalarProc(storeName, objectParam).ToString()); if (keHoachCT.ThamDu != null && (keHoachCT.ThamDu.Count() > 0)) { foreach (var item in keHoachCT.ThamDu) { SqlParameter[] objectThamDu = new SqlParameter[] { new SqlParameter("@IdKeHoach", idKeHoach), new SqlParameter("@NguoiThamDu", item), new SqlParameter("@Kieu", 1),//Tham du }; conn.ExecNonQueryProc(storeNameThamDu, objectThamDu); } } if (keHoachCT.ChuTri != null && (keHoachCT.ChuTri.Count() > 0)) { foreach (var item in keHoachCT.ChuTri) { SqlParameter[] objectThamDu = new SqlParameter[] { new SqlParameter("@IdKeHoach", idKeHoach), new SqlParameter("@NguoiThamDu", item), new SqlParameter("@Kieu", 2),//Chu Tri }; conn.ExecNonQueryProc(storeNameThamDu, objectThamDu); } } conn.Commit(); } return(idKeHoach); }
public bool CheckUserName(string userName) { const string storeName = "st_checkUserName"; using (var conn = new AdoHelper()) { SqlParameter[] objectParam = new SqlParameter[] { new SqlParameter("@UserName", userName) }; return(conn.ExecScalarProc(storeName, objectParam).ToString() == "1"); } }
// POST: api/WorkStudylist public HttpResponseMessage Post(RNDWorkStudy workStudy) { string data = string.Empty; try { CurrentUser user = ApiUser; AdoHelper ado = new AdoHelper(); SqlParameter param1 = new SqlParameter("@WorkStudyID", workStudy.WorkStudyID); SqlParameter param2 = new SqlParameter("@StudyType", workStudy.StudyType); //SqlParameter param3 = new SqlParameter("@StudyTitle", workStudy.StudyTitle); SqlParameter param4 = new SqlParameter("@StudyDesc", workStudy.StudyDesc); SqlParameter param5 = new SqlParameter("@PlanOSCost", workStudy.PlanOSCost); SqlParameter param6 = new SqlParameter("@AcctOSCost", workStudy.AcctOSCost); SqlParameter param7 = new SqlParameter("@StudyStatus", workStudy.StudyStatus); SqlParameter param8 = new SqlParameter("@StartDate", workStudy.StartDate); SqlParameter param9 = new SqlParameter("@DueDate", workStudy.DueDate); SqlParameter param10 = new SqlParameter("@CompleteDate", workStudy.CompleteDate); SqlParameter param11 = new SqlParameter("@Plant", workStudy.Plant); SqlParameter param12 = new SqlParameter("@EntryBy", user.UserId); SqlParameter param13 = new SqlParameter("@EntryDate", DateTime.Now); SqlParameter param14 = new SqlParameter("@TempID", workStudy.TempID); if (workStudy.RecId > 0) { SqlParameter param15 = new SqlParameter("@RecId", workStudy.RecId); ado.ExecScalarProc("RNDWorkStudy_Update", new object[] { param1, param2, param4, param5, param6, param7, param8, param9, param10, param11, param12, param13, param14, param15 }); } else { ado.ExecScalarProc("RNDWorkStudy_Insert", new object[] { param1, param2, param4, param5, param6, param7, param8, param9, param10, param11, param12, param13, param14 }); } } catch (Exception ex) { _logger.Error(ex.Message); return(new HttpResponseMessage(HttpStatusCode.InternalServerError)); } return(Serializer.ReturnContent(workStudy, this.Configuration.Services.GetContentNegotiator(), this.Configuration.Formatters, this.Request)); }
public int CheckDatPhong(Phong phong) { const string storeName = "st_CheckDatPhong"; using (var conn = new AdoHelper()) { SqlParameter[] objectParam = new SqlParameter[] { new SqlParameter("@MaPhong", phong.Id), new SqlParameter("@TuGio", phong.TuGio), new SqlParameter("@DenGio", phong.DenGio), new SqlParameter("@Ngay", phong.Ngay) }; return(Int32.Parse(conn.ExecScalarProc(storeName, objectParam).ToString())); } }
public int GetCountListKeHoachCaNhan(JQueryDataTableParamModel param) { const string storeName = "st_getCountListKeHoachCaNhan"; using (var conn = new AdoHelper()) { SqlParameter[] objectParam = new SqlParameter[] { new SqlParameter("@Search", param.sSearch), new SqlParameter("@UserName", param.CanBo), new SqlParameter("@StartDate", param.StartDate), new SqlParameter("@EndDate", param.EndDate), }; return(int.Parse(conn.ExecScalarProc(storeName, objectParam).ToString())); } }
/// <summary> /// Delete the register user details /// </summary> /// <param name="id"></param> /// <returns></returns> public HttpResponseMessage Delete(int id) { try { CurrentUser user = ApiUser; AdoHelper ado = new AdoHelper(); SqlParameter param1 = new SqlParameter("@UserId", id); ado.ExecScalarProc("RNDLogin_Delete", "RND", new object[] { param1 }); } catch (Exception ex) { _logger.Error(ex.Message); return(new HttpResponseMessage(HttpStatusCode.InternalServerError)); } return(Serializer.ReturnContent(HttpStatusCode.OK, this.Configuration.Services.GetContentNegotiator(), this.Configuration.Formatters, this.Request)); }
public int?Edit(int pageTemplateId, string title, string htmlCode, bool isActive) { int?result; using (AdoHelper db = new AdoHelper()) { var returnValue = db.CreateParamReturnValue("returnValue"); string lastInsertedId = db.ExecScalarProc("sp_cms_page_templates_update", "@PageTemplateId", pageTemplateId, "@Title", title, "@HtmlCode", htmlCode, "@IsActive", isActive, returnValue).ConvertTo <string>(string.Empty, true); result = db.GetParamReturnValue(returnValue); if (result == 0) { _AllItems = GetAllItems(true); } } return(result); }
public static string UpdateAdmissionCriteria(AdmissionCriteria admissionCriteria) { AdoHelper objHelper = new AdoHelper(ConfigurationManager.ConnectionStrings["con"].ToString()); SqlParameter[] sqlParameter = { new SqlParameter("@SetAction", admissionCriteria.SetAction.ToUpper()), new SqlParameter("@CriteriaId", admissionCriteria.CriteriaId), new SqlParameter("@CriteriaDescription", admissionCriteria.CriteriaDescription) }; Object obj = objHelper.ExecScalarProc("Gkl_USP_UpdateAdmissionCriteria", sqlParameter); string status = "updated"; objHelper.Dispose(); return(status); }
public int?Add(string title, string description, string content, bool isActive) { int?result; using (AdoHelper db = new AdoHelper()) { var returnValue = db.CreateParamReturnValue("returnValue"); string lastInsertedId = db.ExecScalarProc("sp_cms_content_templates_insert", "@Title", title.Trim(), "@Description", description.Trim(), "@Content", content, "@IsActive", isActive, returnValue).ConvertTo <string>(string.Empty, true); result = db.GetParamReturnValue(returnValue); if (result == 0) { _AllItems = GetAllItems(true); } } return(result); }
public static string UpdateDegreeCategory(DegreeCategory degreeCategory) { AdoHelper objHelper = new AdoHelper(ConfigurationManager.ConnectionStrings["con"].ToString()); SqlParameter[] sqlParameter = { new SqlParameter("@SetAction", degreeCategory.SetAction.ToUpper()), new SqlParameter("@DegreeCategoryId", degreeCategory.DegreeCategoryId), new SqlParameter("@DegreeCategoryCode", degreeCategory.DegreeCategoryCode), new SqlParameter("@DegreeCategoryName ", degreeCategory.DegreeCategoryName) }; Object obj = objHelper.ExecScalarProc("Gkl_USP_UpdateDegreeCategory", sqlParameter); string status = "updated"; objHelper.Dispose(); return(status); }
public static string UpdateChapter(Chapter chapter) { AdoHelper objHelper = new AdoHelper(ConfigurationManager.ConnectionStrings["con"].ToString()); SqlParameter[] sqlParameter = { new SqlParameter("@SetAction", chapter.SetAction.ToUpper()), new SqlParameter("@ChapterId", chapter.ChapterId), new SqlParameter("@ChapterCode", chapter.ChapterCode), new SqlParameter("@ChapterName ", chapter.ChapterName) }; Object obj = objHelper.ExecScalarProc("Gkl_USP_UpdateChapter", sqlParameter); string status = "updated"; objHelper.Dispose(); return(status); }
public static string UpdateFeeType(FeeType feeType) { AdoHelper objHelper = new AdoHelper(ConfigurationManager.ConnectionStrings["con"].ToString()); SqlParameter[] sqlParameter = { new SqlParameter("@SetAction", feeType.SetAction.ToUpper()), new SqlParameter("@FeeTypeId", feeType.FeeTypeId), new SqlParameter("@FeeTypeName", feeType.FeeTypeName), new SqlParameter("@FeeTypeDescription ", feeType.FeeTypeDescription) }; Object obj = objHelper.ExecScalarProc("GKL_USP_UpdateFeeType", sqlParameter); string status = "updated"; objHelper.Dispose(); return(status); }
public static string InsUpdDelRole(Role role) { AdoHelper objHelper = new AdoHelper(ConfigurationManager.ConnectionStrings["con"].ToString()); SqlParameter[] sqlParameter = { new SqlParameter("@SetAction", role.SetAction.ToUpper()), new SqlParameter("@RoleId", role.RoleId), new SqlParameter("@RoleName", role.RoleName), new SqlParameter("@Active", role.Active) }; Object obj = objHelper.ExecScalarProc("GKL_USP_UpdateRoleMaster", sqlParameter); string status; status = "updated"; objHelper.Dispose(); return(status); }
public static string UpdateProgram(Program program) { AdoHelper objHelper = new AdoHelper(ConfigurationManager.ConnectionStrings["con"].ToString()); SqlParameter[] sqlParameter = { new SqlParameter("@SetAction", program.SetAction.ToUpper()), new SqlParameter("@ProgramId", program.ProgramId), new SqlParameter("@ProgramCode", program.ProgramCode), new SqlParameter("@ProgramName", program.ProgramName), new SqlParameter("@DegreeTypeId", program.DegreeTypeId), }; Object obj = objHelper.ExecScalarProc("Gkl_USP_UpdateProgram", sqlParameter); string strRes = (String)obj; objHelper.Dispose(); return(strRes); }
public static string UpdateBranch(Branch branch) { AdoHelper objHelper = new AdoHelper(ConfigurationManager.ConnectionStrings["con"].ToString()); SqlParameter[] sqlParameter = { new SqlParameter("@SetAction", branch.SetAction.ToUpper()), new SqlParameter("@BranchId", branch.BranchId), new SqlParameter("@BranchCode", branch.BranchCode), new SqlParameter("@BranchName ", branch.BranchName), new SqlParameter("@ProgramId ", branch.ProgramId) }; Object obj = objHelper.ExecScalarProc("Gkl_USP_UpdateBranch", sqlParameter); string status; status = "updated"; objHelper.Dispose(); return(status); }
public static string UpdateCourse(Course course) { AdoHelper objHelper = new AdoHelper(ConfigurationManager.ConnectionStrings["con"].ToString()); SqlParameter[] sqlParameter = { new SqlParameter("@SetAction", course.SetAction.ToUpper()), new SqlParameter("@CourseId", course.CourseId), new SqlParameter("@CourseCode", course.CourseCode), new SqlParameter("@CourseName ", course.CourseName), new SqlParameter("@CourseTypeId", course.CourseTypeId), new SqlParameter("@SemesterId", course.@SemesterId) }; Object obj = objHelper.ExecScalarProc("Gkl_USP_UpdateCourse", sqlParameter); string status; status = "updated"; objHelper.Dispose(); return(status); }
/// <summary> /// Retrieve the UAC details /// </summary> /// <param name="material"></param> /// <returns></returns> public HttpResponseMessage Post(RNDMaterial material) { ApiViewModel VM = null; try { CurrentUser user = ApiUser; VM = new ApiViewModel(); if (material != null && !string.IsNullOrEmpty(material.records)) // if (material.RecID > 0) { AdoHelper ado = new AdoHelper(); SqlParameter param1 = new SqlParameter("@Ids", material.records); SqlParameter param2 = new SqlParameter("@WorkStudyID", material.WorkStudyID); SqlParameter param3 = new SqlParameter("@SoNum", material.SoNum); SqlParameter param4 = new SqlParameter("@MillLotNo", material.MillLotNo); SqlParameter param5 = new SqlParameter("@CustPart", material.CustPart); SqlParameter param6 = new SqlParameter("@UACPart", material.UACPart); SqlParameter param7 = new SqlParameter("@Alloy", material.Alloy); SqlParameter param8 = new SqlParameter("@Temper", material.Temper); SqlParameter param9 = new SqlParameter("@Hole", material.Hole); SqlParameter param10 = new SqlParameter("@PieceNo", material.PieceNo); SqlParameter param11 = new SqlParameter("@Comment", material.Comment); SqlParameter param12 = new SqlParameter("@DBCntry", material.DBCntry); SqlParameter param13 = new SqlParameter("@EntryBy", user.UserName); ado.ExecScalarProc("RNDUACPartListing_Insert", "RND", new object[] { param1, param2, param3, param4, param5, param6, param7, param8, param9, param10, param11, param12, param13 }); VM.Message = MessageConstants.Saved; VM.Success = true; } } catch (Exception ex) { _logger.Error(ex.Message); return(new HttpResponseMessage(HttpStatusCode.InternalServerError)); } return(Serializer.ReturnContent(VM, this.Configuration.Services.GetContentNegotiator(), this.Configuration.Formatters, this.Request)); }
public int?AddEdit(int?categoryId, string languageCode, bool isActive, string categoryName, out int?lastInsertedId) { int?result; using (AdoHelper db = new AdoHelper()) { var returnValue = db.CreateParamReturnValue("returnValue"); lastInsertedId = db.ExecScalarProc("sp_cms_news_categories_insert_update", "@CategoryId", categoryId, "@LanguageCode", languageCode, "@IsActive", isActive, "@CategoryName", categoryName, returnValue).ConvertTo <int?>(null, true); result = db.GetParamReturnValue(returnValue); if (result == 0) { _AllItems = GetAllItems(true); } return(result); } }
public bool CheckLoanDisbursed(int LoanMasterId) { bool Isdisbursed = false; AdoHelper obj = new AdoHelper(); SqlParameter[] parms = new SqlParameter[2]; parms[0] = new SqlParameter("@LoanMasterId", LoanMasterId); parms[0].SqlDbType = System.Data.SqlDbType.Int; parms[1] = new SqlParameter("@Flag", "CheckLoanDisbursed"); parms[1].SqlDbType = System.Data.SqlDbType.VarChar; int i = Convert.ToInt16(obj.ExecScalarProc("uspGetInterestRates", parms)); if (i > 0) { Isdisbursed = true; } return(Isdisbursed); }
public static string InsUpdDelMenu(Menu menu) { AdoHelper objHelper = new AdoHelper(ConfigurationManager.ConnectionStrings["con"].ToString()); SqlParameter[] sqlParameter = { new SqlParameter("@SetAction", menu.SetAction.ToUpper()), new SqlParameter("@MenuId", menu.MenuId), new SqlParameter("@MenuName", menu.MenuName), new SqlParameter("@MenuType", menu.MenuType), new SqlParameter("@MenuOrder", menu.MenuOrder), new SqlParameter("@MenuIcon", menu.MenuIcon), new SqlParameter("@Menu_Uri", menu.Menu_Uri), new SqlParameter("@ParentId", menu.ParentId), new SqlParameter("@Active", menu.Active) }; Object obj = objHelper.ExecScalarProc("GKL_USP_UpateMenuMaster", sqlParameter); string status; status = "updated"; objHelper.Dispose(); return(status); }
public int?AddEdit(string sharedContentCode, string newSharedContentCode, string languageCode, bool isActive, string htmlCode) { int?result; using (AdoHelper db = new AdoHelper()) { var returnValue = db.CreateParamReturnValue("returnValue"); string lastInsertedId = db.ExecScalarProc("sp_cms_shared_content_insert_update", "@SharedContentCode", sharedContentCode, "@NewSharedContentCode", newSharedContentCode, "@LanguageCode", languageCode, "@IsActive", isActive, "@HtmlCode", htmlCode, returnValue).ConvertTo <string>(string.Empty, true); result = db.GetParamReturnValue(returnValue); if (result == 0) { _AllItems = GetAllItems(true); } return(result); } }
public static string InsUpdDelUser(User user) { AdoHelper objHelper = new AdoHelper(ConfigurationManager.ConnectionStrings["con"].ToString()); SqlParameter[] sqlParameter = { new SqlParameter("@SetAction", user.SetAction.ToUpper()), new SqlParameter("@UserId", user.UserId), new SqlParameter("@UserName", user.UserName), new SqlParameter("@EmailAddress", user.EmailAddress), new SqlParameter("@PhoneNumber", user.PhoneNumber), new SqlParameter("@Gender", user.Gender), new SqlParameter("@password", user.password), new SqlParameter("@RoleId", user.RoleId), new SqlParameter("@Active", user.Active) }; Object obj = objHelper.ExecScalarProc("GKL_USP_UpdateUserMaster", sqlParameter); string status; status = "updated"; objHelper.Dispose(); return(status); }
private bool CheckIfUserExists(string userName) { bool result = false; AdoHelper ado = new AdoHelper(); SqlParameter param1 = new SqlParameter("@UserName", userName); try { var id = ado.ExecScalarProc("RNDCheckUserExists", "RND", new object[] { param1 }); if (id != null) { if (Convert.ToInt32(id) > 0) { result = true; } } } catch (Exception ex) { _logger.Error(ex.Message); } return(result); }