示例#1
0
    protected void RadComboBox1_DataBound(object sender, EventArgs e)
    {
        DateTime?day0 = DateTime.Parse(RadComboBox1.SelectedValue.ToString());
        DateTime?day1 = day0.Value.AddDays(1);
        DateTime?day2 = day0.Value.AddDays(2);
        DateTime?day3 = day0.Value.AddDays(3);
        DateTime?day4 = day0.Value.AddDays(4);
        DateTime?day5 = day0.Value.AddDays(5);
        DateTime?day6 = day0.Value.AddDays(6);

        SqlDataSource2.SelectParameters[0].DefaultValue = RadComboBox1.SelectedValue.ToString();

        RadGrid2.MasterTableView.Columns[3].HeaderText = day0.Value.ToShortDateString();
        RadGrid2.MasterTableView.Columns[4].HeaderText = day1.Value.ToShortDateString();
        RadGrid2.MasterTableView.Columns[5].HeaderText = day2.Value.ToShortDateString();
        RadGrid2.MasterTableView.Columns[6].HeaderText = day3.Value.ToShortDateString();
        RadGrid2.MasterTableView.Columns[7].HeaderText = day4.Value.ToShortDateString();
        RadGrid2.MasterTableView.Columns[8].HeaderText = day5.Value.ToShortDateString();
        RadGrid2.MasterTableView.Columns[9].HeaderText = day6.Value.ToShortDateString();
        RadGrid2.Rebind();

        SqlDataSource3.SelectParameters[0].DefaultValue = RadComboBox1.SelectedValue.ToString();
        RadGrid3.Rebind();

        SqlDataSource4.SelectParameters[0].DefaultValue = RadComboBox1.SelectedValue.ToString();
        RadGrid4.Rebind();

        SqlDataSource5.SelectParameters[0].DefaultValue = RadComboBox1.SelectedValue.ToString();
        RadGrid5.Rebind();
    }
    private void BindVoteResultByPrefReport(int districtNo, string years)
    {
        DataTable dt  = new DataTable();
        VoteBll   obj = new VoteBll();

        obj.DistrictNo = districtNo;
        obj.Years      = years;

        dt = obj.GetVoteResultByPrefReport();
        if (dt.Rows.Count > 0)
        {
            btnExporttoExcel.Visible = true;
            lblMsg.Visible           = false;
            RadGrid4.Visible         = true;

            RadGrid4.DataSource = dt;
            RadGrid4.DataBind();
        }
        else
        {
            btnExporttoExcel.Visible = false;
            lblMsg.Visible           = true;
            RadGrid4.Visible         = false;
        }
    }
示例#3
0
        public void Cargar_FechaEntrega(string OT)
        {
            DespachoController controldes = new DespachoController();

            RadGrid4.DataSource = controldes.ListarProduccionOT_tablaTemporal_Detalle(OT);
            RadGrid4.DataBind();
        }
        public void Cargar_FechaEntrega(string OT)
        {
            DespachoController controldes = new DespachoController();

            RadGrid4.DataSource = controldes.sp_ListarFuturos_Mostrar(OT, "", "", DateTime.Now.ToString("yyyy-MM-dd"), DateTime.Now.AddYears(+1).ToString("yyyy-MM-dd HH:mm:ss"), 0);
            RadGrid4.DataBind();
        }
示例#5
0
        public void cargaContenido(string rut, string nrFactura)
        {
            RadGrid4.DataSource = sv.Listar_DetalleFactura(rut, "", "", "", "", nrFactura, "", f, 8);
            RadGrid4.DataBind();

            Factura ff = sv.CargaEncabezado(rut, "", "", "", "", nrFactura, "", f, 9);

            txtRut.Text        = ff.Rut;
            txtProveedor.Text  = ff.Nombre;
            lblDireccion.Text  = ff.Sucursal;
            lblComuna.Text     = ff.Comuna;
            lblCiudad.Text     = ff.Ciudad;
            txtNroFactura.Text = ff.NFactura.ToString();

            btnFiltro.Visible = false;
            btnNuevo.Visible  = true;


            int total = 0;

            for (int i = 0; i < RadGrid4.Items.Count; i++)
            {
                total = total + Convert.ToInt32(RadGrid4.Items[i]["Total"].Text.Replace(".", ""));
            }
            lblValorNeto.Text = "$ " + total.ToString("N0").Replace(",", ".");
            double iva = Convert.ToDouble(total) * 0.19;

            lblIVA.Text = "$ " + Convert.ToInt32(iva).ToString("N0").Replace(",", ".");

            lblCostoTotal.Text = "$ " + (total + Convert.ToInt32(iva)).ToString("N0").Replace(",", ".");
            //Session["IDf"] = "0";
        }
