public List <int> CreateOrderFIDetails(OrderVo orderVo, FIOrderVo fiorderVo, int userId, string Mode, int EmpId) { List <int> orderIds = new List <int>(); try { orderIds = fiOrderDao.CreateOrderFIDetails(orderVo, fiorderVo, userId, Mode, EmpId); } catch (BaseApplicationException Ex) { throw Ex; } return(orderIds); }
public List <int> CreateOrderFIDetails(OrderVo orderVo, FIOrderVo FIorderVo, int userId, string Mode, int EmpId) { List <int> orderIds = new List <int>(); int OrderId; Database db; DbCommand createFIOrderTrackingCmd; try { db = DatabaseFactory.CreateDatabase("wealtherp"); if (Mode == "Submit") { createFIOrderTrackingCmd = db.GetStoredProcCommand("[SP_CreateCustomerFIOrderDetails]"); db.AddOutParameter(createFIOrderTrackingCmd, "@CO_OrderId", DbType.Int32, orderVo.OrderId); } else { createFIOrderTrackingCmd = db.GetStoredProcCommand("SP_UpdateCustomerFIOrderDetails"); db.AddInParameter(createFIOrderTrackingCmd, "@CO_OrderId", DbType.Int32, orderVo.OrderNumber); } if (orderVo.OrderDate != DateTime.MinValue) { db.AddInParameter(createFIOrderTrackingCmd, "@CO_OrderDate", DbType.DateTime, orderVo.OrderDate); } else { db.AddInParameter(createFIOrderTrackingCmd, "@CO_OrderDate", DbType.DateTime, DBNull.Value); } // db.AddInParameter(createFIOrderTrackingCmd, "@CO_OrderDate", DbType.DateTime, orderVo.OrderDate ); db.AddInParameter(createFIOrderTrackingCmd, "@CustomerId", DbType.Int32, orderVo.CustomerId); db.AddInParameter(createFIOrderTrackingCmd, "@EmpId", DbType.Int32, EmpId); db.AddInParameter(createFIOrderTrackingCmd, "@WOSR_SourceCode", DbType.String, ""); db.AddInParameter(createFIOrderTrackingCmd, "@ApplicationNumber", DbType.String, orderVo.ApplicationNumber); if (orderVo.ApplicationReceivedDate != DateTime.MinValue) { db.AddInParameter(createFIOrderTrackingCmd, "@ApplicationReceivedDate", DbType.DateTime, orderVo.ApplicationReceivedDate); } else { db.AddInParameter(createFIOrderTrackingCmd, "@ApplicationReceivedDate", DbType.DateTime, DBNull.Value); } db.AddInParameter(createFIOrderTrackingCmd, "@ChequeNumber", DbType.String, orderVo.ChequeNumber); if (orderVo.PaymentDate != DateTime.MinValue) { db.AddInParameter(createFIOrderTrackingCmd, "@PaymentDate", DbType.DateTime, orderVo.PaymentDate); } else { db.AddInParameter(createFIOrderTrackingCmd, "@PaymentDate", DbType.DateTime, DBNull.Value); } db.AddInParameter(createFIOrderTrackingCmd, "@CustBankAccId", DbType.Int32, orderVo.CustBankAccId); db.AddInParameter(createFIOrderTrackingCmd, "@AA_AdviserAssociateId", DbType.Int32, orderVo.AssociationId); db.AddInParameter(createFIOrderTrackingCmd, "@AAC_AdviserAgentId", DbType.Int32, orderVo.AgentId); db.AddInParameter(createFIOrderTrackingCmd, "@AAC_AgentCode", DbType.String, orderVo.AgentCode); db.AddInParameter(createFIOrderTrackingCmd, "@AssetGroupCode", DbType.String, orderVo.AssetGroup); db.AddInParameter(createFIOrderTrackingCmd, "@PaymentMode", DbType.String, orderVo.PaymentMode); db.AddInParameter(createFIOrderTrackingCmd, "@Isclose", DbType.Int32, 0); db.AddInParameter(createFIOrderTrackingCmd, "@PAIC_AssetInstrumentCategoryCode", DbType.String, FIorderVo.AssetInstrumentCategoryCode); db.AddInParameter(createFIOrderTrackingCmd, "@PFIIM_IssuerId", DbType.String, FIorderVo.IssuerId); db.AddInParameter(createFIOrderTrackingCmd, "@PFISM_SchemeId", DbType.Int32, FIorderVo.SchemeId); db.AddInParameter(createFIOrderTrackingCmd, "@PFISD_SeriesId", DbType.Int32, FIorderVo.SeriesId); db.AddInParameter(createFIOrderTrackingCmd, "@CFIOD_TransactionType", DbType.String, FIorderVo.TransactionType); db.AddInParameter(createFIOrderTrackingCmd, "@CFIOD_OrderNO", DbType.String, orderVo.OrderNumber); db.AddInParameter(createFIOrderTrackingCmd, "@CFIOD_AmountPayable", DbType.Double, FIorderVo.AmountPayable); db.AddInParameter(createFIOrderTrackingCmd, "@CFIOD_ModeOfHolding", DbType.String, FIorderVo.ModeOfHolding); db.AddInParameter(createFIOrderTrackingCmd, "@CFIOD_SchemeOption", DbType.String, FIorderVo.Schemeoption); db.AddInParameter(createFIOrderTrackingCmd, "@CFIOD_DepositPayableTo", DbType.String, FIorderVo.Depositpayableto); db.AddInParameter(createFIOrderTrackingCmd, "@CFIOD_Frequency", DbType.String, FIorderVo.Frequency); db.AddInParameter(createFIOrderTrackingCmd, "@CFIOD_Privilidge", DbType.String, FIorderVo.Privilidge); db.AddInParameter(createFIOrderTrackingCmd, "@CFIOD_ExisitingDepositreceiptno", DbType.String, FIorderVo.ExisitingDepositreceiptno); db.AddInParameter(createFIOrderTrackingCmd, "@CFIOD_RenewalAmount", DbType.Double, FIorderVo.RenewalAmount); if (FIorderVo.MaturityDate != DateTime.MinValue) { db.AddInParameter(createFIOrderTrackingCmd, "@CFIOD_MaturityDate", DbType.DateTime, FIorderVo.MaturityDate); } else { db.AddInParameter(createFIOrderTrackingCmd, "@CFIOD_MaturityDate", DbType.DateTime, DBNull.Value); } //db.AddInParameter(createFIOrderTrackingCmd, "@CFIOD_MaturityDate", DbType.DateTime, FIorderVo.MaturityDate); db.AddInParameter(createFIOrderTrackingCmd, "@CFIOD_MaturityAmount", DbType.Double, FIorderVo.MaturityAmount); db.AddInParameter(createFIOrderTrackingCmd, "@CFIOD_DepCustBankAccId", DbType.Int32, FIorderVo.DepCustBankAccId); db.AddInParameter(createFIOrderTrackingCmd, "@AgentId", DbType.Int32, FIorderVo.AgentId); db.AddInParameter(createFIOrderTrackingCmd, "@UserId", DbType.Int32, userId); if (FIorderVo.DematAccountId != 0) { db.AddInParameter(createFIOrderTrackingCmd, "@DematAcntId", DbType.Int32, FIorderVo.DematAccountId); } db.AddInParameter(createFIOrderTrackingCmd, "@Qty", DbType.Double, FIorderVo.Qty); db.AddInParameter(createFIOrderTrackingCmd, "@BranchName", DbType.String, orderVo.BankBranchName); db.AddInParameter(createFIOrderTrackingCmd, "@AssetInstrumentCategory", DbType.String, FIorderVo.AssetInstrumentCategory); if (!string.IsNullOrEmpty(FIorderVo.BrokerCode)) { db.AddInParameter(createFIOrderTrackingCmd, "@BrokerCode", DbType.String, FIorderVo.BrokerCode); } if (!string.IsNullOrEmpty(FIorderVo.ADRNo)) { db.AddInParameter(createFIOrderTrackingCmd, "@ADRNO", DbType.String, FIorderVo.ADRNo); } db.AddInParameter(createFIOrderTrackingCmd, "@CO_Remarks", DbType.String, orderVo.Remarks); if (db.ExecuteNonQuery(createFIOrderTrackingCmd) != 0) { if (Mode == "Submit") { OrderId = Convert.ToInt32(db.GetParameterValue(createFIOrderTrackingCmd, "CO_OrderId").ToString()); orderIds.Add(OrderId); } } else { orderIds = null; } } catch (BaseApplicationException Ex) { throw Ex; } return(orderIds); }