public static decimal getCurrentRate() { BOSEMEntities db = new BOSEMEntities(); List <PaymentRates> rates = db.PaymentRates.OrderByDescending(m => m.order_date).ToList(); return(rates.Count == 0 ? 0 : rates[0].amount); }
public SubjectYearCombinationViewModel(SubjectYearCombinations model) { if (model != null) { BOSEMEntities db = new BOSEMEntities(); this.id = model.id; Subject sub = db.Subjects.Find(model.sub_id); this.subject_name = sub.name; this.seq_cd = sub.seq_cd; this.sub_type = sub.sub_type; this.sub_id = model.sub_id; this.year = model.year; this.incl_in_total = model.incl_in_total; } }
public AllRequestHistModel(RequestHistories req) { BOSEMEntities db = new BOSEMEntities(); this.id = req.id; this.request_date = req.request_date.ToString("ddd, dd MMM yyyy, hh:mm tt"); //this.request_date = req.request_date.ToString("dd/MM/yyyy hh:mm:ss tt"); this.user_id = req.user_id; AspNetUsers user = db.AspNetUsers.Find(req.user_id); this.username = user.UserName; this.email = user.Email; this.payment_status = req.payment_status.Trim().Equals("unpaid") ? "NOT PAID" : req.payment_status.ToUpper(); this.roll = req.roll; this.exam_result_id = req.exam_result_id; this.exam_year = req.exam_year.ToString(); this.dob = req.dob; this.txn_id = req.txn_id; }