コード例 #1
0
ファイル: SimpleGrid.cs プロジェクト: zoluo/custompicklist
    public ResponseGrid MockData(RequestGrid request)
    {
        var res = new ResponseGrid { Id = request.Id, IsError = false, ErrDesc = "", CrmGrid = new MockData().CrmGrid };
        res.SettingGrid = request.SettingGrid;
        //res.SettingGrid.CurrentPage += 1;
        res.SettingGrid.MaxRows = 102;
        //res.SettingGrid.SortName = "MemberCount";

        return res;
    }
コード例 #2
0
    protected void Page_PreRender(object sender, EventArgs e)
    {
        QueueGrid.DataSource = Session["Queues"];
        QueueGrid.DataBind();

        lblRequests.Visible = true;

        if (Session["Requests"] != null)
        {
            RequestGrid.Visible    = true;
            pnlSelection.Visible   = true;
            RequestGrid.DataSource = Session["Requests"];
            RequestGrid.DataBind();
        }
        else
        {
            RequestGrid.Visible  = false;
            pnlSelection.Visible = false;
        }
    }
コード例 #3
0
        protected Task <List <T1> > DoPaingationAsync <T1>(IQueryable <T1> query, RequestGrid request)
        {
            if (request == null)
            {
                request = new RequestGrid
                {
                    Length = 10,
                    Start  = 0
                };
            }
            if (request.Length <= 0)
            {
                request.Length = 10;
            }

            request.Total = query.Count();

            request.Currentpage = (int)Math.Ceiling(request.Total / (double)request.Length);

            return(query.Skip(request.Start).Take(request.Length).ToListAsync());
        }
コード例 #4
0
        protected void SearchTool_Click(object sender, EventArgs e)
        {
            string query = "SELECT * FROM Maintenance WHERE NP='" + InputSearchTooling.Value + "';";

            if (InputSearchTooling.Value.EndsWith("*"))
            {
                query = "select * from maintenance where np like '%" + InputSearchTooling.Value.Trim('*') + "%'";
            }

            string connection = ConfigurationManager.ConnectionStrings["Tool"].ConnectionString;

            using (SqlConnection db = new SqlConnection(connection))
            {
                SqlCommand cmd = new SqlCommand(query, db);

                using (var adapter = new SqlDataAdapter(cmd))
                {
                    var maintenanceTable = new DataTable();
                    adapter.Fill(maintenanceTable);

                    if (maintenanceTable.Rows.Count > 0)
                    {
                        RequestGrid.DataSource = maintenanceTable;
                        RequestGrid.DataBind();
                    }
                    else
                    {
                        maintenanceTable.Rows.Add(maintenanceTable.NewRow());
                        RequestGrid.DataSource = maintenanceTable;
                        RequestGrid.DataBind();
                        int totalColums = RequestGrid.Rows[0].Cells.Count;
                        RequestGrid.Rows[0].Cells.Clear();
                        RequestGrid.Rows[0].Cells.Add(new TableCell());
                        RequestGrid.Rows[0].Cells[0].ColumnSpan = totalColums;
                        RequestGrid.Rows[0].Cells[0].Text       = "Tooling not found.";
                    }
                }
            }
        }
コード例 #5
0
        protected void btnSubmit_Click(object sender, EventArgs e)
        {
            using (SqlConnection connection = new SqlConnection(connectionString))
            {
                using (SqlCommand command = new SqlCommand("spSubmitLabourRequest", connection))
                {
                    command.CommandType = CommandType.StoredProcedure;
                    command.Parameters.Add("@dleCompanyId", SqlDbType.Int).Value = dlCompany.SelectedValue;
                    command.Parameters.Add("@dleCompanyName", SqlDbType.VarChar, 100).Direction = ParameterDirection.Output;
                    command.Parameters.Add("@requestEmail", SqlDbType.VarChar, 50).Direction    = ParameterDirection.Output;
                    command.Parameters.Add("@RequestNo", SqlDbType.VarChar).Value    = txtRequestNo.Text;
                    command.Parameters.Add("@submittedBy", SqlDbType.VarChar).Value  = Context.User.Identity.Name;
                    command.Parameters.Add("@return_value", SqlDbType.Int).Direction = ParameterDirection.ReturnValue;
                    try
                    {
                        connection.Open();
                        command.ExecuteNonQuery();
                        int retVal = Convert.ToInt16(command.Parameters["@return_value"].Value);
                        if (retVal == 0)
                        {
                            ScriptManager.RegisterStartupScript(this, this.GetType(), "", "toastr.success('Submitted Successfully', 'Success');", true);
                            ScriptManager.RegisterStartupScript(this, this.GetType(), "popup", "closenewModal();", true);
                            RequestGrid.Rebind();

                            sendEmail(command.Parameters["@dleCompanyName"].Value.ToString(), command.Parameters["@requestEmail"].Value.ToString(), txtRequestNo.Text, txtRequest.Text);

                            txtRequestNo.Text = "";
                            txtRequest.Text   = "";
                            btnSubmit.Enabled = false;
                        }
                    }
                    catch (Exception ex)
                    {
                        ScriptManager.RegisterStartupScript(this, this.GetType(), "ex", "toastr.error('" + ex.Message.Replace("'", "").Replace("\r\n", "") + "', 'Error');", true);
                    }
                }
            }
        }
