public void SaveRecord(Invest_ProductRepo productRepo) { try { //Get Connection AppSettings app = new AppSettings(); con = app.GetConnection(); DynamicParameters param = new DynamicParameters(); param.Add(name: "P_PRODUCT_ID", value: productRepo.Product_Id, dbType: DbType.String, direction: ParameterDirection.Input); param.Add(name: "P_PRODUCT_NAME", value: productRepo.Product_Name, dbType: DbType.String, direction: ParameterDirection.Input); param.Add(name: "P_NPRA_CLASS_ID", value: productRepo.NPRA_Asset_Class_Id, dbType: DbType.String, direction: ParameterDirection.Input); param.Add(name: "P_CLASS_ID", value: productRepo.Class_Id, dbType: DbType.String, direction: ParameterDirection.Input); param.Add(name: "P_EQUITY_CIS_UNIT_PRICE", value: productRepo.Equity_CIS_Unit_Price, dbType: DbType.Decimal, direction: ParameterDirection.Input); param.Add(name: "P_LISTED", value: productRepo.Listed, dbType: DbType.String, direction: ParameterDirection.Input); param.Add(name: "P_BOND_TYPE", value: productRepo.Bond_Class, dbType: DbType.String, direction: ParameterDirection.Input); param.Add(name: "P_MAKER_ID", value: GlobalValue.User_ID, dbType: DbType.String, direction: ParameterDirection.Input); param.Add(name: "P_UPDATE_ID", value: GlobalValue.User_ID, dbType: DbType.String, direction: ParameterDirection.Input); param.Add(name: "P_MAKE_DATE", value: GlobalValue.Scheme_Today_Date, dbType: DbType.DateTime, direction: ParameterDirection.Input); param.Add(name: "P_UPDATE_DATE", value: GlobalValue.Scheme_Today_Date, dbType: DbType.DateTime, direction: ParameterDirection.Input); param.Add(name: "P_FIX_FLOATING", value: productRepo.Fix_Floating, dbType: DbType.String, direction: ParameterDirection.Input); con.Execute("MIX_INVEST_PRODUCT", param, commandType: CommandType.StoredProcedure); } catch (Exception ex) { throw ex; } finally { if (con.State == ConnectionState.Open) { con.Close(); if (con != null) { con = null; } } } }
public void getclasscode(Invest_ProductRepo ProductRepo) { try { if (string.IsNullOrEmpty(ProductRepo.Class_Id)) { } else { //Get connection var con = new AppSettings(); var param = new DynamicParameters(); param.Add("P_CLASS_ID", ProductRepo.Class_Id, DbType.String, ParameterDirection.Input); param.Add("VDATA", "", DbType.String, ParameterDirection.Output); con.GetConnection().Execute("SEL_INVEST_CLASS_ID", param, commandType: CommandType.StoredProcedure); ProductRepo.Class_Id = param.Get <String>("VDATA"); } } catch (Exception ex) { throw ex; } }