Ejemplo n.º 1
0
        private void Service_SpareUsage(int pageIndex, int pageSize)
        {
            Business.Service.ServiceBook objServiceBook = new Business.Service.ServiceBook();
            Entity.Service.ServiceBook   serviceBook    = new Entity.Service.ServiceBook()
            {
                CustomerName  = txtCustomerName.Text.Trim(),
                RequestNo     = txtCallNo.Text.Trim(),
                ItemId        = int.Parse(ddlItem.SelectedValue),
                EmployeeId_FK = int.Parse(ddlEmployee.SelectedValue),
                FromDate      = (string.IsNullOrEmpty(txtFromLogRequestDate.Text.Trim())) ? DateTime.MinValue : Convert.ToDateTime(txtFromLogRequestDate.Text.Trim()),
                ToDate        = (string.IsNullOrEmpty(txtToLogRequestDate.Text.Trim())) ? DateTime.MinValue : Convert.ToDateTime(txtToLogRequestDate.Text.Trim()),
                PageIndex     = pageIndex,
                PageSize      = pageSize
            };

            DataSet ds = objServiceBook.Service_SpareUsage(serviceBook);

            gvSpareUsage.DataSource       = ds.Tables[0];
            gvSpareUsage.VirtualItemCount = (ds.Tables[1].Rows.Count > 0) ? Convert.ToInt32(ds.Tables[1].Rows[0]["TotalCount"].ToString()) : 10;
            gvSpareUsage.DataBind();
        }