protected void RadToolBar1_ButtonClick(object sender, Telerik.Web.UI.RadToolBarEventArgs e)
 {
     if (e.Item.Value == "Refresh" || e.Item.Value == "HideFinished")
     {
         ReBind();
     }
 }
        protected void rtb1_ButtonClick(object sender, Telerik.Web.UI.RadToolBarEventArgs e)
        {
            try
            {
                if (!_PermisoImprimir)
                {
                    this.Alerta("No tiene permisos para ver el reporte");
                    return;
                }
                ErrorManager();
                RadToolBarButton btn = e.Item as RadToolBarButton;

                if (Page.IsValid)
                {
                    if (btn.CommandName == "print")
                    {
                        this.Imprimir();
                    }
                }
            }
            catch (Exception ex)
            {
                ErrorManager(ex, new System.Diagnostics.StackTrace().GetFrame(0).GetMethod().Name);
            }
        }
Exemple #3
0
        protected void RadToolBar1_ButtonClick(object sender, Telerik.Web.UI.RadToolBarEventArgs e)
        {
            string accionError = string.Empty;

            try
            {
                RadToolBarButton btn = e.Item as RadToolBarButton;
                switch (btn.CommandName)
                {
                case "Mostrar":
                    if (Page.IsValid)
                    {
                        this.Mostrar(true);    //true
                    }
                    break;

                case "excel":
                    if (Page.IsValid)
                    {
                        this.Mostrar(false);
                    }
                    break;
                }
            }
            catch (Exception ex)
            {
                ErrorManager(ex, new System.Diagnostics.StackTrace().GetFrame(0).GetMethod().Name);
            }
        }
Exemple #4
0
        protected void RadToolBar1_ButtonClick(object sender, Telerik.Web.UI.RadToolBarEventArgs e)
        {
            string accionError = string.Empty;

            try
            {
                RadToolBarButton btn = e.Item as RadToolBarButton;
                if (_PermisoImprimir)
                {
                    switch (btn.CommandName)
                    {
                    case "Mostrar":
                        Mostrar(true);
                        break;

                    case "excel":
                        Mostrar(false);
                        break;
                    }
                }
                else
                {
                    Alerta("No tiene permiso para imprimir");
                }
            }
            catch (Exception ex)
            {
                throw ex;
            }
        }
Exemple #5
0
 protected void rtb1_ButtonClick(object sender, Telerik.Web.UI.RadToolBarEventArgs e)
 {
     try
     {
         if (Page.IsValid)
         {
             ErrorManager();
             RadToolBarButton btn = e.Item as RadToolBarButton;
             if (btn.CommandName == "save")
             {
                 //Guardar();
             }
             else if (btn.CommandName == "new")
             {
                 rgCalendario.Visible = false;
                 rgGuardar.Visible    = true;
             }
             else if (btn.CommandName == "undo")
             {
                 rgCalendario.Visible = true;
                 rgGuardar.Visible    = false;
             }
         }
     }
     catch (Exception ex)
     {
         ErrorManager(ex, "rtb1_ButtonClick");
     }
 }
Exemple #6
0
 protected void rtb1_ButtonClick(object sender, Telerik.Web.UI.RadToolBarEventArgs e)
 {
     try
     {
         ErrorManager();
         RadToolBarButton btn = e.Item as RadToolBarButton;
         if (btn.CommandName == "save")
         {
             if (Page.IsValid)
             {
                 Guardar();
             }
         }
         else if (btn.CommandName == "new")
         {
             Nuevo();
         }
         else if (btn.CommandName == "undo")
         {
             //Regresar()
         }
     }
     catch (Exception ex)
     {
         ErrorManager(ex, "rtb1_ButtonClick");
     }
 }
        protected void RadToolBar1_ButtonClick(object sender, Telerik.Web.UI.RadToolBarEventArgs e)
        {
            string accionError = string.Empty;

            try
            {
                RadToolBarButton btn = e.Item as RadToolBarButton;

                switch (btn.CommandName)
                {
                case "new":
                    //if (this.hiddenPanelActivo.Value == "fam")
                    //    this.Nuevo();
                    //else
                    //    this.NuevoSubFamilia();
                    break;

                case "save":
                    Guardar();
                    break;
                }
            }
            catch (Exception ex)
            {
                ErrorManager(ex, "RadToolBar1_ButtonClick");
            }
        }
