private ItemOrder MapItemOrder(DbDataReader dr) { ItemOrder itemOrder = new ItemOrder(); itemOrder.OrderId = NullHandler.GetString(dr["OrderId"]); itemOrder.SrId = NullHandler.GetString(dr["SrId"]); itemOrder.MarketId = NullHandler.GetString(dr["MarketId"]); itemOrder.OrderDate = NullHandler.GetDateTime(dr["Date"]); itemOrder.OrderCount = NullHandler.GetInt32(dr["OrderCount"]); itemOrder.ReturnCount = NullHandler.GetInt32(dr["ReturnCount"]); itemOrder.DamageCount = NullHandler.GetInt32(dr["DamagedCount"]); itemOrder.SellsCount = NullHandler.GetInt32(dr["SoldCount"]); itemOrder.CompanyId = NullHandler.GetString(dr["CompanyId"]); itemOrder.ItemId = NullHandler.GetString(dr["ItemId"]); itemOrder.ItemName = NullHandler.GetString(dr["ItemName"]); itemOrder.CountPerBox = NullHandler.GetInt32(dr["CountPerBox"]); itemOrder.Price = NullHandler.GetDouble(dr["Price"]); itemOrder.TotalPrice = Math.Round(itemOrder.Price * itemOrder.SellsCount, 2); itemOrder.StockId = NullHandler.GetString(dr["StockId"]); itemOrder.CurrentStockTotal = NullHandler.GetInt32(dr["TotalStock"]); itemOrder.CurrentDamagedStockTotal = NullHandler.GetInt32(dr["DamagedStock"]); itemOrder.ChalanNo = NullHandler.GetString(dr["ChalanNo"]); itemOrder.StockEntryDate = NullHandler.GetDateTime(dr["StockEntryDate"]); itemOrder.CalculateBoxesFromTotalStock(); itemOrder.CalculateOrdersInBox(); return(itemOrder); }