Exemple #1
0
        protected void gridResumen_ItemCommand(object sender, C1GridViewCommandEventArgs e)
        {
            if (e.CommandName == "Modificar")
            {
                var id = Convert.ToInt32(gridResumen.DataKeys[e.Row.RowIndex].Value);

                var doc = DAOFactory.DocumentoDAO.FindById(id);
                ParteSaveStrategy.SetValor(doc, ParteCampos.EstadoControl, 1, "0");
                DAOFactory.DocumentoDAO.SaveOrUpdate(doc);

                var selectedEquipos = new List <int> {
                    Convert.ToInt32(doc.Valores[ParteCampos.Equipo])
                };
                var selectedTipos = new List <int>
                {
                    doc.Valores.ContainsKey(ParteCampos.TipoServicio)
                                            ? Convert.ToInt32(doc.Valores[ParteCampos.TipoServicio])
                                            : 0
                };

                var listPartes = GetPartes(selectedEquipos, selectedTipos);

                IdPartes = listPartes.OfType <Documento>().Select(d => d.Id).ToList();

                SetViewIndex(1);
                lblCount.Text = listPartes.Count.ToString();
                LoadParte(0);
            }
        }
Exemple #2
0
 protected void GridConsumosItemCommand(object sender, C1GridViewCommandEventArgs e)
 {
     switch (e.CommandName)
     {
     case "Eliminar":
         DeleteConsumo(e.Row.RowIndex);
         break;
     }
 }
 protected void gridParametros_ItemCommand(object sender, C1GridViewCommandEventArgs e)
 {
     switch (e.CommandName)
     {
     case "Eliminar":
         DeleteParam(e.Row.RowIndex);
         break;
     }
 }
Exemple #4
0
 protected void GridResumenRowCommand(object sender, C1GridViewCommandEventArgs e)
 {
     if (e.CommandName == "Modificar")
     {
         var id    = Convert.ToInt32(gridResumen.DataKeys[e.Row.RowIndex].Value);
         var viaje = DAOFactory.ViajeDistribucionDAO.FindById(id);
         Controlar(viaje, false);
         SetView(Views.Resumen);
     }
 }
Exemple #5
0
    protected void grdPODtl_RowCommand(object sender, C1GridViewCommandEventArgs e)
    {
        Label label1 = (Label)base.Master.FindControl("lbltotalinfo");

        if (e.CommandName == "Select")
        {
            int    num  = int.Parse(e.CommandArgument.ToString());
            string text = this.grdPODtl.Rows[num].Cells[2].Text;
            this.stle(text);
            this.C1TabControl1.MoveFirst();
        }
    }
