public Result SaveDETPurchaseBill(DETPurchaseBillDTO oDETPurchaseBillDTO) { try { // PurchaseBillId //sessionState.SetCachedValue(privateKey, {some integer value}); using (DbCommand cmd = Common.dbConn.GetStoredProcCommand("DETPurchaseBillSave")) { Common.dbConn.AddInParameter(cmd, "@MSTPurchaseBillId", DbType.Int32, oDETPurchaseBillDTO.Id); Common.dbConn.AddInParameter(cmd, "@SNo", DbType.Int32, oDETPurchaseBillDTO.SNo); Common.dbConn.AddInParameter(cmd, "@MaterialDesc", DbType.Int32, oDETPurchaseBillDTO.MaterialDesc); Common.dbConn.AddInParameter(cmd, "@UMO", DbType.Int32, oDETPurchaseBillDTO.UMOId); Common.dbConn.AddInParameter(cmd, "@Qty", DbType.Double, oDETPurchaseBillDTO.Qty); Common.dbConn.AddInParameter(cmd, "@Rate", DbType.Double, oDETPurchaseBillDTO.Rate); Common.dbConn.AddInParameter(cmd, "@DiscPerc", DbType.Double, oDETPurchaseBillDTO.DiscPerc); Common.dbConn.AddInParameter(cmd, "@DicsAmount", DbType.Double, oDETPurchaseBillDTO.DicsAmount); Common.dbConn.AddInParameter(cmd, "@ExciseDuty", DbType.Double, oDETPurchaseBillDTO.ExciseDuty); Common.dbConn.AddInParameter(cmd, "@ECess", DbType.Double, oDETPurchaseBillDTO.ECess); Common.dbConn.AddInParameter(cmd, "@HECessPerc", DbType.Double, oDETPurchaseBillDTO.HECessPerc); Common.dbConn.AddInParameter(cmd, "@HECessAmount", DbType.Double, oDETPurchaseBillDTO.HECessAmount); Common.dbConn.AddInParameter(cmd, "@Tariff", DbType.String, oDETPurchaseBillDTO.Tariff); if (oDETPurchaseBillDTO.InvoiceDate == DateTime.MinValue) { Common.dbConn.AddInParameter(cmd, "@InvoiceDate", DbType.Date, System.DBNull.Value); } else { Common.dbConn.AddInParameter(cmd, "@InvoiceDate", DbType.Date, oDETPurchaseBillDTO.InvoiceDate); } if (oDETPurchaseBillDTO.ETADate == DateTime.MinValue) { Common.dbConn.AddInParameter(cmd, "@ETADate", DbType.Date, System.DBNull.Value); } else { Common.dbConn.AddInParameter(cmd, "@ETADate", DbType.Date, oDETPurchaseBillDTO.ETADate); } Common.dbConn.AddInParameter(cmd, "@Specs", DbType.String, oDETPurchaseBillDTO.Specs); Common.dbConn.AddInParameter(cmd, "@TotalAmount", DbType.Double, oDETPurchaseBillDTO.TotalAmount); Common.dbConn.AddInParameter(cmd, "@CVDAmount", DbType.Double, oDETPurchaseBillDTO.CVDAmount); Common.dbConn.ExecuteNonQuery(cmd); return(new Result { Id = 1, Message = "Saved", ResultStatus = OperationStatus.SavedSuccessFully }); } } catch (Exception ex) { throw ex; } return(null); }
public Result SaveDETPurchaseBill(ERPDTOBase obj) { DETPurchaseBillDTO oDETPurchaseBillDTO = obj as DETPurchaseBillDTO; return(new PurchaseBillDAL().SaveDETPurchaseBill(oDETPurchaseBillDTO)); }