/// <summary> /// This Method Deletes record from Database. /// </summary> /// <param name="objDCItem">Object which is to be Deleted.</param> /// <returns>Returns boolean value True if record is deleted Successfully /// otherwise returns false indicating that record is not deleted.</returns> public static bool Delete(ReturnableDCItem objDCItem) { bool recDAL; recDAL = ReturnableDCItemDAL.Delete(objDCItem.DBID); return(recDAL); }
/// <summary> /// Retrieves ReturnableDC Detail for Specified Record. /// </summary> /// <param name="dbid"></param> /// <returns></returns> public static ReturnableDC GetItem(int dbid, bool flgWithItems) { ReturnableDC objDC = ReturnableDCDAL.GetItem(dbid); if (objDC != null && flgWithItems) { objDC.DCItems = ReturnableDCItemDAL.GetList(objDC.EntryNo, objDC.EntryDate, objDC.DBID); } return(objDC); }
public static string[] GetUnits() { string[] objUnitList = null; dTable = ReturnableDCItemDAL.GetUnits(); if (dTable.Rows.Count > 0) { objUnitList = dTable.AsEnumerable().Select(row => row.Field <string>("UNIT")).ToArray(); } return(objUnitList); }
/// <summary> /// Saves current Object Values into Database. /// </summary> /// <param name="objRetDC">Current Department Object.</param> /// <returns>Boolean value True if record is saved successfully /// otherwise returns 'False' indicating record is not saved.</returns> public static bool Save(ReturnableDC objRetDC, User currentUser) { bool flgSave; using (TransactionScope objTScope = new TransactionScope(TransactionScopeOption.RequiresNew)) { if (objRetDC.IsEdited || objRetDC.IsNew) { ReturnableDCDAL.Save(objRetDC, currentUser); } if (objRetDC.DCItems != null) { foreach (ReturnableDCItem objItem in objRetDC.DCItems) { if (objItem.IsDeleted && !objItem.IsNew) { ReturnableDCItemDAL.Delete(objItem.DBID); } else if ((objItem.IsEdited || objItem.IsNew) && !objItem.IsDeleted) { objItem.EntryNo = objRetDC.EntryNo; objItem.EntryDate = objRetDC.EntryDate; objItem.EntryType = objRetDC.EntryType; objItem.MasterDBID = objRetDC.DBID; objItem.DCNo = objRetDC.DCNo; objItem.DCDate = objRetDC.DCDate; ReturnableDCItemDAL.Save(objItem, currentUser); } } } flgSave = true; objTScope.Complete(); } return(flgSave); }
/// <summary> /// Retrieves DCItem Detail for Specified Record. /// </summary> /// <param name="dbid">Unique ID for Record in Database.</param> /// <returns>Object DCItem containing Data values.</returns> public static ReturnableDCItem GetItem(int dbid) { return(ReturnableDCItemDAL.GetItem(dbid)); }
/// <summary> /// Retrieves List of Items in DC availble. /// </summary> /// <param name="strWhere">Condition for filtering the list.</param> /// <returns>Collection Object DCItemList.</returns> public static ReturnableDCItemList GetList(long entryNo, DateTime entryDate, long masterDBID) { return(ReturnableDCItemDAL.GetList(entryNo, entryDate, masterDBID)); }