Exemple #6
0
    protected void grdEstimateCosting_RowCommand(object sender, C1GridViewCommandEventArgs e)
    {
        Label label = (Label)base.Master.FindControl("lbltotalinfo");

        label.Text = "";
        if (e.CommandName == "Select")
        {
            int   num    = int.Parse(e.CommandArgument.ToString());
            Label label2 = (Label)this.grdEstimateCosting.Rows[num].FindControl("lblStyleid");
            this.drpStyleno.SelectedValue = label2.Text.Trim();
            this.DrpSelectValue();
            this.C1TabControl1.MoveFirst();
        }
    }
    protected void grdEditview_RowCommand(object sender, C1GridViewCommandEventArgs e)
    {
        Label label = (Label)base.Master.FindControl("lbltotalinfo");

        label.Text = "";
        if (e.CommandName == "Select")
        {
            int    num  = int.Parse(e.CommandArgument.ToString());
            string text = this.grdEditview.Rows[num].Cells[1].Text;
            this.ViewState["AvailablePO"]  = null;
            this.ViewState["CurrentData"]  = null;
            this.grdAvailablePO.DataSource = null;
            this.grdAvailablePO.DataBind();
            this.grdSelectedPO.DataSource = null;
            this.grdSelectedPO.DataBind();
            this.grdItemDetail.DataSource = null;
            this.grdItemDetail.DataBind();
            this.drpSupplier.Enabled = true;
            DataSet set = this.blinventory.get_Informationdataset("select PI_ID,Supplier_ID,PI_No,PI_date,Shipment_Date,Currency,PI_Total from Smt_PIMaster where PI_No='" + text.Trim() + "'");
            if (set.Tables[0].Rows.Count > 0)
            {
                this.txtPIno.Text = text;
                this.txtPIno.Focus();
                this.drpSupplier.SelectedValue     = set.Tables[0].Rows[0]["Supplier_ID"].ToString();
                this.txtPIDate.Text                = set.Tables[0].Rows[0]["PI_date"].ToString();
                this.txtShipmentDate.Text          = set.Tables[0].Rows[0]["Shipment_Date"].ToString();
                this.drpCurrencyType.SelectedValue = set.Tables[0].Rows[0]["Currency"].ToString();
                this.txtTotalvalue.Text            = set.Tables[0].Rows[0]["PI_Total"].ToString();
                DataTable table = this.blinventory.get_InformationdataTable("select nPoNum from Smt_POHedder where nSuplierID=" + this.drpSupplier.SelectedValue + " and POApproved=1 and cPiNo is NULL order by nPoNum desc");
                this.ViewState["AvailablePO"] = table;
                DataTable table2 = this.blinventory.get_InformationdataTable("select distinct(PO_No) as nPoNum from Smt_PIDetails where PI_No='" + text.Trim() + "'");
                this.grdSelectedPO.DataSource = table2;
                this.grdSelectedPO.DataBind();
                this.ViewState["CurrentData"] = table2;
                DataTable table3 = (DataTable)this.ViewState["AvailablePO"];
                this.grdAvailablePO.DataSource = table3;
                this.grdAvailablePO.DataBind();
                this.ViewState["AvailablePO"] = table3;
                this.grdItemDetail.DataSource = this.blinventory.get_Informationdataset("Sp_Smt_PIDetails_GetByPINO '" + this.txtPIno.Text.Trim() + "'");
                this.grdItemDetail.DataBind();
                this.drpSupplier.Enabled = false;
                this.txtPIno.Enabled     = false;
                this.C1TabControl1.MoveFirst();
            }
        }
    }
 protected void C1GridView1_RowCommand(object sender, C1GridViewCommandEventArgs e)
 {
     this.lblErrmsg.Text = "";
     if (e.CommandName == "Select")
     {
         int       num       = int.Parse(e.CommandArgument.ToString());
         string    text      = this.C1GridView1.Rows[num].Cells[1].Text;
         string    statement = "select * from Smt_Suppliers where cSupCode='" + text + "'";
         DataTable table     = this.dlinventory.get_Alltbl(statement);
         this.txtCode.Text = table.Rows[0]["cSupCode"].ToString();
         string str4 = this.txtCode.Text.Substring(2, 2);
         this.drpSuppliertype.SelectedValue = str4;
         this.txtName.Text    = table.Rows[0]["cSupName"].ToString();
         this.txtAddress.Text = table.Rows[0]["cSupAdd1"].ToString();
         this.drpCountry.SelectedItem.Text = table.Rows[0]["cSupAdd2"].ToString();
         this.txtContact.Text         = table.Rows[0]["cSupContNo"].ToString();
         this.txtCod.Text             = table.Rows[0]["cSupValtNo"].ToString();
         this.txtAttention.Text       = table.Rows[0]["cAtt"].ToString();
         this.txtEmail.Text           = table.Rows[0]["cEmail"].ToString();
         this.lblsuplierid.Text       = table.Rows[0]["nCode"].ToString();
         this.txtAcntno.Text          = table.Rows[0]["suplierAccount"].ToString();
         this.btnSave.Visible         = false;
         this.btnUpdate.Visible       = true;
         this.drpSuppliertype.Enabled = false;
         foreach (GridViewRow row in this.GridView1.Rows)
         {
             CheckBox box = (CheckBox)row.FindControl("chkslect");
             box.Checked = false;
         }
         foreach (DataRow row2 in this.blinventory.get_InformationdataTable("select cManCat from Smt_SupSupManCat where cSupCode='" + text + "'").Rows)
         {
             foreach (GridViewRow row3 in this.GridView1.Rows)
             {
                 if (row3.Cells[1].Text == row2[0].ToString())
                 {
                     CheckBox box2 = (CheckBox)row3.FindControl("chkslect");
                     box2.Checked = true;
                 }
             }
         }
         this.C1TabControl1.MoveFirst();
     }
 }
Exemple #9
0
        protected override void OnRowCommand(C1GridView grid, C1GridViewCommandEventArgs e)
        {
            base.OnRowCommand(grid, e);

            if (e.CommandName != "CambiarEstado")
            {
                return;
            }

            var id = Convert.ToInt32(e.CommandArgument);

            var periodo = DAOFactory.PeriodoDAO.FindById(id);

            if (periodo.Estado > 0)
            {
                return;
            }
            periodo.Estado = 1;
            DAOFactory.PeriodoDAO.SaveOrUpdate(periodo);
            Bind();
        }
