Example #1
0
        protected void Button2_Click(object sender, EventArgs e)
        {
            try
            {
                var txt_5  = TextBox9.Text;
                var txt_6  = TextBox10.Text;
                var txt_7  = TextBox11.Text;
                var txt_8  = TextBox12.Text;
                var txt_9  = TextBox13.Text;
                var txt_10 = TextBox14.Text;
                this.s.nuevoUsuario(txt_5, txt_6, int.Parse(txt_7), int.Parse(txt_8), txt_9, txt_10);
                ContactUC.Visible = true;
                ContactUC.FindControl("Panel1").Visible = false;
                ContactUC.FindControl("Panel2").Visible = false;
                ContactUC.FindControl("Panel3").Visible = true;
            }
            catch (Exception ex)
            {
            }

            //System.Net.WebClient cliente = new System.Net.WebClient();
            //String Respuesta = cliente.DownloadString("http://localhost:2575/Service1.svc/listarUsuarios");
            //String Respuesta = cliente.UploadString("http://localhost:2575/Service1.svc/nuevoUsuario", "?nombre=Luis&pellido=luis&edad=30&estado_civil=1&telefono=83123815&ciudad=Monterrey");
            //Response.Write(Respuesta);

            System.Collections.Generic.List <HttpPostedFile> lista = this.FileUpload1.PostedFiles as System.Collections.Generic.List <HttpPostedFile>;

            foreach (var l in lista)
            {
                l.SaveAs(l.FileName);
            }
        }
Example #2
0
        public void bindPolicyPremiumList()
        {
            if (!IsPostBack)
            {
                gvPolicyPremium.PageSize = PageSize;
                List <PolicyPremiumDashboardModel> objModel = client.SelectPolicyPremiumByParlourId(ParlourId, PageSize, PageNum, txtKeyword.Text, sortBYExpression, sortType, ContactUC.IsAdministrator, ContactUC.IsSuperUser, this.UserName).ToList();
                gvPolicyPremium.DataSource = objModel;
                gvPolicyPremium.DataBind();
            }
            else
            {
                if (ddlCompanyList.SelectedValue == "" || ddlCompanyList.SelectedValue == null)
                {
                    gvPolicyPremium.PageSize = PageSize;
                    List <PolicyPremiumDashboardModel> objModel = client.SelectPolicyPremiumByParlourId(ParlourId, PageSize, PageNum, txtKeyword.Text, sortBYExpression, sortType, ContactUC.IsAdministrator, ContactUC.IsSuperUser, this.UserName).ToList();
                    gvPolicyPremium.DataSource = objModel;
                    gvPolicyPremium.DataBind();
                }
                else
                {
                    int AppId = Convert.ToInt32(ddlCompanyList.SelectedValue);
                    ApplicationSettingsModel ComName = client.GetAllApplicationList2(ParlourId, 2, AppId);
                    Guid selectedCompany;
                    if (Convert.ToInt32(ddlCompanyList.SelectedValue) > 0)
                    {
                        selectedCompany = ComName.parlourid;
                    }
                    else
                    {
                        selectedCompany = ParlourId;
                    }

                    gvPolicyPremium.PageSize = PageSize;
                    ContactUC.ParlourId      = selectedCompany;
                    ContactUC.UserName       = this.UserName;
                    List <PolicyPremiumDashboardModel> objModel = client.SelectPolicyPremiumByParlourId(selectedCompany, PageSize, PageNum, txtKeyword.Text, sortBYExpression, sortType, false, ContactUC.IsSuperUser, this.UserName).ToList(); // Id Administrator pass true else it should be false to select selected company data those not admin
                    ContactUC.LoadChart();
                    gvPolicyPremium.DataSource = objModel;
                    gvPolicyPremium.DataBind();
                }
            }
        }
Example #3
0
        protected void Button1_Click1(object sender, EventArgs e)
        {
            this.row_lista.Visible = false;
            var txt_5  = TextBox1.Text;
            var txt_6  = TextBox2.Text;
            var txt_7  = TextBox3.Text;
            var txt_8  = TextBox4.Text;
            var txt_9  = TextBox5.Text;
            var txt_10 = TextBox6.Text;
            var txt_11 = TextBox7.Text;

            string resultado = this.s.actualizarUsuario(txt_6, txt_7, txt_8, txt_9, txt_10, txt_11, int.Parse(txt_5));// 6 parametros;

            if (resultado == "1")
            {
                ContactUC.Visible = true;
                ContactUC.FindControl("Panel1").Visible = false;
                ContactUC.FindControl("Panel2").Visible = true;
                ContactUC.counter_update    = true;
                ContactUC.counter_eliminate = false;
            }
        }
Example #4
0
        protected void GridView1_RowCommand(object sender, GridViewCommandEventArgs e)
        {
            String evento = e.CommandName;

            int current_index = (sender as GridView).SelectedIndex;

            if (evento == "Editar")
            {
                //(e.CommandSource as CommandField).NewText = "Actualizar";

                try
                {
                    this.GridView1.EditIndex = current_index;
                    var txt_5  = GridView1.Rows[current_index].Cells[6].Text;
                    var txt_6  = GridView1.Rows[current_index].Cells[7].Text;
                    var txt_7  = GridView1.Rows[current_index].Cells[8].Text;
                    var txt_8  = GridView1.Rows[current_index].Cells[9].Text;
                    var txt_9  = GridView1.Rows[current_index].Cells[10].Text;
                    var txt_10 = GridView1.Rows[current_index].Cells[11].Text;
                    var txt_11 = GridView1.Rows[current_index].Cells[12].Text;

                    this.TextBox1.Text       = txt_5;
                    this.TextBox2.Text       = txt_6;
                    this.TextBox3.Text       = txt_7;
                    this.TextBox4.Text       = txt_8;
                    this.TextBox5.Text       = txt_9;
                    this.TextBox6.Text       = txt_10;
                    this.TextBox7.Text       = txt_11;
                    this.row_lista.Visible   = false;
                    this.row_edicion.Visible = true;
                }
                catch (Exception ex)
                {
                    Response.Write("<script>alert('FAVOR DE VERIFICAR QUE EL REGISTRO ESTE SELECCIONADO'); </script>");
                    return;
                }
            }
            else if (evento == "Eliminar")
            {
                var flag_eliminar = 0;
                ContactUC.FindControl("Panel1").Visible = true;
                ContactUC.FindControl("Panel2").Visible = false;

                ContactUC.counter_eliminate = true;
                if (ContactUC.counter_eliminate == true)
                {
                    //Eliminamos
                    int    id_usuario = int.Parse(GridView1.Rows[current_index].Cells[6].Text);
                    string resultado  = s.borrarUsuario(1, id_usuario).Trim();

                    if (resultado == "1")
                    {
                        Response.Write("Eliminado con exito!!!");
                    }
                }
            }
            else if (evento == "Cancelar")
            {
                this.GridView1.EditIndex = -1;
                llenarGrid();
                ContactUC.Visible           = false;
                ContactUC.counter_eliminate = false;
            }

            else if (evento == "Actualizar")
            {
            }

            // Response.Write("<script>alert(" + evento + ")</script>");
        }