Exemple #8
0
        protected void rtb1_ButtonClick(object sender, Telerik.Web.UI.RadToolBarEventArgs e)
        {
            try
            {
                string Evento = Request.Form["__EVENTTARGET"].ToString();

                if (!_PermisoImprimir)
                {
                    this.Alerta("No tiene permisos para ver el reporte");
                    return;
                }
                ErrorManager();
                RadToolBarButton btn = e.Item as RadToolBarButton;
                if (Page.IsValid)
                {
                    if (btn.CommandName == "print")
                    {
                        Imprimir();
                    }
                }
            }
            catch (Exception ex)
            {
                Alerta("Imposible generar el reporte; aún no se han generado los respaldos del mes y año seleccionados");
            }
        }
 protected void rtb1_ButtonClick(object sender, Telerik.Web.UI.RadToolBarEventArgs e)
 {
     try
     {
         if (Page.IsValid)
         {
             ErrorManager();
             RadToolBarButton btn = e.Item as RadToolBarButton;
             if (btn.CommandName == "save")
             {
                 Guardar();
             }
             else if (btn.CommandName == "new")
             {
                 Nuevo();
             }
             else if (btn.CommandName == "print")
             {
                 this.Listado(true);
             }
             else if (btn.CommandName == "excel")
             {
                 this.Listado(false);
             }
         }
     }
     catch (Exception ex)
     {
         ErrorManager(ex, "rtb1_ButtonClick");
     }
 }
Exemple #10
0
 protected void RadToolBar1_ButtonClick(object sender, Telerik.Web.UI.RadToolBarEventArgs e)
 {
     try
     {
         ErrorManager();
         RadToolBarButton btn = e.Item as RadToolBarButton;
         if (btn.CommandName == "save")
         {
             if (this.RadTabStripPrincipal.SelectedIndex == 0)
             {
                 GuardarMovimiento();
             }
             else
             {
                 GuardarAplicacion();
             }
         }
         else if (btn.CommandName == "new")
         {
             Nuevo();
         }
         else if (btn.CommandName == "print")
         {
             Imprimir();
         }
         //}
     }
     catch (Exception ex)
     {
         ErrorManager(ex, "RadToolBar1_ButtonClick");
     }
 }
Exemple #11
0
 protected void rtb1_ButtonClick(object sender, Telerik.Web.UI.RadToolBarEventArgs e)
 {
     try
     {
         if (Page.IsValid)
         {
             ErrorManager();
             RadToolBarButton btn = e.Item as RadToolBarButton;
             if (btn.CommandName == "save")
             {
                 Guardar();
                 //HiddenRebind.Value = "1";
             }
             else if (btn.CommandName == "new")
             {
                 Nuevo();
             }
             else if (btn.CommandName == "undo")
             {
                 //CerrarVentana();
             }
         }
     }
     catch (Exception ex)
     {
         ErrorManager(ex, new System.Diagnostics.StackTrace().GetFrame(0).GetMethod().Name);
     }
 }
        protected void rtb1_ButtonClick(object sender, Telerik.Web.UI.RadToolBarEventArgs e)
        {
            try
            {
                if (!_PermisoImprimir)
                {
                    this.Alerta("No tiene permisos para ver el reporte");
                    return;
                }
                ErrorManager();
                RadToolBarButton btn = e.Item as RadToolBarButton;

                if (this.dpFecha2.SelectedDate < this.dpFecha1.SelectedDate)
                {
                    this.Alerta("La fecha inicial no puede ser mayor a la fecha final");
                    this.dpFecha1.Focus();
                    return;
                }
                if (Page.IsValid)
                {
                    if (btn.CommandName == "print")
                    {
                        this.Imprimir(true);
                    }
                    else
                    {
                        this.Imprimir(false);
                    }
                }
            }
            catch (Exception ex)
            {
                ErrorManager(ex, new System.Diagnostics.StackTrace().GetFrame(0).GetMethod().Name);
            }
        }