Exemple #10
0
        protected override void OnRowCommand(C1GridView grid, C1GridViewCommandEventArgs e)
        {
            if (e.CommandName == "TicketAjuste")
            {
                var id = Convert.ToInt32(Grid.DataKeys[e.Row.RowIndex].Value);
                IdPedido.Set(id);
                var cellCodigo  = GridUtils.GetCell(e.Row, ConsolaTicketsVo.Index.Codigo);
                var cellTickets = GridUtils.GetCell(e.Row, ConsolaTicketsVo.Index.Tickets);
                var cellM3      = GridUtils.GetCell(e.Row, ConsolaTicketsVo.Index.M3);
                var cellCliente = GridUtils.GetCell(e.Row, ConsolaTicketsVo.Index.Cliente);
                var cellPunto   = GridUtils.GetCell(e.Row, ConsolaTicketsVo.Index.PuntoEntrega);

                litAjustePedido.Text        = cellCodigo.Text;
                lblAjusteCliente.Text       = cellCliente.Text;
                lblAjustePuntoEntrega.Text  = cellPunto.Text;
                lblAjusteTickets.Text       = cellTickets.Text;
                lblAjusteM3.Text            = cellM3.Text;
                dtTicketAjuste.SelectedDate = DateTime.UtcNow.ToDisplayDateTime();
                modalPanel.Show();
            }
        }
Exemple #11
0
        protected void grid_RowCommand(object sender, C1GridViewCommandEventArgs e)
        {
            if (e.CommandName == "Delete")
            {
                var id = Convert.ToInt32(grid.DataKeys[e.Row.RowIndex].Value);

                if (id > 0)
                {
                    var di = DeletedIds.Get();
                    di.Add(id);
                    DeletedIds.Set(di);
                }
                else
                {
                    _deletedIndex = e.Row.RowIndex;
                }
                grid.RowDeleting += grid_RowDeleting;
                grid.DeleteRow(e.Row.RowIndex);
                BindParametros(false);
            }
        }
 protected void C1GridView1_RowCommand(object sender, C1GridViewCommandEventArgs e)
 {
     if (e.CommandName == "Select")
     {
         int       num       = int.Parse(e.CommandArgument.ToString());
         Label     label     = (Label)this.C1GridView1.Rows[num].Cells[1].FindControl("lblid");
         string    statement = "select * from Smt_Section where nSectionID=" + label.Text;
         DataTable table     = this.mycls.get_Alltbl(statement);
         this.lblsectid.Text               = table.Rows[0]["nSectionID"].ToString();
         this.drpCompany.SelectedValue     = table.Rows[0]["nCompanyID"].ToString();
         this.drpDepartment.DataSource     = this.mybll.get_Informationdataset("select nUserDept,cDeptname from Smt_Department where nCompanyID=" + this.drpCompany.SelectedValue + " order by cDeptname");
         this.drpDepartment.DataTextField  = "cDeptname";
         this.drpDepartment.DataValueField = "nUserDept";
         this.drpDepartment.DataBind();
         this.drpDepartment.SelectedValue = table.Rows[0]["nUserDept"].ToString();
         this.txtCarder.Text     = table.Rows[0]["nCarder"].ToString();
         this.txtSection.Text    = table.Rows[0]["cSection_Description"].ToString();
         this.txtSupervisor.Text = table.Rows[0]["cSupervisor"].ToString();
         this.btnSave.Text       = "Update";
         this.btnSave.ToolTip    = "Update";
         this.lblErrormsg.Text   = "";
     }
 }