示例#6
0
        protected void RadGrid2_ItemCommand(object sender, Telerik.Web.UI.GridCommandEventArgs e)
        {
            if (e.CommandName == "RowClick")
            {
                GridDataItem item = (GridDataItem)e.Item;
                lblOT.Text         = item["OT"].Text;
                lblNombreOT.Text   = item["NombreOT"].Text;
                lblComponente.Text = item["Componente"].Text;
                lblCantidad.Text   = item["StockFL"].Text;
                lblFolio.Text      = item["FechaCreacion"].Text;
                Bobina_Controller controlBo       = new Bobina_Controller();
                List <Bobina>     listaPendiente1 = controlBo.listarBobinaPend(item["OT"].Text, "&nbsp;", 1);
                List <Bobina>     listaPendiente2 = controlBo.listarBobinaPend(item["OT"].Text, item["Componente"].Text, 1);
                List <Bobina>     listaConsumoda1 = controlBo.listarBobinaPend(item["OT"].Text, "&nbsp;", 2);
                List <Bobina>     listaConsumoda2 = controlBo.listarBobinaPend(item["OT"].Text, item["Componente"].Text, 2);


                RadGrid4.DataSource = listaPendiente1.Union(listaPendiente2);
                RadGrid5.DataSource = listaConsumoda1.Union(listaConsumoda2);
                RadGrid4.DataBind();
                RadGrid5.DataBind();
                divPliego.Visible         = true;
                divDimensionadora.Visible = false;
            }
        }
示例#7
0
        protected void Page_Load(object sender, EventArgs e)
        {
            try
            {
                btnCerrar.Attributes.Add("onclick", "window.close();");

                //string OT = Request.QueryString["ot"];
                lblnombreot.Text = "OT: " + Request.QueryString["ot"] + " - " + Request.QueryString["not"];

                lblMensajeria.Text  = controlm.listarMensajes(Request.QueryString["ot"], Session["Usuario"].ToString(), 1);
                RadGrid4.DataSource = controldes.ListarProduccionOT_tablaTemporal_Detalle(Request.QueryString["ot"]);
                RadGrid4.DataBind();

                RadGrid5.DataSource = controldes.ListarDespacho(Request.QueryString["ot"]);
                RadGrid5.DataBind();

                CargaRegistros(Request.QueryString["ot"]);

                lblTablaHistorial.Text = cp.Carga_HistorialOT(Request.QueryString["ot"]);

                ProduccionController pc = new ProduccionController();
                RadGrid22.DataSource = pc.Lista_Pliegos_Impresos(Request.QueryString["ot"]).OrderBy(o => o.Pliego);
                RadGrid22.DataBind();
            }
            catch
            {
            }
        }