Exemple #13
0
    protected void UpdateToolBar_ButtonClick(object sender, Telerik.Web.UI.RadToolBarEventArgs e)
    {
        if (HomestayStudentId > 0)
        {
            if (UpdateToolBar.TabIndex == 0)
            {
                HomestayStudentBasic Request = StudentRequest(HomestayStudentId);
                int StudentId = Convert.ToInt32(Request.StudentId);
                if (Grid_HostList.SelectedValue != null)
                {
                    int HostId = Convert.ToInt32(Grid_HostList.SelectedValue);

                    if (Grid_HostRoom.SelectedValue != null)
                    {
                        int RoomId = Convert.ToInt32(Grid_HostRoom.SelectedValue);
                        if (Grid_HostBed.SelectedValue != null)
                        {
                            int BedId = Convert.ToInt32(Grid_HostBed.SelectedValue);
                            //Homestay Placement

                            int AddResult               = 0;
                            var cHomestayPlacement      = new CHomestayPlacement();
                            HomestayPlacement Placement = new HomestayPlacement();
                            Placement.StudentBasicId   = HomestayStudentId;
                            Placement.StudentId        = StudentId;
                            Placement.HostId           = HostId;
                            Placement.RoomId           = RoomId;
                            Placement.BedId            = BedId;
                            Placement.HomestayAgencyId = 0;
                            Placement.StartDate        = Request.StartDate;
                            Placement.EndDate          = Request.EndDate;
                            Placement.PlacementStatus  = 1; //  Placed=1, Canceled =0, Schedule Change=2
                            Placement.PlacementType    = 1; // Placed by School=1, Place by Agency =2
                            Placement.CreatedDate      = DateTime.Now;
                            Placement.CreatedId        = CurrentUserId;
                            Placement.UpdatedDate      = DateTime.Now;
                            Placement.UpdatedId        = CurrentUserId;
                            AddResult = cHomestayPlacement.Add(Placement);

                            if (AddResult > 0)
                            {
                                var cRequest = new CHomestayStudentRequest();

                                UpdateHomestayStudentStatus(HomestayStudentId, 2); //Placed By School
                                RunClientScript("Close();");
                                ShowMessage("Homestay Placement Request has been placed successfully.");
                            }
                            else //Failed
                            {
                                ShowMessage("Failed to add Homestay Placement Request, Please try it again.");
                            }
                        }
                    }
                }
            }
        }
    }
        protected void RadToolBar1_ButtonClick(object sender, Telerik.Web.UI.RadToolBarEventArgs e)
        {
            if (e.Item.Text == "Save")
            {
                string Attachment;
                Attachment = "";
                if (RadAttachment.UploadedFiles.Count > 0)
                {
                    foreach (UploadedFile file in RadAttachment.UploadedFiles)
                    {
                        string targetFolder = Server.MapPath("~/Folder/");
                        file.SaveAs(Path.Combine(targetFolder, "test" + "-" + file.FileName));
                        //Me.WriteToFile("btnSubmit: " & targetFolder & TicketNo & "-" & file.FileName)
                        Attachment = DateTime.Now.ToShortDateString() + "-" + file.FileName;
                    }
                }
                else
                {
                    Attachment = "";
                }
                if (cmbActivityType.Text == "Visit" && cmbCustomerCode.Text != "Please Select" && cmbOpportunity.Text != "Please Select")
                {
                    if (cmbActivityStatus.Text == "Initiated")
                    {
                        TranuserID = Session["UserID"].ToString();
                    }
                    else
                    {
                        TranuserID = Session["TransByID"].ToString();
                    }

                    object obj_nrfid = objBSS.InsertActivitySales(txtSubject.Text, cmbCustomerCode.SelectedValue.ToString(), "Account", txtAddress.Text, cmbContact.SelectedValue.ToString(), cmbOpportunity.SelectedValue.ToString(), "Opportunity", DTActivityDate.SelectedDate.ToString(), txtActivityTime.SelectedDate.ToString(), cmbActivityType.SelectedValue.ToString(), cmbActivityStatus.SelectedValue.ToString(), TranuserID, txtRemarks.Text, RadCloserRemarks.SelectedValue.ToString(), Attachment, "1", Session["UserID"].ToString(), DateTime.Now.ToString());
                    //Grid view
                    GetActivityData();
                }
                if (cmbActivityType.Text != "Visit" && cmbCustomerCode.Text != "Please Select" && cmbOpportunity.Text == "Please Select")
                {
                    object obj_nrfid = objBSS.InsertActivitySales(txtSubject.Text, cmbCustomerCode.SelectedValue.ToString(), "Account", txtAddress.Text, cmbContact.SelectedValue.ToString(), "0", "0", DTActivityDate.SelectedDate.ToString(), txtActivityTime.SelectedDate.ToString(), cmbActivityType.SelectedValue.ToString(), cmbActivityStatus.SelectedValue.ToString(), TranuserID, txtRemarks.Text, RadCloserRemarks.SelectedValue.ToString(), Attachment, "1", Session["UserID"].ToString(), DateTime.Now.ToString());
                    //Grid view
                    GetActivityData();
                }
                if (cmbActivityType.Text != "Visit" && cmbCustomerCode.Text == "Please Select" && cmbOpportunity.Text == "Please Select")
                {
                    object obj_nrfid = objBSS.InsertActivitySales(txtSubject.Text, "0", cmbActivityType.Text, txtAddress.Text, "0", "0", "0", DTActivityDate.SelectedDate.ToString(), txtActivityTime.SelectedDate.ToString(), cmbActivityType.SelectedValue.ToString(), cmbActivityStatus.SelectedValue.ToString(), TranuserID, txtRemarks.Text, RadCloserRemarks.SelectedValue.ToString(), Attachment, "1", Session["UserID"].ToString(), DateTime.Now.ToString());
                    //Grid view
                    GetActivityData();
                }
            }
            if (e.Item.Text == "Update")
            {
                //object obj_nrfid = objBSS.UpdateActivity(ViewState["ActivityID"].ToString(), txtSubject.Text, cmbCustomerCode.SelectedValue.ToString(), "Account", txtAddress.Text, cmbContact.SelectedValue.ToString(), cmbOpportunity.SelectedValue.ToString(), "Opportunity", DTActivityDate.SelectedDate.ToString(), txtActivityTime.SelectedDate.ToString(), cmbActivityType.SelectedValue.ToString(), cmbActivityStatus.SelectedValue.ToString(), Session["TransByID"].ToString(), txtRemarks.Text, RadCloserRemarks.SelectedValue.ToString());
                object obj_nrfid = objBSS.UpdateActivitySales(ViewState["ActivityID"].ToString(), txtSubject.Text, cmbCustomerCode.SelectedValue.ToString(), "Account", txtAddress.Text, cmbContact.SelectedValue.ToString(), cmbOpportunity.SelectedValue.ToString(), "Opportunity", DTActivityDate.SelectedDate.ToString(), txtActivityTime.SelectedDate.ToString(), cmbActivityType.SelectedValue.ToString(), cmbActivityStatus.SelectedValue.ToString(), Session["TransByID"].ToString(), txtRemarks.Text, RadCloserRemarks.SelectedValue.ToString());
                //Grid view
                GetActivityData();
            }
        }
