Ejemplo n.º 1
0
        public List <Labour_Payments> Get_Labour_PaymentsRpt(string fromdate, string todate, string EmpID)
        {
            List <Labour_Payments> objList = new List <Labour_Payments>();

            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_Labour_PaymentsRpt", dsItems, new string[] { "tbl" }, mSQLPrm1);
            foreach (DataRow row1 in dsItems.Tables[0].Rows)
            {
                Labour_Payments objRecord = new Labour_Payments();
                objRecord.ID            = Convert.ToInt32(row1["ID"]);
                objRecord.SiteName      = row1["SiteName"].ToString();
                objRecord.EmpName       = row1["EmpName"].ToString();
                objRecord.PaymentFor    = Convert.ToString(row1["PaymentFor"]);
                objRecord.Amount        = Convert.ToDecimal(row1["Amount"]);
                objRecord.Dated         = row1["Dated"].ToString();
                objRecord.Comments      = row1["Comments"].ToString();
                objRecord.CreatedByName = row1["CreatedByName"].ToString();
                objList.Add(objRecord);
            }

            return(objList);
        }
Ejemplo n.º 2
0
        internal static SqlCommand Insert_Update_Labour_Payments(Labour_Payments 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("@EmpID", SqlDbType.Int, Convert.ToInt32(objEntity.EmpID)),
                CreateParameter("@PaymentFor", SqlDbType.VarChar, objEntity.PaymentFor),
                CreateParameter("@Amount", SqlDbType.Decimal, objEntity.Amount),
                CreateParameter("@Comments", SqlDbType.VarChar, objEntity.Comments),
                CreateParameter("@Flag", SqlDbType.Int, Convert.ToInt32(objEntity.Flag)),
                CreateParameter("@CreatedBy", SqlDbType.Int, Convert.ToInt32(objEntity.CreatedBy)),
                CreateParameter("@CreatedDate", SqlDbType.VarChar, objEntity.CreatedDate),
                CreateParameter("@Dated", SqlDbType.VarChar, objEntity.Dated),
            };

            return(CreateCommand("ins_Labour_Payments", parameters));
        }
Ejemplo n.º 3
0
 public List <Labour_Payments> Insert_Update_Labour_Payments(Labour_Payments objEntity)
 {
     return(SqlHelpers.GetObjects <Labour_Payments>(Util.Env, CommandFactory.Insert_Update_Labour_Payments(objEntity), AdminObjectFactory.Insert_Update_Labour_Payments_Factory));
 }