示例#8
0
    protected void RadGrid2_SelectedIndexChanged(object sender, EventArgs e)
    {
        SqlDataSource3.SelectParameters[0].DefaultValue = RadComboBox1.SelectedValue.ToString();
        RadGrid3.Rebind();
        SqlDataSource4.SelectParameters[0].DefaultValue = RadComboBox1.SelectedValue.ToString();
        RadGrid4.Rebind();

        //RadGrid5.Rebind();
    }
        public void CargarBobinas()
        {
            string Pliego  = lblNombrePliego.Text;
            string Maquina = controlBo.BuscarMaquinaUser(GetDireccionIp(Request));

            if (lblNombrePliego.Text == "" && Maquina == "Dimensionadora")
            {
                Pliego = "&nbsp;";
            }
            RadGrid4.DataSource = controlBo.listarBobinaPend(txtOT.Text, Pliego, 1);
            RadGrid5.DataSource = controlBo.listarBobinaPend(txtOT.Text, Pliego, 2);
            RadGrid4.DataBind();
            RadGrid5.DataBind();
        }
        public void CargarBobConsumir(string Ot, string pliego)
        {
            divDatos.Visible     = true;
            divPliego.Visible    = true;
            divOT.Visible        = false;
            txtOT.Text           = Ot;
            lblNombrePliego.Text = pliego;
            string Maquina = controlBo.BuscarMaquinaUser(GetDireccionIp(Request));

            RadGrid4.DataSource = controlBo.listarBobinaPend(txtOT.Text, pliego, 1);
            RadGrid5.DataSource = controlBo.listarBobinaPend(txtOT.Text, pliego, 2);
            RadGrid4.DataBind();
            RadGrid5.DataBind();
        }
        protected void Page_Load(object sender, EventArgs e)
        {
            if (!IsPostBack)
            {
                txtFechaInicio.Text  = "01/03/2015";
                txtFechaTermino.Text = "31/03/2015";

                RadGrid1.DataSource = "";
                RadGrid1.DataBind();
                RadGrid2.DataSource = "";
                RadGrid2.DataBind();
                RadGrid3.DataSource = "";
                RadGrid3.DataBind();
                RadGrid4.DataSource = "";
                RadGrid4.DataBind();
            }
        }
示例#12
0
        protected void Page_Load(object sender, EventArgs e)
        {
            if (!IsPostBack)
            {
                RadGrid4.DataSource = "";
                RadGrid4.DataBind();
            }
            try
            {
                if (Session["IDf"].ToString() != "0")
                {
                    RadGrid4.DataSource = sv.Listar_DetalleFactura(Session["IDf"].ToString(), "", "", "", "", "", "", f, 5);
                    RadGrid4.DataBind();

                    Factura ff = sv.CargaEncabezado(Session["IDf"].ToString(), "", "", "", "", "", "", f, 6);

                    txtRut.Text        = ff.Rut;
                    txtProveedor.Text  = ff.Nombre;
                    lblDireccion.Text  = ff.Sucursal;
                    lblComuna.Text     = ff.Comuna;
                    lblCiudad.Text     = ff.Ciudad;
                    txtFecha.Text      = ff.OT;
                    txtNroFactura.Text = ff.NFactura.ToString();
                    btnFiltro.Visible  = false;
                    btnNuevo.Visible   = true;

                    btnDet.Visible = false;

                    int total = 0;
                    for (int i = 0; i < RadGrid4.Items.Count; i++)
                    {
                        total = total + Convert.ToInt32(RadGrid4.Items[i]["Total"].Text.Replace(".", ""));
                    }
                    lblValorNeto.Text = "$ " + total.ToString("N0").Replace(",", ".");
                    double iva = Convert.ToDouble(total) * 0.19;
                    lblIVA.Text = "$ " + Convert.ToInt32(iva).ToString("N0").Replace(",", ".");

                    lblCostoTotal.Text = "$ " + (total + Convert.ToInt32(iva)).ToString("N0").Replace(",", ".");
                    Session["IDf"]     = "0";
                }
            }
            catch
            {
            }
        }
        protected void btnFiltro_Click1(object sender, EventArgs e)
        {
            if (txtFechaInicio.Text != "" && txtFechaTermino.Text != "")
            {
                string[] str  = txtFechaInicio.Text.Split('/');
                DateTime fi   = Convert.ToDateTime(str[1] + "/" + str[0] + "/" + str[2] + " 00:00:00");
                string[] str2 = txtFechaTermino.Text.Split('/');
                DateTime ft   = Convert.ToDateTime(str2[1] + "/" + str2[0] + "/" + str2[2] + " 23:59:59");
                //Web2
                RadGrid1.DataSource = pp.Lista_Resumen_PartesManualesDiario("M2016", fi, ft, 0);
                RadGrid1.DataBind();

                //C150  GOSS
                RadGrid2.DataSource = pp.Lista_Resumen_PartesManualesDiario("C150", fi, ft, 0);
                RadGrid2.DataBind();
                //SHCD cd
                RadGrid3.DataSource = pp.Lista_Resumen_PartesManualesDiario("SHCD", fi, ft, 0);
                RadGrid3.DataBind();
                //SH402 4p
                RadGrid4.DataSource = pp.Lista_Resumen_PartesManualesDiario("SH402", fi, ft, 0);
                RadGrid4.DataBind();
            }
        }
