public ActionResult TransactionHistory() { if (Session[DALVariables.UserAccountId] == null) { return(RedirectToAction("Login", "User")); } if (!String.IsNullOrEmpty("Search Area")) { try { List <ModelTransactionByCreditCard> lstModelTransactionByCreditCard = new List <ModelTransactionByCreditCard>(); BLLMerchantPages objBLLMerchantPages = new BLLMerchantPages(); lstModelTransactionByCreditCard = objBLLMerchantPages.GetPaymeantTransactionHistory(Convert.ToInt32(Session[DALVariables.UserAccountId].ToString())); if (lstModelTransactionByCreditCard.Count > 0) { return(View(lstModelTransactionByCreditCard)); } else { return(View(lstModelTransactionByCreditCard)); } } catch (Exception ex) { DALUtility.ErrorLog(ex.Message, "SubscribeService, Merchant"); } } else { Error(string.Format("Error occured while updating service status.")); } return(RedirectToAction("Login", "User")); }
protected override WarehouseEntities CreateDataSource() { try { XERP.Server.DAL.WarehouseDAL.DALUtility dalUtility = new DALUtility(); var context = new WarehouseEntities(dalUtility.EntityConectionString); //test it... //GetMetaData("Warehouses"); //IQueryable<Warehouse> WarehouseQuery = (from c in context.Warehouses // select c); //foreach (Warehouse cc in WarehouseQuery) //{ // string s = cc.Name.ToString(); //} //Warehouse Warehouse = new Warehouse(); //IQueryable<Warehouse> WarehouseQuery = Refresh("5,6"); return(context); } catch (Exception ex) { throw (ex); } }
//All senior tables(Companies, Parts, Orders, ect...) tend to have a generic table called TableNameTypes //i.e. SystemUserTypes PartTypes, OrderTypes... //So this will constitute the meta data for that Type table... //Xerp attempts to use generic naming where possible to allow for cloning... public static List <Temp> GetMetaData(this SystemUserType entityObject) { XERP.Server.DAL.SystemUserDAL.DALUtility dalUtility = new DALUtility(); List <Temp> tempList = new List <Temp>(); int id = 0; using (SystemUserEntities ctx = new SystemUserEntities(dalUtility.EntityConectionString)) { var c = ctx.SystemUserTypes.FirstOrDefault(); var queryResults = from meta in ctx.MetadataWorkspace.GetItems(DataSpace.CSpace) .Where(m => m.BuiltInTypeKind == BuiltInTypeKind.EntityType) from query in (meta as EntityType).Properties .Where(p => p.DeclaringType.Name == entityObject.GetType().Name) select query; if (queryResults.Count() > 0) { foreach (var queryResult in queryResults.ToList()) { Temp temp = new Temp(); temp.ID = id; temp.Name = queryResult.Name.ToString(); temp.ShortChar_1 = queryResult.TypeUsage.EdmType.Name; if (queryResult.TypeUsage.EdmType.Name == "String") { temp.Int_1 = Convert.ToInt32(queryResult.TypeUsage.Facets["MaxLength"].Value); } temp.Bool_1 = false; //we use this as a error trigger false = not an error... tempList.Add(temp); id++; } } } return(tempList); }
protected override SystemUserEntities CreateDataSource() { try { XERP.Server.DAL.SystemUserDAL.DALUtility dalUtility = new DALUtility(); var context = new SystemUserEntities(dalUtility.EntityConectionString); //test it... //GetMetaData("SystemUsers"); //IQueryable<SystemUser> itemQuerry = (from c in context.SystemUsers // select c); //foreach (SystemUser cc in SystemUserQuery) //{ // string s = cc.Name.ToString(); //} //SystemUser item = new SystemUser(); //IQueryable<SystemUser> itemQuery = Refresh("5,6"); return(context); } catch (Exception ex) { throw (ex); } }
public ActionResult AddRssLink(ModelFeed objModelFeed) { if (ModelState.IsValid) { try { if (Session[DALVariables.AdminUserNo] == null) { return(RedirectToAction("Login", "Admin")); } bllFeed = new BLLFeed(); decimal result = 0; result = bllFeed.InsertFeedData(objModelFeed); if (result > 0) { return(View()); } ModelState.AddModelError("", "No User Found!,Re-check login details"); return(View()); } catch (Exception ex) { DALUtility.ErrorLog(ex.Message, "AdminController, Login"); } } else { ModelState.AddModelError("", "Check error of form; Please correct to continue!"); } return(View()); }
protected override SecurityGroupEntities CreateDataSource() { try { XERP.Server.DAL.SecurityGroupDAL.DALUtility dalUtility = new DALUtility(); var context = new SecurityGroupEntities(dalUtility.EntityConectionString); //test it... //GetMetaData("SecurityGroups"); //IQueryable<SecurityGroup> SecurityGroupQuery = (from c in context.SecurityGroups // select c); //foreach (SecurityGroup cc in SecurityGroupQuery) //{ // string s = cc.Name.ToString(); //} //SecurityGroup SecurityGroup = new SecurityGroup(); //IQueryable<SecurityGroup> SecurityGroupQuery = Refresh("5,6"); return(context); } catch (Exception ex) { throw (ex); } }
public ActionResult Activation(string code) { if (!String.IsNullOrEmpty(code.Trim())) { try { decimal result = 0; objBLLSchoolUser = new BLLSchoolUser(); result = objBLLSchoolUser.MerchantAccountActivate(EncryptDecrypt.Decrypt(code)); if (result > 0) { return(View()); } else { Error("No user found !"); } return(RedirectToAction("Login", "User")); } catch (Exception ex) { DALUtility.ErrorLog(ex.Message, "UserController, Activation"); } } else { Error("No user found !"); } return(RedirectToAction("Login", "User")); }
protected override CompanyEntities CreateDataSource() { try { XERP.Server.DAL.CompanyDAL.DALUtility dalUtility = new DALUtility(); var context = new CompanyEntities(dalUtility.EntityConectionString); //test it... //GetMetaData("Companies"); //IQueryable<Company> itemQuerry = (from c in context.Companies // select c); //foreach (Company cc in CompanyQuery) //{ // string s = cc.Name.ToString(); //} //Company item = new Company(); //IQueryable<Company> itemQuery = Refresh("5,6"); return(context); } catch (Exception ex) { throw (ex); } }
public Patient(IDataRecord record) { this.firstName = DALUtility.GetData <string>(record, PatientController.FIRST_NAME); this.lastName = DALUtility.GetData <string>(record, PatientController.LAST_NAME); this.dateOfBirth = DALUtility.GetData <string>(record, PatientController.BIRTH_DTTM); this.socialSecurityNumber = DALUtility.GetData <string>(record, PatientController.SOCIAL_SECURITY_NUMBER); }
protected override MenuSecurityEntities CreateDataSource() { XERP.Server.DAL.MenuSecurityDAL.DALUtility dalUtility = new DALUtility(); var context = new MenuSecurityEntities(dalUtility.EntityConectionString); //test it //GetMenuItemsAllowedByUser("Base"); //test it... //IQueryable<MenuSecurity> query = (from q in _context.MenuSecurities // select q); var query = (from mi in context.MenuItems from ms in context.MenuSecurities where mi.MenuItemID == ms.MenuItemID && mi.AllowAll == true select mi).ToList(); foreach (MenuItem mi in query) { string s = mi.MenuItemID.ToString(); } //ToDo: ADD DAL Securities Logic... //DAL Security Should require USERID and DALName //From those two bits of information we can see if the User has rights to the DAL... //By default the DAL will be wide open... The DalItems and DalSecurities will have //to be appended if security at the DAL level is required... return(context); }
protected override UdListEntities CreateDataSource() { try { XERP.Server.DAL.UdListDAL.DALUtility dalUtility = new DALUtility(); var context = new UdListEntities(dalUtility.EntityConectionString); //test it... //GetMetaData("UdLists"); //IQueryable<UdList> UdListQuery = (from c in context.UdLists // select c); //foreach (UdList cc in UdListQuery) //{ // string s = cc.Name.ToString(); //} //UdList UdList = new UdList(); //IQueryable<UdList> UdListQuery = Refresh("5,6"); return(context); } catch (Exception ex) { throw (ex); } }
public decimal RegisterNewMerchantUser(ModelMerchantUser objModelMerchantUser) { decimal result = 0; string getActivationCode = DALUtility.GetEmailActivationCode(); SqlParameter[] param = new SqlParameter[8]; param[0] = new SqlParameter("@MerchantNameEN", objModelMerchantUser.MerchantNameEN); param[1] = new SqlParameter("@MerchantEmail", objModelMerchantUser.MerchantEmail); param[2] = new SqlParameter("@MerchantPassword", EncryptDecrypt.Encrypt(objModelMerchantUser.MerchantPassword)); param[3] = new SqlParameter("@strAdminUserMobile", objModelMerchantUser.MerchantMobileNumber); param[4] = new SqlParameter("@CompanyNameEN", objModelMerchantUser.CompanyNameEN); param[5] = new SqlParameter("@sCompanyLogo", objModelMerchantUser.CompanyLogo); param[6] = new SqlParameter("@AccountStatus", 1); param[7] = new SqlParameter("@ActivationCodeByEmail", getActivationCode); result = DALCommon.ExecuteNonQueryReturnIdentity("[sp_Admin_InsertMerchantUser]", param); if (result > 0) { string MerchantKey = EncryptDecrypt.Encrypt(DALUtility.GetEmailActivationCode()); string MerchantReferenceID = EncryptDecrypt.GenerateHashCode(result + MerchantKey + System.DateTime.Now); if (UpdateMercharAPIKeys(result, MerchantKey, MerchantReferenceID) > 0) { SendActivationCode(getActivationCode, objModelMerchantUser.MerchantEmail); } } return(result); }
public IQueryable <MenuItem> GetMenuItemsAllowedByUser(string systemUserID, string companyID) { XERP.Server.DAL.MenuSecurityDAL.DALUtility dalUtility = new DALUtility(); var context = new MenuSecurityEntities(dalUtility.EntityConectionString); var query = (from sus in context.SystemUserSecurities from ms in context.MenuSecurities from mi in context.MenuItems where sus.CompanyID == companyID && ms.CompanyID == companyID && mi.CompanyID == companyID && sus.SystemUserID == systemUserID && sus.SecurityGroupID == ms.SecurityGroupID && ms.MenuItemID == mi.MenuItemID && mi.AllowAll == false select mi); var query2 = (from mi in context.MenuItems where mi.AllowAll == true && mi.CompanyID == companyID select mi); var mergedList = query.Union(query2); return(mergedList); }
public ModelStudentFee GetStudentSinngleFeeInfoByFeeId(double FeeId) { ModelStudentFee objModelStudentFee = new ModelStudentFee(); DataTable tblStudentFeeInfo = new DataTable(); SqlParameter[] param = new SqlParameter[1]; param[0] = new SqlParameter("@FeeId", FeeId); tblStudentFeeInfo = DALCommon.GetDataUsingDataTable("[sp_Admin_GetStudentSinngleFeeInfoByFeeId]", param); if (tblStudentFeeInfo.Rows.Count > 0) { objModelStudentFee.FeeId = Convert.ToDouble(tblStudentFeeInfo.Rows[0]["FeeId"]); objModelStudentFee.StudentId = Convert.ToInt32(tblStudentFeeInfo.Rows[0]["StudentId"]); objModelStudentFee.ComputerCode = Convert.ToInt32(tblStudentFeeInfo.Rows[0]["ComputerCode"]); objModelStudentFee.SerialNo = Convert.ToInt32(tblStudentFeeInfo.Rows[0]["SerialNo"]); objModelStudentFee.AdmissionFee = DALUtility.isNumericDBNULL(tblStudentFeeInfo.Rows[0]["AdmissionFee"].ToString()); objModelStudentFee.Admission = DALUtility.isNumericDBNULL(tblStudentFeeInfo.Rows[0]["Admission"].ToString()); objModelStudentFee.ReAdmissionFee = DALUtility.isNumericDBNULL(tblStudentFeeInfo.Rows[0]["ReAdmissionFee"].ToString()); objModelStudentFee.RegistrationFee = DALUtility.isNumericDBNULL(tblStudentFeeInfo.Rows[0]["RegistrationFee"].ToString()); objModelStudentFee.MonthlyFee = DALUtility.isNumericDBNULL(tblStudentFeeInfo.Rows[0]["MonthlyFee"].ToString()); objModelStudentFee.ComputerFee = DALUtility.isNumericDBNULL(tblStudentFeeInfo.Rows[0]["ComputerFee"].ToString()); objModelStudentFee.Fine = DALUtility.isNumericDBNULL(tblStudentFeeInfo.Rows[0]["Fine"].ToString()); objModelStudentFee.ExamFee = DALUtility.isNumericDBNULL(tblStudentFeeInfo.Rows[0]["ExamFee"].ToString()); objModelStudentFee.GeneratorFee = DALUtility.isNumericDBNULL(tblStudentFeeInfo.Rows[0]["GeneratorFee"].ToString()); objModelStudentFee.FeeMonth = Convert.ToString(tblStudentFeeInfo.Rows[0]["FeeMonth"]); objModelStudentFee.Total = DALUtility.isNumericDBNULL(tblStudentFeeInfo.Rows[0]["Total"].ToString()); objModelStudentFee.FeePaidStatus = Convert.ToInt32(tblStudentFeeInfo.Rows[0]["FeePaidStatus"].ToString()); } return(objModelStudentFee); }
public IQueryable <ExecutableProgram> GetExecutableProgramsAllowedByUser(string systemUserID, string companyID) {//complex query required compound search criteria so this had to be done server side... XERP.Server.DAL.LogInDAL.DALUtility dalUtility = new DALUtility(); var context = new LogInEntities(dalUtility.EntityConectionString); var query = (from sus in context.SystemUserSecurities from ms in context.MenuSecurities from mi in context.MenuItems from ep in context.ExecutablePrograms where sus.CompanyID == companyID && ms.CompanyID == companyID && mi.CompanyID == companyID && ep.CompanyID == companyID && sus.SystemUserID == systemUserID && sus.SecurityGroupID == ms.SecurityGroupID && ms.MenuItemID == mi.MenuItemID && mi.Executable == true && mi.AllowAll == false && string.IsNullOrEmpty(ep.ExecutableProgramID) == false && mi.ExecutableProgramID == ep.ExecutableProgramID select ep); var query2 = (from mi in context.MenuItems from ep in context.ExecutablePrograms where mi.ExecutableProgramID == ep.ExecutableProgramID && mi.AllowAll == true && string.IsNullOrEmpty(ep.ExecutableProgramID) == false && string.IsNullOrEmpty(mi.ExecutableProgramID) == false select ep); var mergedList = query.Union(query2); return(mergedList); }
protected override AddressEntities CreateDataSource() { try { XERP.Server.DAL.AddressDAL.DALUtility dalUtility = new DALUtility(); var context = new AddressEntities(dalUtility.EntityConectionString); //test it... //GetMetaData("Addresses"); IQueryable <Address> AddressQuery = (from c in context.Addresses select c); foreach (Address cc in AddressQuery) { string s = cc.Name.ToString(); } //Address Address = new Address(); //IQueryable<Address> AddressQuery = Refresh("5,6"); return(context); } catch (Exception ex) { throw (ex); } }
public static int SendEmail(string ToEmail, string fromEmail, string Subject, string Body, string SMTP, string Username, string Password) { try { MailMessage mailMessage = new MailMessage(new MailAddress(fromEmail), new MailAddress(ToEmail)); System.Net.NetworkCredential SmtpUser = new System.Net.NetworkCredential(Username, Password); dynamic emailHeader = default(StringBuilder); StringBuilder emailFooter = new StringBuilder(); //message body and subject property mailMessage.Subject = Subject; mailMessage.Body = emailHeader.ToString() + Body + emailFooter.ToString(); mailMessage.IsBodyHtml = true; //create smtp client SmtpClient smtpMail = new SmtpClient(); //assign smtp properties smtpMail.Host = SMTP; smtpMail.DeliveryMethod = SmtpDeliveryMethod.Network; smtpMail.UseDefaultCredentials = false; smtpMail.Credentials = SmtpUser; //send mail smtpMail.Send(mailMessage); return(1); } catch (Exception ex) { DALUtility.ErrorLog(ex.Message, "SendEmail"); return(0); } }
public ActionResult PasswordSetting(string id, string code) { if (!String.IsNullOrEmpty(id.Trim()) && !String.IsNullOrEmpty(code.Trim())) { try { objBLLSchoolUser = new BLLSchoolUser(); DataTable aMerchantUser = new DataTable(); aMerchantUser = objBLLSchoolUser.MerchantPasswordRecovery(EncryptDecrypt.Decrypt(id), EncryptDecrypt.Decrypt(code)); if (aMerchantUser.Rows.Count > 0) { objModelSchoolUserAccount = new ModelSchoolUserAccount(); objModelSchoolUserAccount.UserEmail = aMerchantUser.Rows[0]["UserEmail"].ToString(); return(View(objModelSchoolUserAccount)); } else { Error("Link expired or no user found,Please try again to Recover your password"); } return(RedirectToAction("Login", "User")); } catch (Exception ex) { DALUtility.ErrorLog(ex.Message, "UserController, PasswordSetting"); } } else { Error("Link expired or no user found,Please try again to Recover your password"); } return(RedirectToAction("Login", "User")); }
public ActionResult Register(ModelMerchantUser objModelMerchantUser) { if (ModelState.IsValid) { try { if (objModelMerchantUser == null) { return(RedirectToAction("Login", "User")); } objBLLSchoolUser = new BLLSchoolUser(); StringBuilder st = new StringBuilder(); decimal result = 0; foreach (string file in Request.Files) { HttpPostedFileBase hpf = Request.Files[file] as HttpPostedFileBase; if (hpf.ContentLength == 0) { continue; } string savedFileName = Path.Combine(Server.MapPath("~/Content/MerchantLogo"), Path.GetFileName(hpf.FileName)); hpf.SaveAs(savedFileName); // Save the file objModelMerchantUser.CompanyLogo = hpf.FileName; } result = objBLLSchoolUser.RegisterNewMerchantUser(objModelMerchantUser); if (result > 0) { Success(string.Format("{0} was successfully registered", objModelMerchantUser.MerchantEmail)); return(RedirectToAction("Login", "User")); } else if (result == -2) { Attention(string.Format("{0} Email alraedy registered. Please use new Email Addess. If forgot password try to recover your account.", objModelMerchantUser.MerchantEmail)); return(RedirectToAction("Login", "User")); } else { Error(string.Format("Error occured while Registering {0}", objModelMerchantUser.MerchantEmail)); return(RedirectToAction("Register", "User", objModelMerchantUser)); } } catch (Exception ex) { DALUtility.ErrorLog(ex.Message, "AddRegister, Merchant"); } } else { Error("Check error of form; Please correct to continue!"); //ModelState.AddModelError("", "Check error of form; Please correct to continue!"); } return(RedirectToAction("Login", "User")); }
//MerchantAccountActivate public decimal MerchantAccountActivate(string activationCode) { string getActivationCode = DALUtility.GetEmailActivationCode(); SqlParameter[] param = new SqlParameter[1]; param[0] = new SqlParameter("@ActivationCodeByEmail", activationCode); return(DALCommon.ExecuteNonQueryReturnIdentity("[sp_Admin_UpdateMerchantUserActivate]", param)); }
public decimal UpdateMerchantUserPassword(string MerchantEmail, string NewPassword) { string getActivationCode = DALUtility.GetEmailActivationCode(); SqlParameter[] param = new SqlParameter[2]; param[0] = new SqlParameter("@MerchantEmail", MerchantEmail); param[1] = new SqlParameter("@MerchantPassword", EncryptDecrypt.Encrypt(NewPassword)); return(DALCommon.ExecuteNonQueryReturnIdentity("[sp_Admin_UpdateMerchantNewPassword]", param)); }
public void OnChangeSystemUserTypes(SystemUserType itemType, UpdateOperations operations) { if (operations == UpdateOperations.Delete) {//update a null to any place the Type was used by its parent record... XERP.Server.DAL.SystemUserDAL.DALUtility dalUtility = new DALUtility(); var context = new SystemUserEntities(dalUtility.EntityConectionString); context.SystemUsers.MergeOption = System.Data.Objects.MergeOption.NoTracking; string typeID = itemType.SystemUserTypeID; string sqlstring = "UPDATE SystemUsers SET SystemUserTypeID = null WHERE SystemUserTypeID = '" + typeID + "'"; context.ExecuteStoreCommand(sqlstring); } }
public void OnChangeCompanyCodes(CompanyCode itemCode, UpdateOperations operations) { if (operations == UpdateOperations.Delete) {//update a null to any place the Code was used by its parent record... XERP.Server.DAL.CompanyDAL.DALUtility dalUtility = new DALUtility(); var context = new CompanyEntities(dalUtility.EntityConectionString); context.Companies.MergeOption = System.Data.Objects.MergeOption.NoTracking; string codeID = itemCode.CompanyCodeID; string sqlstring = "UPDATE Companies SET CompanyCodeID = null Where CompanyCodeID = '" + codeID + "'"; context.ExecuteStoreCommand(sqlstring); } }
public void OnChangePlantTypes(PlantType PlantType, UpdateOperations operations) { if (operations == UpdateOperations.Delete) {//update a null to any place the Type was used by its parent record... XERP.Server.DAL.PlantDAL.DALUtility dalUtility = new DALUtility(); var context = new PlantEntities(dalUtility.EntityConectionString); context.Plants.MergeOption = System.Data.Objects.MergeOption.NoTracking; string companyID = PlantType.CompanyID; string typeID = PlantType.PlantTypeID; string sqlstring = "UPDATE Plants SET PlantTypeID = null WHERE CompanyID = '" + companyID + "' and PlantTypeID = '" + typeID + "'"; context.ExecuteStoreCommand(sqlstring); } }
public void OnChangeExecutablePrograms(ExecutableProgram executableProgram, UpdateOperations operations) { if (operations == UpdateOperations.Delete) {//update a null to any place the item was used by its parent record... XERP.Server.DAL.MenuSecurityDAL.DALUtility dalUtility = new DALUtility(); var context = new MenuSecurityEntities(dalUtility.EntityConectionString); context.ExecutablePrograms.MergeOption = System.Data.Objects.MergeOption.NoTracking; string companyID = executableProgram.CompanyID; string executableProgramID = executableProgram.ExecutableProgramID; string sqlstring = "UPDATE MenuItems SET ExecutableProgramID = null WHERE CompanyID = '" + companyID + "' and ExecutableProgramID = '" + executableProgramID + "'"; context.ExecuteStoreCommand(sqlstring); } }
public void OnChangeMenuItemTypes(MenuItem menuItem, UpdateOperations operations) { if (operations == UpdateOperations.Delete) {//Cascade delete any children belonging to parent Menu Item deleted... XERP.Server.DAL.MenuSecurityDAL.DALUtility dalUtility = new DALUtility(); var context = new MenuSecurityEntities(dalUtility.EntityConectionString); context.MenuItems.MergeOption = System.Data.Objects.MergeOption.NoTracking; string companyID = menuItem.CompanyID; string menuItemID = menuItem.MenuItemID; string sqlstring = "Delete MenuItems WHERE CompanyID = '" + companyID + "' and ParentMenuID = '" + menuItemID + "'"; context.ExecuteStoreCommand(sqlstring); } }
public void OnChangeWarehouseLocationBinTypes(WarehouseLocationBinCode warehouseCode, UpdateOperations operations) { if (operations == UpdateOperations.Delete) {//update a null to any place the Code was used by its parent record... XERP.Server.DAL.WarehouseDAL.DALUtility dalUtility = new DALUtility(); var context = new WarehouseEntities(dalUtility.EntityConectionString); context.WarehouseLocationBins.MergeOption = System.Data.Objects.MergeOption.NoTracking; string companyID = warehouseCode.CompanyID; string codeID = warehouseCode.WarehouseLocationBinCodeID; string sqlstring = "UPDATE WarehouseLocationBins SET WarehouseLocationBinCodeID = null WHERE CompanyID = '" + companyID + "' and WarehouseLocationBinCodeID = '" + codeID + "'"; context.ExecuteStoreCommand(sqlstring); } }
public void OnChangeSecurityGroupTypes(SecurityGroupCode securityGroupCode, UpdateOperations operations) { if (operations == UpdateOperations.Delete) {//update a null to any place the Code was used by its parent record... XERP.Server.DAL.SecurityGroupDAL.DALUtility dalUtility = new DALUtility(); var context = new SecurityGroupEntities(dalUtility.EntityConectionString); context.SecurityGroups.MergeOption = System.Data.Objects.MergeOption.NoTracking; string companyID = securityGroupCode.CompanyID; string codeID = securityGroupCode.SecurityGroupCodeID; string sqlstring = "UPDATE SecurityGroups SET SecurityGroupCodeID = null WHERE CompanyID = '" + companyID + "' and SecurityGroupCodeID = '" + codeID + "'"; context.ExecuteStoreCommand(sqlstring); } }
public ActionResult Login(string UserEmail, string UserPassword, string RememberMe) { if (ModelState.IsValid) { if (string.IsNullOrEmpty(UserEmail.Trim())) { Error("UserEmail not filled not correctly"); //ModelState.AddModelError("", "UserEmail not filled not correctly"); return(View()); } else if (string.IsNullOrEmpty(UserPassword.Trim())) { Error("Must fill password field"); //ModelState.AddModelError("", "Must fill password field"); return(View()); } try { ModelAdminUser objAdminUser = new ModelAdminUser(); DataTable userDetails = new DataTable(); userDetails = bllAdminUser.GetAdminUserDetailsByLogin(UserEmail, UserPassword); if (userDetails.Rows.Count > 0) { objAdminUser.UserAccountNo = Convert.ToInt32(userDetails.Rows[0]["intAdminUserId"]); objAdminUser.UserName = Convert.ToString(userDetails.Rows[0]["strAdminUserName"]); objAdminUser.UserFirstName = Convert.ToString(userDetails.Rows[0]["strAdminUserFirstName"]); objAdminUser.UserLastName = Convert.ToString(userDetails.Rows[0]["strAdminUserLastName"]); objAdminUser.UserEmail = Convert.ToString(userDetails.Rows[0]["strAdminUserEmail"]); objAdminUser.UserProfileImage = Convert.ToString(userDetails.Rows[0]["ProfileLogo"]); Session[DALVariables.UserAccountId] = objAdminUser.UserAccountNo; Session[DALVariables.UserEmail] = objAdminUser.UserEmail; Session[DALVariables.UserName] = objAdminUser.UserFirstName + " " + objAdminUser.UserLastName; Session[DALVariables.ProfileImage] = objAdminUser.UserName; return(RedirectToAction("Index", "Admin")); } ModelState.AddModelError("", "No User Found ! , Re-check login details"); return(View()); } catch (Exception ex) { DALUtility.ErrorLog(ex.Message, "AdminController, Login"); } } else { ModelState.AddModelError("", "Fill form Correctly; Please correct to continue!"); } return(View()); }
public IQueryable <UdListItem> RefreshUdListItem(string autoIDs) { var query = from val in autoIDs.Split(',') select long.Parse(val); XERP.Server.DAL.UdListDAL.DALUtility dalUtility = new DALUtility(); var context = new UdListEntities(dalUtility.EntityConectionString); var queryResult = (from q in context.UdListItems where query.Contains(q.AutoID) select q); return(queryResult); }