Exemple #15
0
        protected void rtb1_ButtonClick(object sender, Telerik.Web.UI.RadToolBarEventArgs e)
        {
            try
            {
                if (!_PermisoImprimir)
                {
                    this.Alerta("No tiene permisos para ver el reporte");
                    return;
                }
                ErrorManager();
                RadToolBarButton btn = e.Item as RadToolBarButton;

                if (this.TxtId_AlmIni.Text == "")
                {
                    this.Alerta("El almacén inicial es requerido");
                    this.TxtId_AlmIni.Focus();
                    return;
                }

                if (this.TxtId_AlmFin.Text == "")
                {
                    this.Alerta("El almacén final es requerido");
                    this.TxtId_AlmFin.Focus();
                    return;
                }

                if (this.dpFecha1.SelectedDate.ToString() == "")
                {
                    this.Alerta("Debe seleccionar la fecha de corte");
                    this.dpFecha1.Focus();
                    return;
                }


                if (int.Parse(this.TxtId_AlmIni.Text) > int.Parse(this.TxtId_AlmFin.Text))
                {
                    this.Alerta("El almacén inicial no puede ser mayor al almacén final");
                    this.TxtId_AlmIni.Focus();
                    return;
                }

                if (Page.IsValid)
                {
                    if (btn.CommandName == "print")
                    {
                        this.Imprimir();
                    }
                }
            }
            catch (Exception ex)
            {
                ErrorManager(ex, new System.Diagnostics.StackTrace().GetFrame(0).GetMethod().Name);
            }
        }