示例#14
0
        protected void Page_Load(object sender, EventArgs e)
        {
            if (!IsPostBack)
            {
                Controller_Dimensionadora dd = new Controller_Dimensionadora();

                try
                {
                    lblOT.Text         = Request.QueryString["o"].ToString();
                    lblNombreOT.Text   = Request.QueryString["n"].ToString();
                    lblComponente.Text = Request.QueryString["c"].ToString();
                    lblCantidad.Text   = Request.QueryString["t"].ToString();
                    lblFolio.Text      = Request.QueryString["f"].ToString();
                    Bobina_Controller controlBo       = new Bobina_Controller();
                    List <Bobina>     listaPendiente1 = controlBo.listarBobinaPend(Request.QueryString["o"].ToString(), "&nbsp;", 1);
                    List <Bobina>     listaPendiente2 = controlBo.listarBobinaPend(Request.QueryString["o"].ToString(), Request.QueryString["c"].ToString(), 1);
                    List <Bobina>     listaConsumoda1 = controlBo.listarBobinaPend(Request.QueryString["o"].ToString(), "&nbsp;", 2);
                    List <Bobina>     listaConsumoda2 = controlBo.listarBobinaPend(Request.QueryString["o"].ToString(), Request.QueryString["c"].ToString(), 2);


                    RadGrid4.DataSource = listaPendiente1.Union(listaPendiente2);
                    RadGrid5.DataSource = listaConsumoda1.Union(listaConsumoda2);
                    RadGrid4.DataBind();
                    RadGrid5.DataBind();
                    divPliego.Visible         = true;
                    divDimensionadora.Visible = false;
                }
                catch
                {
                    RadGrid2.DataSource = dd.CargaPendientesDimensionadoraConsumo(0, "", "");
                    RadGrid2.DataBind();
                    divPliego.Visible         = false;
                    divDimensionadora.Visible = true;
                }
            }
        }
        protected void RadGrid1_ItemCommand(object sender, Telerik.Web.UI.GridCommandEventArgs e)
        {
            if (e.CommandName == "UserInfo")
            {
                InfoMeeting.Visible      = false;
                InfoUser.Visible         = true;
                InfoClassDayTime.Visible = false;
                InfoRejectReason.Visible = false;

                string[] commandArgs = e.CommandArgument.ToString().Split(new char[] { ',' });
                Session["Id"]   = commandArgs[0];
                Session["Name"] = commandArgs[1];

                DataTable DT       = MPB.Get_Customers_Users_InCustomerClass_ByClassId(int.Parse(Session["Id"].ToString()));
                DataTable DTSource = new DataTable();

                DTSource.Columns.Add("ClassName", typeof(string));
                DTSource.Columns.Add("Name", typeof(string));
                DTSource.Columns.Add("Family", typeof(string));
                DTSource.Columns.Add("UserName", typeof(string));
                //DTSource.Columns.Add("Password", typeof(string));
                for (int i = 0; i < DT.Rows.Count; i++)
                {
                    DataRow row = DTSource.NewRow();
                    row["ClassName"] = Session["Name"].ToString();
                    row["Name"]      = DT.Rows[i]["Name"].ToString();
                    row["Family"]    = DT.Rows[i]["Family"].ToString();
                    row["UserName"]  = "******" + DT.Rows[i]["Id"].ToString();

                    //string Ncode = DT.Rows[i]["NationalCode"].ToString();
                    //if (Ncode == "" || Ncode.Length < 8)
                    //    row["Password"] = DT.Rows[i]["UserPass"].ToString();
                    //else
                    //    row["Password"] = DT.Rows[i]["NationalCode"].ToString();

                    DTSource.Rows.Add(row);
                }

                RadGrid3.DataSource = DTSource;
                RadGrid3.DataBind();
            }

            if (e.CommandName == "MeetingInfo")
            {
                InfoMeeting.Visible      = true;
                InfoUser.Visible         = false;
                InfoClassDayTime.Visible = false;
                InfoRejectReason.Visible = false;

                string[] commandArgs = e.CommandArgument.ToString().Split(new char[] { ',' });
                Session["Id"]   = commandArgs[0];
                Session["Name"] = commandArgs[1];

                DataTable DT       = MPB.Get_Customers_Meeting_ByClassId(int.Parse(Session["Id"].ToString()));
                DataTable DTSource = new DataTable();
                DTSource.Columns.Add("ClassName", typeof(string));
                DTSource.Columns.Add("MeetingLink", typeof(string));

                for (int i = 0; i < DT.Rows.Count; i++)
                {
                    DataRow row = DTSource.NewRow();
                    row["ClassName"] = Session["Name"].ToString();
                    //row["MeetingLink"] = "~/kadobe.iauec.ac.ir"+"/Meeting" + DT.Rows[i]["Id"].ToString();
                    row["MeetingLink"] = "http://kadobe.iauec.ac.ir/Meeting" + DT.Rows[i]["Id"].ToString();
                    DTSource.Rows.Add(row);
                }

                RadGrid2.DataSource = DTSource;
                RadGrid2.DataBind();
            }
            if (e.CommandName == "ClassDayTimeInfo")
            {
                InfoMeeting.Visible      = false;
                InfoUser.Visible         = false;
                InfoClassDayTime.Visible = true;
                InfoRejectReason.Visible = false;

                string[] commandArgs = e.CommandArgument.ToString().Split(new char[] { ',' });
                Session["Id"]   = commandArgs[0];
                Session["Name"] = commandArgs[1];

                DataTable DT       = MPB.Get_Customers_ClassDayTime_ByClassId(int.Parse(Session["Id"].ToString()));
                DataTable DTSource = new DataTable();
                DTSource.Columns.Add("ClassName", typeof(string));
                DTSource.Columns.Add("DayName", typeof(string));
                DTSource.Columns.Add("BEGIN_HOUR", typeof(string));
                DTSource.Columns.Add("END_HOUR", typeof(string));

                for (int i = 0; i < DT.Rows.Count; i++)
                {
                    DataRow row = DTSource.NewRow();
                    row["ClassName"]  = Session["Name"].ToString();
                    row["DayName"]    = DT.Rows[i]["DayName"].ToString();
                    row["BEGIN_HOUR"] = DT.Rows[i]["BEGIN_HOUR"].ToString();
                    row["END_HOUR"]   = DT.Rows[i]["END_HOUR"].ToString();
                    DTSource.Rows.Add(row);
                }

                RadGrid4.DataSource = DTSource;
                RadGrid4.DataBind();
            }
            if (e.CommandName == "RejectReason")
            {
                InfoMeeting.Visible      = false;
                InfoUser.Visible         = false;
                InfoClassDayTime.Visible = false;
                InfoRejectReason.Visible = true;
                string[] commandArgs = e.CommandArgument.ToString().Split(new char[] { ',' });
                Session["Id"]   = commandArgs[0];
                Session["Name"] = commandArgs[1];
                lbl_InfoRejectReason_ClassName.Text = "کلاس: " + Session["Name"].ToString() + " به دلایل زیر رد شده است";
                DataTable DTx = MPB.Get_Customers_ClassName_RejectReason(int.Parse(Session["Id"].ToString()));
                txt_Detail.Text = DTx.Rows[0]["Text"].ToString();
            }
        }
        protected void Page_Load(object sender, EventArgs e)
        {
            string ot  = Request.QueryString["ot"];
            int    pli = cf.PliegosProcesos2(ot, "", fe, fe, 16);

            if (pli == 0)
            {
                btnActualizar.Enabled = false;
                btnPrefactura.Enabled = false;
            }
            lista = cf.ValorizacionProcesos(ot, pli);
            FacturacionEnc fac = cf.BuscaOT(ot);

            lblOT.Text = "OT: " + fac.OT + "  -  " + fac.NombreOT;
            lblTirajeyDespachado.Text = "Tiraje: " + Convert.ToInt32(fac.Tiraje).ToString("N0").Replace(",", ".") + "  - Cant. Despachada: " + Convert.ToInt32(fac.DespachadoEnc).ToString("N0").Replace(",", ".");
            lblPliegos.Text           = "Nro de Pliegos: " + pli;



            if (!IsPostBack)
            {
                //si existe una prefactura parcial!!
                if (cf.verificarPreFactura(ot, "", fe, fe, 9))
                {
                    gv1.DataSource = cf.FacturacionParcial(ot, "", fe, fe, 10);
                    gv1.DataBind();

                    //deshabilitar las cantidades completadas
                    for (int i = 0; i <= gv1.Rows.Count - 1; i++)
                    {
                        if (gv1.Rows[i].Cells[7].Text == "0")
                        {
                            TextBox txtName = ((TextBox)gv1.Rows[i].FindControl("txtEjemplar"));
                            txtName.Enabled = false;

                            TextBox txtName2 = ((TextBox)gv1.Rows[i].FindControl("txtCantidad"));
                            txtName2.Enabled = false;
                        }
                    }
                }
                else
                {
                    gv1.DataSource = cf.ValorizacionProcesos(ot, pli).OrderBy(o => o.Fecha).Where(p => p.ValorUnitario != "0").Where(p => p.Cantidad != "0");
                    gv1.DataBind();
                }



                DateTime f = Convert.ToDateTime("1900-01-01");
                RadGrid4.DataSource = cf.DespachoEncuadernacion(ot, "", f, f, 1);
                RadGrid4.DataBind();



                int total = 0;
                for (int i = 0; i <= gv1.Rows.Count - 1; i++)
                {
                    total = total + Convert.ToInt32(gv1.Rows[i].Cells[7].Text.Replace(".", "").Replace("$", "").Trim());
                }
                lblTotal.Text = "$   " + total.ToString("N0").Replace(",", ".");



                RadGrid3.DataSource = cf.ListaPrefacturas(ot);
                RadGrid3.DataBind();
            }
        }
        protected void btnFiltro_Click1(object sender, EventArgs e)
        {
            if (txtFechaInicio.Text != "" && txtFechaTermino.Text != "")
            {
                if (ddlSeccion.SelectedValue.ToString() != "Seleccione...")
                {
                    string[] str  = txtFechaInicio.Text.Split('/');
                    DateTime fi   = Convert.ToDateTime(str[1] + "/" + str[0] + "/" + str[2] + " 00:00:00");
                    string[] str2 = txtFechaTermino.Text.Split('/');
                    DateTime ft   = Convert.ToDateTime(str2[1] + "/" + str2[0] + "/" + str2[2] + " 23:59:59");
                    try
                    {
                        RadGrid2.DataSource = inf.ListaInformeMaquina("", "", fi, ft, 0);
                        RadGrid2.DataBind();
                    }
                    catch
                    {
                    }
                    try
                    {
                        RadGrid1.DataSource = inf.ListaInformeMaquinaPorTurno("", "", fi, ft, 3);
                        RadGrid1.DataBind();
                    }
                    catch
                    {
                    }
                    try
                    {
                        RadGrid3.DataSource = inf.ListaInformeMaquinaAcumuladoMes("", "", fi, ft, 5);
                        RadGrid3.DataBind();
                    }
                    catch
                    {
                    }
                    try
                    {
                        RadGrid4.DataSource = inf.ListaInformeMaquinaAcumuladoMes("", "", fi, ft, 6);
                        RadGrid4.DataBind();
                    }
                    catch
                    {
                    }
                    #region MES
                    string Mes = "";
                    switch (fi.Month)
                    {
                    case 1:
                        Mes = "Enero";
                        break;

                    case 2:
                        Mes = "Febrero";
                        break;

                    case 3:
                        Mes = "Marzo";
                        break;

                    case 4:
                        Mes = "Abril";
                        break;

                    case 5:
                        Mes = "Mayo";
                        break;

                    case 6:
                        Mes = "Junio";
                        break;

                    case 7:
                        Mes = "Julio";
                        break;

                    case 8:
                        Mes = "Agosto";
                        break;

                    case 9:
                        Mes = "Septiembre";
                        break;

                    case 10:
                        Mes = "Octubre";
                        break;

                    case 11:
                        Mes = "Noviembre";
                        break;

                    case 12:
                        Mes = "Diciembre";
                        break;
                    }
                    #endregion

                    lblMes.Text = Mes;
                    lblAño.Text = fi.Year.ToString();
                }
            }
        }