Beispiel #1
0
        public List <Req_Money> Get_Req_MoneyRpt(string fromdate, string todate, string EmpID)
        {
            List <Req_Money> objList = new List <Req_Money>();

            DataSet dsItems = new DataSet();

            SqlParameter[] mSQLPrm1 = new SqlParameter[3];
            mSQLPrm1[0]       = new SqlParameter("@fromdate", SqlDbType.VarChar, 100);
            mSQLPrm1[0].Value = fromdate;
            mSQLPrm1[1]       = new SqlParameter("@todate", SqlDbType.VarChar, 100);
            mSQLPrm1[1].Value = todate;
            mSQLPrm1[2]       = new SqlParameter("@EmpID", SqlDbType.Int, 10);
            mSQLPrm1[2].Value = Convert.ToInt32(EmpID);
            SqlHelper.FillDataset(oConnectionString, CommandType.StoredProcedure, "Get_Req_MoneyRpt", dsItems, new string[] { "tbl" }, mSQLPrm1);
            foreach (DataRow row1 in dsItems.Tables[0].Rows)
            {
                Req_Money objRecord = new Req_Money();
                objRecord.ID             = Convert.ToInt32(row1["ID"]);
                objRecord.SiteName       = row1["SiteName"].ToString();
                objRecord.Expense_Type   = row1["Expense_Type"].ToString();
                objRecord.ApprovedStatus = Convert.ToString(row1["ApprovedStatus"]);
                objRecord.Amount         = Convert.ToDecimal(row1["Amount"]);
                objRecord.CreatedDate    = row1["CreatedDate"].ToString();
                objRecord.Comments       = row1["Comments"].ToString();
                objRecord.CreatedByName  = row1["CreatedByName"].ToString();
                objList.Add(objRecord);
            }

            return(objList);
        }
        internal static SqlCommand Insert_Update_Req_Money(Req_Money objEntity)
        {
            string ip = System.Web.HttpContext.Current.Request.ServerVariables["HTTP_X_FORWARDED_FOR"];

            if (string.IsNullOrEmpty(ip))
            {
                ip = System.Web.HttpContext.Current.Request.ServerVariables["REMOTE_ADDR"];
            }

            var parameters = new[]
            {
                CreateParameter("@action", SqlDbType.VarChar, objEntity.action),
                CreateParameter("@ID", SqlDbType.Int, Convert.ToInt32(objEntity.ID)),
                CreateParameter("@SiteID", SqlDbType.Int, Convert.ToInt32(objEntity.SiteID)),
                CreateParameter("@ExpenseType", SqlDbType.Int, Convert.ToInt32(objEntity.ExpenseType)),
                CreateParameter("@Amount", SqlDbType.Decimal, objEntity.Amount),
                CreateParameter("@Comments", SqlDbType.VarChar, objEntity.Comments),
                CreateParameter("@IsApproved", SqlDbType.Int, Convert.ToInt32(objEntity.IsApproved)),
                CreateParameter("@Flag", SqlDbType.Int, Convert.ToInt32(objEntity.Flag)),
                CreateParameter("@CreatedBy", SqlDbType.Int, Convert.ToInt32(objEntity.CreatedBy)),
                CreateParameter("@CreatedDate", SqlDbType.VarChar, objEntity.CreatedDate),
                CreateParameter("@ApprovedBy", SqlDbType.Int, Convert.ToInt32(objEntity.ApprovedBy)),
                CreateParameter("@ApprovedDate", SqlDbType.VarChar, objEntity.ApprovedDate),
            };

            return(CreateCommand("ins_Req_Money", parameters));
        }
Beispiel #3
0
 public List <Req_Money> Insert_Update_Req_Money(Req_Money objEntity)
 {
     return(SqlHelpers.GetObjects <Req_Money>(Util.Env, CommandFactory.Insert_Update_Req_Money(objEntity), AdminObjectFactory.Insert_Update_Req_Money_Factory));
 }