Exemple #16
0
        protected void rtb1_ButtonClick(object sender, Telerik.Web.UI.RadToolBarEventArgs e)
        {
            try
            {
                ErrorManager();
                RadToolBarButton btn = e.Item as RadToolBarButton;

                if (Page.IsValid)
                {
                    if (btn.CommandName == "guardar")
                    {
                        if (int.Parse(HFId_PC.Value) == 0 && int.Parse(HFTipoOp.Value) == 0)
                        {
                            if (!_PermisoGuardar)
                            {
                                Alerta("No tiene permiso para guardar");
                                return;
                            }

                            Guardar();
                        }
                        else if (int.Parse(HFId_PC.Value) != 0 && int.Parse(HFTipoOp.Value) == 0)
                        {
                            if (!_PermisoModificar)
                            {
                                Alerta("No tiene permiso para modificar");
                                return;
                            }

                            Modificar();
                        }
                        else if (int.Parse(HFId_PC.Value) != 0 && int.Parse(HFTipoOp.Value) == 1)
                        {
                            if (!_PermisoGuardar)
                            {
                                Alerta("No tiene permiso para guardar");
                                return;
                            }

                            Guardar();
                        }
                    }
                }
            }
            catch (Exception ex)
            {
                ErrorManager(ex, new System.Diagnostics.StackTrace().GetFrame(0).GetMethod().Name);
            }
        }
 protected void tblButtons_ButtonClick(object sender, Telerik.Web.UI.RadToolBarEventArgs e)
 {
     try
     {
         RadToolBarButton item = (RadToolBarButton)e.Item;
         if (item.CommandName == "Update")
         {
             TheInternalDEForm.SaveForm();
         }
     }
     catch (Exception ex)
     {
         TheInternalDEForm.ShowException(ex);
     }
 }