Exemple #13
0
 protected void C1GridView1_RowCommand(object sender, C1GridViewCommandEventArgs e)
 {
     if (e.CommandName == "Select")
     {
         this.drpDepartment.Items.Clear();
         this.drpSection.Items.Clear();
         this.drpCompany.SelectedValue = "";
         this.drpUsergroup.Enabled     = true;
         int     num   = int.Parse(e.CommandArgument.ToString());
         Label   label = (Label)this.C1GridView1.Rows[num].Cells[1].FindControl("lblid");
         DataSet set   = this.mycls.get_Userbyid(label.Text);
         this.lblUserid.Text           = set.Tables[0].Rows[0]["nUserID"].ToString();
         this.txtUserid.Text           = set.Tables[0].Rows[0]["cUserName"].ToString();
         this.txtfullname.Text         = set.Tables[0].Rows[0]["cUserFullname"].ToString();
         this.txtEmail.Text            = set.Tables[0].Rows[0]["Email"].ToString();
         this.drpCompany.SelectedValue = set.Tables[0].Rows[0]["nCompanyID"].ToString();
         DataSet set2 = this.mybll.get_Informationdataset("select nUserDept,cDeptname from Smt_Department where nCompanyID=" + this.drpCompany.SelectedValue);
         this.drpDepartment.DataSource     = set2;
         this.drpDepartment.DataTextField  = "cDeptname";
         this.drpDepartment.DataValueField = "nUserDept";
         this.drpDepartment.DataBind();
         this.txtUserid.Enabled           = false;
         this.drpDepartment.SelectedValue = set.Tables[0].Rows[0]["nUserDept"].ToString();
         DataSet set3 = this.mybll.get_Informationdataset("select nSectionID,cSection_Description from Smt_Section where nUserDept=" + this.drpDepartment.SelectedValue);
         this.drpSection.DataSource     = set3;
         this.drpSection.DataTextField  = "cSection_Description";
         this.drpSection.DataValueField = "nSectionID";
         this.drpSection.DataBind();
         this.drpSection.SelectedValue = set.Tables[0].Rows[0]["nSectionID"].ToString();
         if (set.Tables[0].Rows[0]["nUgroup"].ToString() != "99")
         {
             this.drpUsergroup.SelectedValue = set.Tables[0].Rows[0]["nUgroup"].ToString();
         }
         this.txtPassword.Attributes["value"]        = set.Tables[0].Rows[0]["cPassWord"].ToString();
         this.txtconfirmpassword.Attributes["value"] = set.Tables[0].Rows[0]["cPassWord"].ToString();
         string str2 = set.Tables[0].Rows[0]["Permission_status"].ToString();
         if (set.Tables[0].Rows[0]["Activity_status"].ToString() == "A")
         {
             this.rdActive.Checked   = true;
             this.rdInactive.Checked = false;
         }
         else
         {
             this.rdInactive.Checked = true;
             this.rdActive.Checked   = false;
         }
         this.btnSave.Text    = "Update";
         this.btnSave.ToolTip = "Update";
         foreach (GridViewRow row in this.grdFormlist.Rows)
         {
             CheckBox box = (CheckBox)row.FindControl("chkSelect");
             box.Checked = false;
         }
         if (str2 == "U")
         {
             this.rdGroupwise.Checked             = false;
             this.RequiredFieldValidator9.Enabled = false;
             this.rdUserwise.Checked         = true;
             this.drpUsergroup.SelectedValue = "";
             this.drpUsergroup.Enabled       = false;
             foreach (GridViewRow row2 in this.grdFormlist.Rows)
             {
                 CheckBox box2 = (CheckBox)row2.FindControl("chkSelect");
                 box2.Enabled = true;
             }
             foreach (DataRow row3 in this.mybll.get_InformationdataTable("select Form_Name from Smt_UserPermittedform where User_ID='" + label.Text + "'").Rows)
             {
                 foreach (GridViewRow row4 in this.grdFormlist.Rows)
                 {
                     if (row4.Cells[1].Text == row3[0].ToString())
                     {
                         CheckBox box3 = (CheckBox)row4.FindControl("chkSelect");
                         box3.Checked = true;
                     }
                 }
             }
         }
         else
         {
             this.rdGroupwise.Checked             = true;
             this.RequiredFieldValidator9.Enabled = true;
             this.rdUserwise.Checked   = false;
             this.drpUsergroup.Enabled = true;
             foreach (GridViewRow row5 in this.grdFormlist.Rows)
             {
                 CheckBox box4 = (CheckBox)row5.FindControl("chkSelect");
                 box4.Enabled = false;
                 box4.Checked = false;
             }
         }
         if (this.txtUserid.Text == "Admin")
         {
             this.drpUsergroup.Enabled = false;
             this.rdInactive.Enabled   = false;
             this.rdUserwise.Enabled   = false;
             this.rdGroupwise.Enabled  = false;
             this.rdActive.Enabled     = false;
         }
         this.C1TabControl1.MoveFirst();
     }
 }
Exemple #14
0
 protected virtual void OnRowCommand(C1GridView grid, C1GridViewCommandEventArgs e)
 {
 }
Exemple #15
0
 void GridUtilsRowCommand(object sender, C1GridViewCommandEventArgs e)
 {
     OnRowCommand(Grid, e);
 }