while i get char A or R from database , i needed replace to "Approved" or "Rejected" this word. but iziit using if else statement to retrieve output, or got other solution?
Please kindly advise, thanks alot.
public DataTable GetQuotationInfo(int QuotationId)
{
FADB db = new FADB();
DataTable dt = new DataTable();
dt.Columns.Add("QuotationId");
dt.Columns.Add("ServiceOrderNo");
dt.Columns.Add("Date");
dt.Columns.Add("Name");
dt.Columns.Add("OnwerAddress");
dt.Columns.Add("QuotationNo");
dt.Columns.Add("Premises");
dt.Columns.Add("PayableTo");
dt.Columns.Add("Status");
dt = (from q in db.Csm_quotations
join j in db.Csm_quotation_jobs on q.QuotationId equals j.QuotationId
join c in db.Csm_complaints on q.ComplaintId equals c.ComplaintID
join f in db.Fa_lots on c.UnitId equals f.UnitId
join o in db.Sys_owners on f.OwnerId equals o.OwnerId
group new { q,j,c,f,o } by new { q.QuotationId,c.ComplaintCode,q.QuotationDate,q.QuotationSubject,q.PayableTo,q.Status,f.OwnerAddress,f.Address,o.OwnerName }
into grp
where grp.Key.QuotationId == Convert.ToUInt16(QuotationId)
select new
{
QuotationId = grp.Key.QuotationId,
ServiceOrderNo = grp.Key.ComplaintCode,
Date = grp.Key.QuotationDate.ToString("dd/MM/yyyy"),
Name = grp.Key.OwnerName,
OnwerAddress =grp.Key.OwnerAddress,
QuotationNo = grp.Key.QuotationSubject,
Premises = grp.Key.Address,
PayableTo = grp.Key.PayableTo,
Status = select new { grp.Key.Status = 'A' ? "Approved" : grp.Key.Status = 'R' ? "Rejected"};
}).ToDataTable();
return dt;