Exemple #18
0
        protected void rtb1_ButtonClick(object sender, Telerik.Web.UI.RadToolBarEventArgs e)
        {
            RadToolBarButton    btn       = e.Item as RadToolBarButton;
            CN_CatClienteMatriz cm_Matriz = (CN_CatClienteMatriz)Session["cm_Matriz"];

            if (btn.CommandName == "save")
            {
                int            idMatriz = Int32.Parse(Request.QueryString["Id"]);
                CatCNac_Matriz matriz   = new CatCNac_Matriz();
                matriz.CatACYS_SIANCENTRAL  = new CatACYS_SIANCENTRAL();
                matriz.CatCNac_IntranetFran = new CatCNac_IntranetFran();

                matriz.Id = idMatriz;
                matriz.CatACYS_SIANCENTRAL.Id  = idMatriz;
                matriz.CatCNac_IntranetFran.Id = idMatriz;


                //LLena campos a partir del formulario

                object objMatriz_SIANCENTRAL = matriz.CatACYS_SIANCENTRAL;
                AsignacionCampos.AsignaCamposEntidad(ref objMatriz_SIANCENTRAL, "", this);

                object objMatriz_IntranetFran = matriz.CatCNac_IntranetFran;
                AsignacionCampos.AsignaCamposEntidad(ref objMatriz_IntranetFran, "", this);

                foreach (RadComboBoxItem item in cmbSoportes.CheckedItems)
                {
                    matriz.CatCNac_IntranetFran.Soportes += item.Value.ToString() + ", ";
                }


                foreach (CatACYS_DirFiscales dir in listDirFiscales)
                {
                    matriz.CatACYS_DirFiscales.Add(dir);
                }
                foreach (CatCNac_IntranetListaFranq fran in listFranquicias)
                {
                    matriz.CatCNac_IntranetListaFranq.Add(fran);
                }



                matriz.CatACYS_SIANCENTRAL.ConvenioNombre = this.cmbConvenioId.Text;

                cm_Matriz.GuardarDatosGeneralesMat(matriz, (Boolean)Session["Nuevo"]);
                RAM1.ResponseScripts.Add("CloseAlert('Los datos se guardaron correctamente');");
            }
        }
Exemple #19
0
 protected void rtb1_ButtonClick(object sender, Telerik.Web.UI.RadToolBarEventArgs e)
 {
     try
     {
         ErrorManager();
         RadToolBarButton btn = e.Item as RadToolBarButton;
         if (btn.CommandName == "save")
         {
             Guardar();
         }
     }
     catch (Exception ex)
     {
         ErrorManager(ex, new System.Diagnostics.StackTrace().GetFrame(0).GetMethod().Name);
     }
 }
 protected void rtb1_ButtonClick(object sender, Telerik.Web.UI.RadToolBarEventArgs e)
 {
     try
     {
         ErrorManager();
         RadToolBarButton btn = e.Item as RadToolBarButton;
         if (Page.IsValid)
         {
             this.Descargar();
         }
     }
     catch (Exception ex)
     {
         ErrorManager(ex, new System.Diagnostics.StackTrace().GetFrame(0).GetMethod().Name);
     }
 }
        protected void RadToolBar1_ButtonClick(object sender, Telerik.Web.UI.RadToolBarEventArgs e)
        {
            string Attachment;

            if (e.Item.Text == "Save")
            {
                Attachment = "";
                if (RadAttachment.UploadedFiles.Count > 0)
                {
                    foreach (UploadedFile file in RadAttachment.UploadedFiles)
                    {
                        string targetFolder = Server.MapPath("~/Folder/");
                        file.SaveAs(Path.Combine(targetFolder, "test" + "-" + file.FileName));
                        //file.SaveAs(Path.Combine("test" + "-" + file.FileName));
                        //Me.WriteToFile("btnSubmit: " & targetFolder & TicketNo & "-" & file.FileName)
                        Attachment = DateTime.Now.ToShortDateString() + "-" + file.FileName;
                    }
                }
                else
                {
                    Attachment = "";
                }

                Save(Attachment);
            }

            if (e.Item.Text == "Update")
            {
                Attachment = "";
                if (RadAttachment.UploadedFiles.Count > 0)
                {
                    foreach (UploadedFile file in RadAttachment.UploadedFiles)
                    {
                        string targetFolder = Server.MapPath("~/Folder/");
                        file.SaveAs(Path.Combine(targetFolder, "test" + "-" + file.FileName));
                        //file.SaveAs(Path.Combine("test" + "-" + file.FileName));
                        //Me.WriteToFile("btnSubmit: " & targetFolder & TicketNo & "-" & file.FileName)
                        Attachment = DateTime.Now.ToShortDateString() + "-" + file.FileName;
                    }
                }
                else
                {
                    Attachment = "";
                }
                Update(Attachment);
            }
        }
        protected void ItemToolBar_ButtonClick(object sender, Telerik.Web.UI.RadToolBarEventArgs e)
        {
            switch (e.Item.Value.ToLower())
            {
            case "save":
                SaveEmployee();
                break;

            case "delete":
                DeleteEmployee();
                break;

            case "add":
                ClearEmployeeDetails();
                break;
            }
        }
        protected void RadToolBar1_ButtonClick(object sender, Telerik.Web.UI.RadToolBarEventArgs e)
        {
            if (e.Item.Value == "Reimage")
            {
                CCDBaccess db = new CCDBaccess();

                string errmsg = "";
                foreach (DataGridItem dataItem in DataGrid1.Items)
                {
                    CheckBox cb = (CheckBox)dataItem.Cells[0].Controls[1];
                    if (cb.Checked)
                    {
                        if ((bool)Session["SelectedAllSeps"] == false)
                        {
                            try
                            {
                                // All page colors
                                TableCell cell = dataItem.Cells[(int)ViewState["MasterSetColumn"]];
                                db.ReimageFlatSeparation(Int32.Parse(cell.Text), -1, "", out errmsg);
                            }
                            catch
                            { }
                        }
                        else
                        {
                            try
                            {
                                // Specific color separation
                                TableCell cell  = dataItem.Cells[(int)ViewState["MasterSetColumn"]];
                                TableCell cell2 = dataItem.Cells[(int)ViewState["ColorColumn"]];
                                db.ReimageFlatSeparation(Int32.Parse(cell.Text), -1, cell2.Text, out errmsg);
                            }
                            catch
                            { }
                        }
                    }
                }
            }
            //    if (e.Item.Value == "Refresh" || e.Item.Value == "HideFinished" || e.Item.Value == "Separations")
            //  {
            ReBind();
            //}
        }
