public static Utility GetUtilityWithIdAndResourceName(UTILITY utility) { return(new Utility { Id = utility.ID, ResourceName = UtilityModel.GetResourceNameForUtility(utility.NAME) }); }
public static Utility GetUtilityWithOutBigUsagePrice(UTILITY utility) { return(new Utility { Id = utility.ID, ResourceName = UtilityModel.GetResourceNameForUtility(utility.NAME), Name = utility.NAME, Price = utility.PRICE, ImagePath = HelperMethod.GetUtilityImage(utility.ID), Unit = Unit.Get(utility.UNIT) }); }
public static Utility GetUtilityWithBigUsagePrice(UTILITY utility) { return(new Utility { Id = utility.ID, ResourceName = UtilityModel.GetResourceNameForUtility(utility.NAME), Name = utility.NAME, Price = utility.PRICE, BigUsagePrice = (decimal)utility.BIGUSAGEPRICE, UsageForStandartPrice = Math.Round((decimal)utility.USAGEFORSTANDARTPRICE, 0), ImagePath = HelperMethod.GetUtilityImage(utility.ID), Unit = Unit.Get(utility.UNIT) }); }
public UTILITY Save(UTILITY utility) { if (utility.ID == 0) { context.UTILITYs.Add(utility); } else { context.Entry(utility).State = EntityState.Modified; } context.SaveChanges(); return(utility); }
public void Delete(UTILITY utility) { context.UTILITYs.Remove(utility); context.SaveChanges(); }
public ActionResult ForgotPassword(string emailID) { var strbody = string.Empty; var subject = "Reset Password - EZY HR"; User userobj = userBo.GetByProperty(x => x.UserName.ToUpper() == emailID.ToUpper()); var employeeid = userobj.EmployeeId; if (employeeid == -1) { var newPassword = UTILITY.CreateRandomPassword(); userobj.Password = newPassword; strbody = string.Format( "Dear Admin <BR>" + "As you requested, your password for EZY-HR login has now been reset. Your new login details are as follows: <BR>" + "Email ID :{0} <BR>" + "Password : {1} <BR>" + "To change your password to something more memorable, after logging in go to My Profile, Change Password.<BR>" + "<BR>" + "Regards<BR>" + "Administrator<BR>" + "EZY-CORP<BR>", emailID, newPassword); } else { EmployeeHeader empobj = empHeaderBO.GetByProperty(x => x.EmployeeId == employeeid); var newPassword = UTILITY.CreateRandomPassword(); empobj.Password = newPassword; userobj.Password = newPassword; strbody = string.Format( "Dear {0} {1} <BR>" + "As you requested, your password for EZY-HR login has now been reset. Your new login details are as follows: <BR>" + "Email ID :{2} <BR>" + "Password : {3} <BR>" + "To change your password to something more memorable, after logging in go to My Profile, Change Password.<BR>" + "<BR>" + "Regards<BR>" + "Administrator<BR>" + "EZY-CORP<BR>", empobj.FirstName, empobj.LastName, emailID, newPassword); empHeaderBO.Add(empobj); } //} /* * "From:" + empleavelist.FromDate.ToShortDateString() + "to" + empleavelist.ToDate.ToShortDateString() + "<BR>" + "Reason:" + empleavelist.Reason; */ userBo.Add(userobj); EmailGenerator emailgenerator = new EmailGenerator(); emailgenerator.ConfigMail(emailID, true, subject, strbody); var success = "Your new password is sent to your login email ID : " + emailID; return(Json(new { success }, JsonRequestBehavior.AllowGet)); }