public RequestViewModel(RequestHistories req) { 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; this.roll = req.roll; this.exam_year = req.exam_year.ToString(); this.dob = req.dob; }
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; }
//converting to RequestHistModel from requested_mark public RequestHistModel(RequestHistories req) { 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; this.payment_status = req.payment_status; this.roll = req.roll; this.exam_result_id = req.exam_result_id; this.exam_year = req.exam_year; this.dob = req.dob; this.txn_id = req.txn_id; if (req.payment_status.Equals("error") || req.payment_status.Equals("unpaid") || req.txn_id == null || req.txn_id.Trim().Length == 0) { this.download_link = "Download Unavailable"; } else { string link = "/Request/GenerateMarksheet/" + req.exam_result_id; this.download_link = "<a href='" + link + "' target='_blank'>Download</a>"; } }