void ValidaArticulo() { tb_pt_articuloBL BL = new tb_pt_articuloBL(); tb_pt_articulo BE = new tb_pt_articulo(); DataTable dt = new DataTable(); ArmaGrilla(); BE.top = true; BE.articidold = txt_articid.Text.ToString().ToUpper(); if (txt_articid.Text.ToString().Length == 7) { dt = BL.GetAll(EmpresaID, BE).Tables[0]; if (dt.Rows.Count > 0) { xarticid = dt.Rows[0]["articid"].ToString(); txt_articid.Text = dt.Rows[0]["articidold"].ToString(); txt_articname.Text = dt.Rows[0]["articname"].ToString(); txt_marcaname.Text = dt.Rows[0]["marcaname"].ToString(); txt_lineaname.Text = dt.Rows[0]["lineaname"].ToString(); txt_generoname.Text = dt.Rows[0]["generoname"].ToString(); txt_temporadaname.Text = dt.Rows[0]["temporadaname"].ToString(); txt_familiatelaname.Text = dt.Rows[0]["familianame"].ToString(); cmb_canalvta.SelectedValue = dt.Rows[0]["canalventaid"].ToString(); txt_variante.Text = dt.Rows[0]["variante"].ToString(); tb_pt_tallaBL BL2 = new tb_pt_tallaBL(); tb_pt_talla BE2 = new tb_pt_talla(); DataTable tall = new DataTable(); BE2.tallaid = dt.Rows[0]["tallaid"].ToString(); tall = BL2.GetAll(EmpresaID, BE2).Tables[0]; dgv_grilla.Columns[1].HeaderText = tall.Rows[0]["talla01"].ToString(); dgv_grilla.Columns[2].HeaderText = tall.Rows[0]["talla02"].ToString(); dgv_grilla.Columns[3].HeaderText = tall.Rows[0]["talla03"].ToString(); dgv_grilla.Columns[4].HeaderText = tall.Rows[0]["talla04"].ToString(); dgv_grilla.Columns[5].HeaderText = tall.Rows[0]["talla05"].ToString(); dgv_grilla.Columns[6].HeaderText = tall.Rows[0]["talla06"].ToString(); dgv_grilla.Columns[7].HeaderText = tall.Rows[0]["talla07"].ToString(); dgv_grilla.Columns[8].HeaderText = tall.Rows[0]["talla08"].ToString(); dgv_grilla.Columns[9].HeaderText = tall.Rows[0]["talla09"].ToString(); dgv_grilla.Columns[10].HeaderText = tall.Rows[0]["talla10"].ToString(); dgv_grilla.Columns[11].HeaderText = tall.Rows[0]["talla11"].ToString(); dgv_grilla.Columns[12].HeaderText = tall.Rows[0]["talla12"].ToString(); dgv_grilla.Columns[1].ReadOnly = !Convert.ToBoolean(dt.Rows[0]["ta01"]); dgv_grilla.Columns[1].DefaultCellStyle.BackColor = !(Convert.ToBoolean(dt.Rows[0]["ta01"])) == true ? Color.LightSteelBlue : Color.Teal; dgv_grilla.Columns[2].ReadOnly = !Convert.ToBoolean(dt.Rows[0]["ta02"]); dgv_grilla.Columns[2].DefaultCellStyle.BackColor = !(Convert.ToBoolean(dt.Rows[0]["ta02"])) == true ? Color.LightSteelBlue : Color.Teal; dgv_grilla.Columns[3].ReadOnly = !Convert.ToBoolean(dt.Rows[0]["ta03"]); dgv_grilla.Columns[3].DefaultCellStyle.BackColor = !(Convert.ToBoolean(dt.Rows[0]["ta03"])) == true ? Color.LightSteelBlue : Color.Teal; dgv_grilla.Columns[4].ReadOnly = !Convert.ToBoolean(dt.Rows[0]["ta04"]); dgv_grilla.Columns[4].DefaultCellStyle.BackColor = !(Convert.ToBoolean(dt.Rows[0]["ta04"])) == true ? Color.LightSteelBlue : Color.Teal; dgv_grilla.Columns[5].ReadOnly = !Convert.ToBoolean(dt.Rows[0]["ta05"]); dgv_grilla.Columns[5].DefaultCellStyle.BackColor = !(Convert.ToBoolean(dt.Rows[0]["ta05"])) == true ? Color.LightSteelBlue : Color.Teal; dgv_grilla.Columns[6].ReadOnly = !Convert.ToBoolean(dt.Rows[0]["ta06"]); dgv_grilla.Columns[6].DefaultCellStyle.BackColor = !(Convert.ToBoolean(dt.Rows[0]["ta06"])) == true ? Color.LightSteelBlue : Color.Teal; dgv_grilla.Columns[7].ReadOnly = !Convert.ToBoolean(dt.Rows[0]["ta07"]); dgv_grilla.Columns[7].DefaultCellStyle.BackColor = !(Convert.ToBoolean(dt.Rows[0]["ta07"])) == true ? Color.LightSteelBlue : Color.Teal; dgv_grilla.Columns[8].ReadOnly = !Convert.ToBoolean(dt.Rows[0]["ta08"]); dgv_grilla.Columns[8].DefaultCellStyle.BackColor = !(Convert.ToBoolean(dt.Rows[0]["ta08"])) == true ? Color.LightSteelBlue : Color.Teal; dgv_grilla.Columns[9].ReadOnly = !Convert.ToBoolean(dt.Rows[0]["ta09"]); dgv_grilla.Columns[9].DefaultCellStyle.BackColor = !(Convert.ToBoolean(dt.Rows[0]["ta09"])) == true ? Color.LightSteelBlue : Color.Teal; dgv_grilla.Columns[10].ReadOnly = !Convert.ToBoolean(dt.Rows[0]["ta10"]); dgv_grilla.Columns[10].DefaultCellStyle.BackColor = !(Convert.ToBoolean(dt.Rows[0]["ta10"])) == true ? Color.LightSteelBlue : Color.Teal; dgv_grilla.Columns[11].ReadOnly = !Convert.ToBoolean(dt.Rows[0]["ta11"]); dgv_grilla.Columns[11].DefaultCellStyle.BackColor = !(Convert.ToBoolean(dt.Rows[0]["ta11"])) == true ? Color.LightSteelBlue : Color.Teal; dgv_grilla.Columns[12].ReadOnly = !Convert.ToBoolean(dt.Rows[0]["ta12"]); dgv_grilla.Columns[12].DefaultCellStyle.BackColor = !(Convert.ToBoolean(dt.Rows[0]["ta12"])) == true ? Color.LightSteelBlue : Color.Teal; lbltaco01.Text = tall.Rows[0]["talla01"].ToString(); lbltaco02.Text = tall.Rows[0]["talla02"].ToString(); lbltaco03.Text = tall.Rows[0]["talla03"].ToString(); lbltaco04.Text = tall.Rows[0]["talla04"].ToString(); lbltaco05.Text = tall.Rows[0]["talla05"].ToString(); lbltaco06.Text = tall.Rows[0]["talla06"].ToString(); lbltaco07.Text = tall.Rows[0]["talla07"].ToString(); lbltaco08.Text = tall.Rows[0]["talla08"].ToString(); lbltaco09.Text = tall.Rows[0]["talla09"].ToString(); lbltaco10.Text = tall.Rows[0]["talla10"].ToString(); lbltaco11.Text = tall.Rows[0]["talla11"].ToString(); lbltaco12.Text = tall.Rows[0]["talla12"].ToString(); txt_taco01.Enabled = Convert.ToBoolean(dt.Rows[0]["ta01"]); txt_taco01.BackColor = (Convert.ToBoolean(dt.Rows[0]["ta01"])) == true ? Color.Teal : Color.White; txt_taco01.ForeColor = (Convert.ToBoolean(dt.Rows[0]["ta01"])) == true ? Color.White : Color.Black; txt_taco02.Enabled = Convert.ToBoolean(dt.Rows[0]["ta02"]); txt_taco02.BackColor = (Convert.ToBoolean(dt.Rows[0]["ta02"])) == true ? Color.Teal : Color.White; txt_taco02.ForeColor = (Convert.ToBoolean(dt.Rows[0]["ta02"])) == true ? Color.White : Color.Black; txt_taco03.Enabled = Convert.ToBoolean(dt.Rows[0]["ta03"]); txt_taco03.BackColor = (Convert.ToBoolean(dt.Rows[0]["ta03"])) == true ? Color.Teal : Color.White; txt_taco03.ForeColor = (Convert.ToBoolean(dt.Rows[0]["ta03"])) == true ? Color.White : Color.Black; txt_taco04.Enabled = Convert.ToBoolean(dt.Rows[0]["ta04"]); txt_taco04.BackColor = (Convert.ToBoolean(dt.Rows[0]["ta04"])) == true ? Color.Teal : Color.White; txt_taco04.ForeColor = (Convert.ToBoolean(dt.Rows[0]["ta04"])) == true ? Color.White : Color.Black; txt_taco05.Enabled = Convert.ToBoolean(dt.Rows[0]["ta05"]); txt_taco05.BackColor = (Convert.ToBoolean(dt.Rows[0]["ta05"])) == true ? Color.Teal : Color.White; txt_taco05.ForeColor = (Convert.ToBoolean(dt.Rows[0]["ta05"])) == true ? Color.White : Color.Black; txt_taco06.Enabled = Convert.ToBoolean(dt.Rows[0]["ta06"]); txt_taco06.BackColor = (Convert.ToBoolean(dt.Rows[0]["ta06"])) == true ? Color.Teal : Color.White; txt_taco06.ForeColor = (Convert.ToBoolean(dt.Rows[0]["ta06"])) == true ? Color.White : Color.Black; txt_taco07.Enabled = Convert.ToBoolean(dt.Rows[0]["ta07"]); txt_taco07.BackColor = (Convert.ToBoolean(dt.Rows[0]["ta07"])) == true ? Color.Teal : Color.White; txt_taco07.ForeColor = (Convert.ToBoolean(dt.Rows[0]["ta07"])) == true ? Color.White : Color.Black; txt_taco08.Enabled = Convert.ToBoolean(dt.Rows[0]["ta08"]); txt_taco08.BackColor = (Convert.ToBoolean(dt.Rows[0]["ta08"])) == true ? Color.Teal : Color.White; txt_taco08.ForeColor = (Convert.ToBoolean(dt.Rows[0]["ta08"])) == true ? Color.White : Color.Black; txt_taco09.Enabled = Convert.ToBoolean(dt.Rows[0]["ta09"]); txt_taco09.BackColor = (Convert.ToBoolean(dt.Rows[0]["ta09"])) == true ? Color.Teal : Color.White; txt_taco09.ForeColor = (Convert.ToBoolean(dt.Rows[0]["ta09"])) == true ? Color.White : Color.Black; txt_taco10.Enabled = Convert.ToBoolean(dt.Rows[0]["ta10"]); txt_taco10.BackColor = (Convert.ToBoolean(dt.Rows[0]["ta10"])) == true ? Color.Teal : Color.White; txt_taco10.ForeColor = (Convert.ToBoolean(dt.Rows[0]["ta10"])) == true ? Color.White : Color.Black; txt_taco11.Enabled = Convert.ToBoolean(dt.Rows[0]["ta11"]); txt_taco11.BackColor = (Convert.ToBoolean(dt.Rows[0]["ta11"])) == true ? Color.Teal : Color.White; txt_taco11.ForeColor = (Convert.ToBoolean(dt.Rows[0]["ta11"])) == true ? Color.White : Color.Black; txt_taco12.Enabled = Convert.ToBoolean(dt.Rows[0]["ta12"]); txt_taco12.BackColor = (Convert.ToBoolean(dt.Rows[0]["ta12"])) == true ? Color.Teal : Color.White; txt_taco12.ForeColor = (Convert.ToBoolean(dt.Rows[0]["ta12"])) == true ? Color.White : Color.Black; //dgv_grilla.Columns[12].HeaderText = tall.Rows[0]["talla12"].ToString(); dgv_ordenprodcolor.Columns[6].HeaderText = tall.Rows[0]["talla01"].ToString(); dgv_ordenprodcolor.Columns[7].HeaderText = tall.Rows[0]["talla02"].ToString(); dgv_ordenprodcolor.Columns[8].HeaderText = tall.Rows[0]["talla03"].ToString(); dgv_ordenprodcolor.Columns[9].HeaderText = tall.Rows[0]["talla04"].ToString(); dgv_ordenprodcolor.Columns[10].HeaderText = tall.Rows[0]["talla05"].ToString(); dgv_ordenprodcolor.Columns[11].HeaderText = tall.Rows[0]["talla06"].ToString(); dgv_ordenprodcolor.Columns[12].HeaderText = tall.Rows[0]["talla07"].ToString(); dgv_ordenprodcolor.Columns[13].HeaderText = tall.Rows[0]["talla08"].ToString(); dgv_ordenprodcolor.Columns[14].HeaderText = tall.Rows[0]["talla09"].ToString(); dgv_ordenprodcolor.Columns[15].HeaderText = tall.Rows[0]["talla10"].ToString(); dgv_ordenprodcolor.Columns[16].HeaderText = tall.Rows[0]["talla11"].ToString(); dgv_ordenprodcolor.Columns[17].HeaderText = tall.Rows[0]["talla12"].ToString(); } } }
private void ValidaArticulo(String xcod) { var BE = new tb_pt_articulo(); var BL = new tb_pt_articuloBL(); var dt = new DataTable(); BE.articid = xcod.Trim(); dt = BL.GetAll(EmpresaID, BE).Tables[0]; if (dt.Rows.Count > 0) { articid.Text = dt.Rows[0]["articid"].ToString(); articidold.Text = dt.Rows[0]["articidold"].ToString(); articname.Text = dt.Rows[0]["articname"].ToString(); } else { articid.Text = string.Empty; articidold.Text = string.Empty; articname.Text = string.Empty; } }
private void MetodoCargarLineal() { tb_pt_articuloBL BL = new tb_pt_articuloBL(); tb_pt_articulo BE = new tb_pt_articulo(); DataTable dt = new DataTable(); BE.articidold = txt_articidold.Text.ToUpper(); dt = BL.GetAll(Session["ssEmpresaID"].ToString(), BE).Tables[0]; if (dt.Rows.Count > 0) { Session["bd_marcaid"] = dt.Rows[0]["marcaid"].ToString(); txt_marcaname.Text = dt.Rows[0]["marcaname"].ToString(); Session["bd_articid"] = dt.Rows[0]["articid"].ToString(); txt_articname.Text = dt.Rows[0]["articname"].ToString(); txt_precventa_cre_menor.Text = dt.Rows[0]["precventa_cre_menor"].ToString(); Session["bd_tallaid"] = dt.Rows[0]["tallaid"].ToString(); // Metodos De Cargar Combos CargarComboArticuloColor(dt.Rows[0]["articid"].ToString()); CargarComboArticuloTallas(dt.Rows[0]["tallaid"].ToString()); btn_add.Enabled = true; btn_add.CssClass = "boton_add2"; } }
private void data_gridArticulo() { tb_pt_articuloBL BL = new tb_pt_articuloBL(); tb_pt_articulo BE = new tb_pt_articulo(); DataTable dt = new DataTable(); BE.articidold = txt_articidold.Text.ToUpper(); switch (cbo_filtro.SelectedValue) { case "01": BE.articidold = txt_filter.Text.Trim().ToUpper(); break; case "02": BE.articname = txt_filter.Text.Trim().ToUpper(); break; default: //** break; } try { //Eliminar Columnas Actuales(Opcional): GridView1.Columns.Clear(); GridView1.Width = 550; //Objeto Columna: CommandField image; //Crear Columna: image = new CommandField(); image.ButtonType = ButtonType.Image; image.SelectImageUrl = "~/Images/go-search.png"; image.ShowSelectButton = true; image.ItemStyle.Width = 10; image.ItemStyle.Wrap = true; GridView1.Columns.Add(image); BoundField ARTICIDOLD; ARTICIDOLD = new BoundField(); ARTICIDOLD.DataField = "articidold"; ARTICIDOLD.HeaderText = "CODIGO_OLD"; ARTICIDOLD.ItemStyle.Width = 70; GridView1.Columns.Add(ARTICIDOLD); BoundField ARTICNAME; ARTICNAME = new BoundField(); ARTICNAME.DataField = "articname"; ARTICNAME.HeaderText = "ARTICULO"; ARTICNAME.ItemStyle.Width = 250; GridView1.Columns.Add(ARTICNAME); GridView1.DataSource = BL.GetAll(Session["ssEmpresaID"].ToString(), BE); GridView1.DataBind(); GridView1.Visible = true; } catch (Exception ex) { ClientMessage(ex.Message); } }
void ValidaArticulo() { try { tb_pt_articuloBL BL = new tb_pt_articuloBL(); tb_pt_articulo BE = new tb_pt_articulo(); DataTable dt = new DataTable(); BE.top = true; BE.articidold = txt_articidold.Text; if (txt_articidold.Text.ToString().Trim().Length == 7) { dt = BL.GetAll(EmpresaID, BE).Tables[0]; if (dt.Rows.Count > 0) { /************************** * PONEMOS NOMBRE A LAS COLUMNAS DEACUERDO A LA TALLAID * ***************/ tb_pt_tallaBL BL4 = new tb_pt_tallaBL(); tb_pt_talla BE4 = new tb_pt_talla(); DataTable tall = new DataTable(); BE4.tallaid = dt.Rows[0]["tallaid"].ToString(); tall = BL4.GetAll(EmpresaID, BE4).Tables[0]; dgv_color.Columns[3].HeaderText = tall.Rows[0]["talla01"].ToString(); dgv_color.Columns[4].HeaderText = tall.Rows[0]["talla02"].ToString(); dgv_color.Columns[5].HeaderText = tall.Rows[0]["talla03"].ToString(); dgv_color.Columns[6].HeaderText = tall.Rows[0]["talla04"].ToString(); dgv_color.Columns[7].HeaderText = tall.Rows[0]["talla05"].ToString(); dgv_color.Columns[8].HeaderText = tall.Rows[0]["talla06"].ToString(); dgv_color.Columns[9].HeaderText = tall.Rows[0]["talla07"].ToString(); dgv_color.Columns[10].HeaderText = tall.Rows[0]["talla08"].ToString(); dgv_color.Columns[11].HeaderText = tall.Rows[0]["talla09"].ToString(); dgv_color.Columns[12].HeaderText = tall.Rows[0]["talla10"].ToString(); dgv_color.Columns[13].HeaderText = tall.Rows[0]["talla11"].ToString(); dgv_color.Columns[14].HeaderText = tall.Rows[0]["talla12"].ToString(); } } } catch (Exception ex) { MessageBox.Show(ex.Message); } }
void ValidaArticulo() { tb_pt_articuloBL BL = new tb_pt_articuloBL(); tb_pt_articulo BE = new tb_pt_articulo(); tb_pt_articulo BE2 = new tb_pt_articulo(); DataTable dt = new DataTable(); BE.articidold = txt_articidold.Text; dt = BL.GetAll(EmpresaID,BE).Tables[0]; if (dt.Rows.Count > 0) { txt_articidold.Text = dt.Rows[0]["articidold"].ToString(); txt_articname.Text = dt.Rows[0]["articname"].ToString(); BE2.articid = dt.Rows[0]["articid"].ToString(); xarticid = dt.Rows[0]["articid"].ToString(); // Aca Generamos el Nuevo Correlativo GeneraVersion(dt.Rows[0]["articid"].ToString()); BE2.top = true; if (txt_articidold.Text.ToString().Length == 7 || txt_articidoldbus.Text.ToString().Length == 7) { dt = BL.GetAll_Color(EmpresaID, BE2).Tables[0]; if (dt.Rows.Count > 0) { dgv_color.Columns[2].HeaderText = dt.Rows[0]["talla01"].ToString(); dgv_color.Columns[3].HeaderText = dt.Rows[0]["talla02"].ToString(); dgv_color.Columns[4].HeaderText = dt.Rows[0]["talla03"].ToString(); dgv_color.Columns[5].HeaderText = dt.Rows[0]["talla04"].ToString(); dgv_color.Columns[6].HeaderText = dt.Rows[0]["talla05"].ToString(); dgv_color.Columns[7].HeaderText = dt.Rows[0]["talla06"].ToString(); dgv_color.Columns[8].HeaderText = dt.Rows[0]["talla07"].ToString(); dgv_color.Columns[9].HeaderText = dt.Rows[0]["talla08"].ToString(); dgv_color.Columns[10].HeaderText = dt.Rows[0]["talla09"].ToString(); dgv_color.Columns[11].HeaderText = dt.Rows[0]["talla10"].ToString(); dgv_color.Columns[12].HeaderText = dt.Rows[0]["talla11"].ToString(); dgv_color.Columns[13].HeaderText = dt.Rows[0]["talla12"].ToString(); dgv_color.AutoGenerateColumns = false; dgv_color.DataSource = dt; dgv_color.Enabled = true; } } } }