コード例 #6
0
        private void NewTitle(string newTitle)
        {
            CurrentSong = newTitle;
            List <RequestGridItem> toDelete = new List <RequestGridItem>();

            foreach (var song in _requests)
            {
                if (newTitle.Contains(song.Song))
                {
                    toDelete.Add(song);
                    break;
                }
            }
            if (toDelete.Count == 0)
            {
                return;
            }
            foreach (var song in toDelete)
            {
                _requests.Remove(song);
            }
            RequestGrid.RefreshDataSource();
            UpdateRequestFile();
        }
コード例 #7
0
        private void Filldata()
        {
            string connection = ConfigurationManager.ConnectionStrings["Tool"].ConnectionString;

            using (var db = new SqlConnection(connection))
            {
                SqlCommand query = new SqlCommand(@"SELECT * FROM Repair;", db);

                using (var adapter = new SqlDataAdapter(query))
                {
                    var maintenanceTable = new DataTable();
                    adapter.Fill(maintenanceTable);

                    if (maintenanceTable.Rows.Count > 0)
                    {
                        RequestGrid.DataSource = maintenanceTable;
                        RequestGrid.DataBind();

                        DataRow[] rows  = maintenanceTable.Select();
                        var       count = 0;
                        foreach (var row in rows)
                        {
                            if (row["Status"].ToString() == "REQUESTED")
                            {
                                var btnAprove = new Button {
                                    ID = row["NP"].ToString(), Text = "OK"
                                };
                                btnAprove.CssClass = "btn btn-warning";
                                btnAprove.ToolTip  = "Aprovar Mantenimiento";
                                btnAprove.Click   += AproveRepair_Click;
                                RequestGrid.Rows[count].Cells[12].Controls.Add(btnAprove);
                            }
                            else
                            {
                                var btnStatus = new Button {
                                    ID = row["NP"].ToString(), Text = "OK",
                                };
                                btnStatus.CssClass = "btn btn-success";
                                btnStatus.ToolTip  = "Cambiar Status";
                                btnStatus.Click   += ChangeStatus_Click;
                                RequestGrid.Rows[count].Cells[12].Controls.Add(btnStatus);
                            }


                            PaintCells(count, row["NP"].ToString());

                            //var button = new Button { ID = row["ToolingID"].ToString(), Text = "Borrar", };
                            //button.CssClass = "btn btn-danger";
                            //button.ToolTip = "Borrar";
                            //button.Click+= Delete_Click;

                            //RequestGrid.Rows[count].Cells[12].Controls.Add(button);

                            ++count;
                        }
                    }
                    else
                    {
                        maintenanceTable.Rows.Add(maintenanceTable.NewRow());
                        RequestGrid.DataSource = maintenanceTable;
                        RequestGrid.DataBind();
                        int totalColums = RequestGrid.Rows[0].Cells.Count;
                        RequestGrid.Rows[0].Cells.Clear();
                        RequestGrid.Rows[0].Cells.Add(new TableCell());
                        RequestGrid.Rows[0].Cells[0].ColumnSpan = totalColums;
                        RequestGrid.Rows[0].Cells[0].Text       = "No hay reparaciones en curso.";
                    }
                }
            }
        }
コード例 #8
0
 public Task <List <Tasks> > GetPaginatedAsync(RequestGrid request, int userID)
 {
     return(this.repository.GetTasksPaginatedAsync(request, userID));
 }
コード例 #9
0
 public Task <List <Tasks> > GetTasksPaginatedAsync(RequestGrid request, int userID)
 {
     return(DoPaingationAsync(this.context.Tasks.Where(r => r.UserID == userID), request));
 }
コード例 #10
0
 protected void txtSearchReq_TextChanged(object sender, EventArgs e)
 {
     RequestGrid.Rebind();
 }
コード例 #11
0
 private void destroyRequestGrid()
 {
     Destroy(grid.gameObject);
     grid = null;
 }
コード例 #12
0
 public void AddRequest(RequestGridItem item)
 {
     _requests.Add(item);
     RequestGrid.RefreshDataSource();
     UpdateRequestFile();
 }
コード例 #13
0
        public async Task <IActionResult> GetTagsJson(RequestGrid model)
        {
            List <TasksListViewModel> response = mapper.Map <List <TasksListViewModel> >(await service.GetPaginatedAsync(model, GetUserID()));

            return(Ok(ConvertGridViewModel <TasksListViewModel>(response.ToArray(), model)));
        }