Exemple #24
0
 protected void rtb1_ButtonClick(object sender, Telerik.Web.UI.RadToolBarEventArgs e)
 {
     try
     {
         ErrorManager();
         RadToolBarButton btn = e.Item as RadToolBarButton;
         if (Page.IsValid)
         {
             if (btn.CommandName == "excel")
             {
                 this.GenerarExcel();
                 Alerta("Se genero el archivo correctamente");
             }
         }
     }
     catch (Exception ex)
     {
         ErrorManager(ex, new System.Diagnostics.StackTrace().GetFrame(0).GetMethod().Name);
     }
 }
Exemple #25
0
        protected void RadToolBar1_ButtonClick(object sender, Telerik.Web.UI.RadToolBarEventArgs e)
        {
            string accionError = string.Empty;

            try
            {
                RadToolBarButton btn = e.Item as RadToolBarButton;
                int año = -1;
                int mes = -1;
                int.TryParse(cmbAño.SelectedValue, out año);
                int.TryParse(cmbMes.SelectedValue, out mes);
                if (año > 0)
                {
                    if (mes > 0)
                    {
                        switch (btn.CommandName)
                        {
                        case "Mostrar":
                            Mostrar(true);
                            break;

                        case "excel":
                            Mostrar(false);
                            break;
                        }
                    }
                    else
                    {
                        Alerta("Seleccione un mes válido para el reporte");
                    }
                }
                else
                {
                    Alerta("Seleccione un año válido para el reporte");
                }
            }
            catch (Exception ex)
            {
                throw ex;
            }
        }
        protected void RadToolBar1_ButtonClick(object sender, Telerik.Web.UI.RadToolBarEventArgs e)
        {
            try
            {
                RadToolBarButton btn = e.Item as RadToolBarButton;

                switch (btn.CommandName)
                {
                case "new":
                    break;

                case "save":
                    Guardar();
                    break;
                }
            }
            catch (Exception ex)
            {
                ErrorManager(ex, "RadToolBar1_ButtonClick");
            }
        }
