public List<Tender> getTender(Tender td) { var q = from t in ContextDB.Tenders where (t.Supplier_ID == td.Supplier_ID || td.Supplier_ID == null) && (t.Item_Code == td.Item_Code || td.Item_Code == null) && (t.Price == td.Price || td.Price == null) select t; return q.ToList<Tender>(); }
public bool deleteTender(Tender td) { try { ContextDB.Tenders.DeleteObject(td); ContextDB.SaveChanges(); return true; } catch (Exception e) { return false; } }
public bool updateTender(Tender td) { try { Tender t = getTenderByID(td.Supplier_ID, td.Item_Code); t.Price = td.Price == null ? t.Price : td.Price; ContextDB.SaveChanges(); return true; } catch (Exception e) { return false; } }
public void createTender(Tender tnd) { ContextDB.Tenders.AddObject(tnd); ContextDB.SaveChanges(); }
public void saveAdjustedInfo(String userID, String itemCode, int qty, String reason, DateTime dateIssue) { String voucherID, subject, msgBody, mailFrom, mailTo, authId, authBy; Double price, amount; List<User> authUser; NotificationMsg noti = new NotificationMsg(); TenderEnt tendEnt = new TenderEnt(); Tender tender = new Tender(); mailFrom=getFromMail(userID); subject="Adjustment Voucher"; msgBody="This is msg from clerk informing Adjusted Item Quantity. You can check from this link <a href='listOfPendingReq.aspx'>click here!</a>"; voucherID = getVoucherId("Adjustment_Voucher"); tender.Item_Code = itemCode; List<Tender> tendInfo= tendEnt.getTender(tender); price = Convert.ToDouble(tendInfo.First().Price.ToString()); amount = price * Convert.ToDouble(qty); if (amount <= 250.00) { authUser = getAuthIDAndNameEmail("Sup"); authId = authUser.First().Emp_ID; authBy = authUser.First().Emp_Name; mailTo = authUser.First().Email; saveVoucherInfo(voucherID, dateIssue, authId, authBy); noti.sendAuthUserNotification(mailFrom, mailTo, subject,msgBody); } else if (amount > 250.00) { authUser = getAuthIDAndNameEmail("Mgr"); authId = authUser.First().Emp_ID; ; authBy = authUser.First().Emp_Name; mailTo = authUser.First().Email; saveVoucherInfo(voucherID, dateIssue, authId, authBy); noti.sendAuthUserNotification(mailFrom, mailTo, subject, msgBody); } saveAdjustedQty(voucherID, itemCode, qty, reason); }
/// <summary> /// Deprecated Method for adding a new object to the Tenders EntitySet. Consider using the .Add method of the associated ObjectSet<T> property instead. /// </summary> public void AddToTenders(Tender tender) { base.AddObject("Tenders", tender); }
/// <summary> /// Create a new Tender object. /// </summary> /// <param name="supplier_ID">Initial value of the Supplier_ID property.</param> /// <param name="item_Code">Initial value of the Item_Code property.</param> public static Tender CreateTender(global::System.String supplier_ID, global::System.String item_Code) { Tender tender = new Tender(); tender.Supplier_ID = supplier_ID; tender.Item_Code = item_Code; return tender; }