예제 #1
0
        public HttpResponseMessage Post(FundInfo fund)
        {
            try
            {

                FundBl.AddNewFund(fund);
                return new HttpResponseMessage(HttpStatusCode.OK);
            }
            catch (Exception)
            {
                return new HttpResponseMessage(HttpStatusCode.BadRequest);
            }
        }
예제 #2
0
        private static SqlParameter[] GetAddFundParams(FundInfo fund)
        {
            SqlParameter[] sqlParms = new SqlParameter[100];
            sqlParms = SQLHelper.GetCachedParameters(PROC_ADDNEWFUND);
            if (sqlParms == null)
            {
                sqlParms = new SqlParameter[]
                            {
                                new SqlParameter(PARAM_RETURN, SqlDbType.Int),
                                new SqlParameter(PARAM_FUND_DESC, SqlDbType.NVarChar, 100),
                                new SqlParameter(PARAM_FUND_AMOUNT, SqlDbType.Float),
                              new SqlParameter(PARAM_CHANGEDBY, SqlDbType.NVarChar, 50)

                            };

                sqlParms[0].Direction = ParameterDirection.ReturnValue;
                SQLHelper.CacheParameters(PROC_ADDNEWFUND, sqlParms);
            }

            //Assigning values to parameter
            sqlParms[0].Value = -1;
            sqlParms[1].Value = fund.FundDesc;
            sqlParms[2].Value = fund.FundAmount;
            sqlParms[3].Value = "vysali";

            return sqlParms;
        }
예제 #3
0
 public static int UpdateFund(FundInfo fund, out int retValue)
 {
     retValue = -1;
     SqlParameter[] parms = GetUpdateFundParams(fund);
     return ExecuteNonQuery(PROC_UPDATEFUND, parms, out retValue);
 }
예제 #4
0
 public static int AddNewFund(FundInfo fund, out int retValue)
 {
     retValue = -1;
     SqlParameter[] parms = GetAddFundParams(fund);
     return ExecuteNonQuery(PROC_ADDNEWFUND, parms, out retValue);
 }
예제 #5
0
 public HttpResponseMessage Post(FundInfo fund)
 {
     return FundBl.UpdateFund(fund);
 }
예제 #6
0
 public FundInfo Get(int id)
 {
     FundInfo fund = new FundInfo();
     fund = FundBl.GetFundById(id);
     return fund;
 }