Example #1
0
        public static FundAllocationInfo[] GetAllocatedFunds()
        {
            ArrayList al = new ArrayList();
            int retValue = -1;
            //Generated Code for query : dbo.GetAllVendors
            using (SqlDataReader dr = ProjManagementAdmin.GetAllocatedFunds(out retValue)) //Initialize and retrieve code for Datareader goes here
            {

                while (dr.Read())
                {
                    FundAllocationInfo alloc = new FundAllocationInfo();

                    alloc.AllocationId = Convert.ToInt32(dr["allocation_id"]);
                    alloc.FundId = Convert.ToInt32(dr["fund_id"]);
                    alloc.FundDesc = dr["fund_desc"].ToString();
                    alloc.BeneficiaryId = Convert.ToInt32(dr["beneficiary_id"]);
                    alloc.BeneficiaryName = dr["beneficiary_name"].ToString();
                    alloc.AllocatedBy = dr["allocated_by"].ToString();
                    alloc.ChangedBy = dr["changed_by"].ToString();
                    alloc.AllocatedBy = dr["allocated_by"].ToString();
                    alloc.Amount = Convert.ToDecimal(dr["allocated_amount"]);

                    al.Add(alloc);
                }
                //dr.Close();
            }

            FundAllocationInfo[] allInfo = new FundAllocationInfo[al.Count];
            al.CopyTo(allInfo);
            return allInfo;
        }
Example #2
0
        public static int AddNewFA(FundAllocationInfo FA)
        {
            if ( FA == null)
                throw new ArgumentNullException("Fund is missing");

            int retValue = -1;
            return ProjManagementAdmin.AddNewFA(FA, out retValue);
        }
 public HttpResponseMessage Post(FundAllocationInfo FA)
 {
     try
     {
         FundAllocationBl.AddNewFA(FA);
         return new HttpResponseMessage(HttpStatusCode.OK);
     }
     catch (Exception ex)
     {
         return new HttpResponseMessage(HttpStatusCode.BadRequest);
     }
 }
Example #4
0
        private static SqlParameter[] GetAddNewFAParams(FundAllocationInfo FA)
        {
            SqlParameter[] sqlParms = new SqlParameter[100];
            sqlParms = SQLHelper.GetCachedParameters(PROC_ADDNEWFA);
            if (sqlParms == null)
            {
                sqlParms = new SqlParameter[]
                            {
                                new SqlParameter(PARAM_RETURN, SqlDbType.Int),
                                new SqlParameter(PARAM_FUND_ID, SqlDbType.Int),
                                new SqlParameter(PARAM_BENEFICIARY_ID, SqlDbType.Int),
                                new SqlParameter(PARAM_CHANGEDBY, SqlDbType.NVarChar, 100),
                                new SqlParameter(PARAM_ALLOCATEDBY, SqlDbType.NVarChar, 100),
                                new SqlParameter(PARAM_ALLOCATED_AMOUNT, SqlDbType.Float)
                            };

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

            //Assigning values to parameter
            sqlParms[0].Value = -1;
            sqlParms[1].Value = FA.FundId;
            sqlParms[2].Value = FA.BeneficiaryId;
            sqlParms[3].Value = "vysali";
            sqlParms[4].Value = "vysali";
            sqlParms[5].Value = FA.Amount;

            return sqlParms;
        }
Example #5
0
 public static int AddNewFA(FundAllocationInfo FA, out int retValue)
 {
     retValue = -1;
     SqlParameter[] parms = GetAddNewFAParams(FA);
     return ExecuteNonQuery(PROC_ADDNEWFA, parms, out retValue);
 }
Example #6
0
 public static int AddNewFA(FundAllocationInfo FA)
 {
     return FundAllocationDal.AddNewFA(FA);
 }