Exemple #27
0
        protected void RadToolBar1_ButtonClick(object sender, Telerik.Web.UI.RadToolBarEventArgs e)
        {
            if (e.Item.Value == "Approve")
            {
                string     errmsg;
                CCDBaccess db = new CCDBaccess();

                if (db.UpdateApproval((string)Session["UserName"], nCurrentCopySeparationSet, 1, out errmsg) == false)
                {
                    ;
                }
                else
                {
                    Session["CurrentApprovalState"] = 1;
                    DisplayPageName();
                }
            }

            if (e.Item.Value == "Disapprove")
            {
                string     errmsg;
                CCDBaccess db = new CCDBaccess();

                if (db.UpdateApproval((string)Session["UserName"], nCurrentCopySeparationSet, 2, out errmsg) == false)
                {
                    ;
                }
                else
                {
                    Session["CurrentApprovalState"] = 2;
                    DisplayPageName();
                }
            }

            if (e.Item.Value == "Close")
            {
                Response.Redirect("Thumbnailview2.aspx");
            }
        }
Exemple #28
0
        protected void RadToolBar1_ButtonClick(object sender, Telerik.Web.UI.RadToolBarEventArgs e)
        {
            if (e.Item.Value == "Refresh")
            {
                //DataSet dataSet  =  (DataSet) Cache["PageTableCache"];
                ReBind();
            }
            else if (e.Item.Value == "Retry")
            {
                CCDBaccess db = new CCDBaccess();
                //string errmsg = "";

                /*
                 * foreach (DataGridItem dataItem in DataGrid1.Items)
                 * {
                 *  CheckBox cb = (CheckBox)dataItem.Cells[0].Controls[1];
                 *  if (cb.Checked)
                 *  {
                 *      try
                 *      {
                 *          TableCell cell = dataItem.Cells[1];
                 *          TableCell cell2 = dataItem.Cells[2];
                 *          db.UpdateUnknownFiles(cell.Text, cell2.Text, 1, "", out errmsg);
                 *      }
                 *      catch
                 *      { }
                 *
                 *  }
                 * }
                 * GetFilteredGrid();*/
            }
            else if (e.Item.Value == "Delete")
            {
            }
            else if (e.Item.Value == "Rename")
            {
            }
        }
        protected void RadToolBar1_ButtonClick(object sender, Telerik.Web.UI.RadToolBarEventArgs e)
        {
            string accionError = string.Empty;

            try
            {
                RadToolBarButton btn = e.Item as RadToolBarButton;
                switch (btn.CommandName)
                {
                case "Mostrar":
                    Mostrar(true);
                    break;

                case "excel":
                    Mostrar(false);
                    break;
                }
            }
            catch (Exception ex)
            {
                throw ex;
            }
        }
Exemple #30
0
        protected void RadToolBar1_ButtonClick(object sender, Telerik.Web.UI.RadToolBarEventArgs e)
        {
            string accionError = string.Empty;

            try
            {
                RadToolBarButton btn = e.Item as RadToolBarButton;
                if (!string.IsNullOrEmpty(cmbAño.SelectedValue))
                {
                    if (cmbAño.SelectedValue != "-1")
                    {
                        switch (btn.CommandName)
                        {
                        case "Mostrar":
                            Mostrar(true);
                            break;

                        case "excel":
                            Mostrar(false);
                            break;
                        }
                    }
                    else
                    {
                        Alerta("Ingresar un año válido");
                    }
                }
                else
                {
                    Alerta("Ingresar un año válido");
                }
            }
            catch (Exception ex)
            {
                throw ex;
            }
        }