public List <AdjustmentBO> getAdjustmentVoucherListMan() { List <AdjustmentBO> i = new List <AdjustmentBO>(); try { var query = (from x in context.Adjustments join y in context.Employees on x.EmpID equals y.EmpID orderby x.AdjustmentStatus descending, x.VoucherDate descending where x.AuthorisedBySupervisor.Equals("Yes") && x.TotalPrice >= 250 select new { x.VoucherID, x.EmpID, y.EmpName, x.VoucherDate, x.TotalPrice, x.AdjustmentStatus }).ToList(); foreach (var q in query) { AdjustmentBO b = new AdjustmentBO(); b.VoucherId = q.VoucherID; b.EmployeeId = q.EmpID; b.Employee = new EmployeeBO(); b.Employee.EmployeeName = q.EmpName; b.VoucherDate = q.VoucherDate; b.TotalPrice = (double)q.TotalPrice; b.AdjustmentStatus = q.AdjustmentStatus; i.Add(b); } } catch (Exception x) { System.Diagnostics.Debug.WriteLine(x); } return(i); }
protected void Page_Load(object sender, EventArgs e) { try { if (Session["userLoggedIn"].Equals("") || Session["login"].Equals("")) { Response.Redirect("~/LoggedInPage.aspx"); } else { if (!IsPostBack) { string number = Request.QueryString["adjNumber"]; int adjNum = Convert.ToInt32(number.Substring(1, number.Length - 1)); b = bl.getAdjustment(adjNum); //search Adjustment By ID lblAdjustmentCode.Text = number; //show number and date DateTime dt = DateTime.Parse(b.Date.ToString()); lblDateIssue.Text = dt.ToString("dd/MM/yyyy"); //Show all data in gridview adjustDetailGV.DataSource = bl.getAdjustmentDetail(adjNum); adjustDetailGV.DataBind(); } } } catch (Exception ex) { Console.WriteLine(ex.ToString()); } }
public AdjustmentBO getAdjustmentByVoucherId(string adjustmentId) { Adjustment av = da.getAdjustmentById(adjustmentId); AdjustmentBO abo = convertAdjustmentBO(av); return(abo); }
//Get adjustment by id public AdjustmentBO getAdjustmentById(int number) { var q = context.Adjustments.Where(x => x.AdjustmentID == number).FirstOrDefault(); AdjustmentBO a = new AdjustmentBO(); a.AdjustmentID = q.AdjustmentID; a.Date = q.Date; a.EmpID = q.EmployeeID; a.Status = q.Status; return(a); }
public List <AdjustmentBO> getAllAdjustmentList() { List <AdjustmentBO> lst = new List <AdjustmentBO>(); var qry = context.Adjustments.ToList();//need to add emp id to check foreach (var q in qry) { AdjustmentBO a = new AdjustmentBO(); a.AdjustmentID = q.AdjustmentID; a.AdjID = "A" + q.AdjustmentID; a.Date = q.Date; a.Status = q.Status; lst.Add(a); } return(lst); }
public AdjustmentBO convertAdjustmentBO(Adjustment av) { abo = new AdjustmentBO(); return(abo); }