private void CaricaDitte() { int id_bl = 0; string bl_id = RicercaModulo1.TxtCodice.Text; // Carico Le Ditte if (bl_id != "") { // Mi recupero l'idbl DataSet _MyDsDittaBl; Classi.Function _Fun = new TheSite.Classi.Function(); _MyDsDittaBl = _Fun.GetIdBL(bl_id); if (_MyDsDittaBl.Tables[0].Rows.Count > 0) { DataRow _DrBl = _MyDsDittaBl.Tables[0].Rows[0]; id_bl = Int32.Parse(_DrBl[0].ToString()); BindDitte(id_bl); } } else { id_bl = 0; BindDitte(id_bl); } }
private bool IsDupRdl() { Classi.Function _Function = new TheSite.Classi.Function(); string tabella = "Fattura_wr"; string campo_input = "WR_ID"; string valore = rdl.Value.Substring(0, rdl.Value.Length - 1); string valore2 = Convert.ToString(itemId); string operazione = ""; if (itemId == 0) { operazione = "Insert"; } else { operazione = "Update"; } string campo_output = "Fattura_ID"; DataSet _MyDs = _Function.ControllaDuplicatoRDL(tabella, campo_input, valore, valore2, campo_output, operazione); if (_MyDs.Tables[0].Rows.Count == 0) { return(false); } else { return(true); // DataRow _Dr = _MyDs.Tables[0].Rows[0]; // if (itemId > 0) // { // if (Int32.Parse(_Dr[0].ToString()) != itemId) // { // return true; // } // else // { // return false; // } // } // else // { // return true; // } } }
private void DataGridRicerca_ItemDataBound(object sender, System.Web.UI.WebControls.DataGridItemEventArgs e) { if ((e.Item.ItemType == ListItemType.Item) || (e.Item.ItemType == ListItemType.AlternatingItem)) { //Formatto La data string _CampoData = e.Item.Cells[9].Text.Trim(); if (_CampoData.Length > 0) { DateTime _Data = Convert.ToDateTime(e.Item.Cells[9].Text.Trim()); string mese = Classi.Function.ImpostaMese(_Data.Month, false); string anno = _Data.Year.ToString(); e.Item.Cells[9].Text = mese + " - " + anno; e.Item.Cells[9].ToolTip = _CampoData; } //Visualizzo il tooltip delle WR legate alla WO Classi.Function _Fun = new TheSite.Classi.Function(); int wo_id = Int32.Parse(e.Item.Cells[0].Text); DataSet _MyDsWr = _Fun.GetWRfromWO(wo_id); int tot_record = _MyDsWr.Tables[0].Rows.Count; if (tot_record > 0) { string mes_tooltip = "Riferimento a RDL n°:"; string wr_id = ""; int n = 0; while (tot_record > n) { wr_id = _MyDsWr.Tables[0].Rows[n]["wr_id"].ToString(); mes_tooltip += "\n" + wr_id; n++; } e.Item.Cells[2].ToolTip = mes_tooltip; } //RICECCO if (Session["CheckedListMP"] != null) { Hashtable _HS = (Hashtable)Session["CheckedListMP"]; if (_HS.ContainsKey(wo_id)) { System.Web.UI.WebControls.CheckBox cb = (System.Web.UI.WebControls.CheckBox)e.Item.Cells[1].FindControl("ChkSel"); cb.Checked = System.Boolean.Parse(_HS[wo_id].ToString()); } } } }
private bool IsDup() { Classi.Function _Function = new TheSite.Classi.Function(); // Nome della tabella string tabella = "Ditta"; // Nome del campo sui cui effettuare la ricerca (WHERE) string campo_input = "Descrizione"; // Il campo valore è relativo alla stringa string valore = "'" + txtsDescrizione.Text.Trim().Replace("'", "''") + "'"; //valore = valore.Replace("'","''"); // Nome del Campo restituito in Output string campo_output = "Ditta_ID"; DataSet _MyDs = _Function.ControllaDuplicato(tabella, campo_input, valore, campo_output); // Controllo se ho trovato qualcosa con la descrizione passata in input if (_MyDs.Tables[0].Rows.Count == 0) // se non trovo niente retistuisco false { return(false); } else { DataRow _Dr = _MyDs.Tables[0].Rows[0]; // Controllo Se sono in modifica if (itemId > 0) { //Controllo se sto modificando me stesso if (Int32.Parse(_Dr[0].ToString()) != itemId) { return(true); // se non sto modificando me stesso restituisco true } else { return(false); // se non sto modificando me stesso restituisco false } } else { return(true); // se sto inserendo e ho trovato qualcosa restituisco true } } }
private bool ControllaDup() { Classi.Function _Function = new TheSite.Classi.Function(); // Nome della tabella string tabella = "Contabilizzazione"; // Nome del campo sui cui effettuare la ricerca (WHERE) string campo_input = "Contabilizzazione"; // Il campo valore è relativo alla stringa string valore = "'" + txtsdescrizione.Text.Trim().Replace("'", "''") + "'"; // Nome del Campo restituito in Output string campo_output = "IdContabilizzazione"; DataSet _MyDs = _Function.ControllaDuplicato(tabella, campo_input, valore, campo_output); if (_MyDs.Tables[0].Rows.Count == 0) { return(true); } else { return(false); } }
private bool IsDupPeriodoFAttura() { Classi.Function _Function = new TheSite.Classi.Function(); string tabella = "Fattura"; string campo_input = "PERIODO_INIZIO_FATTURA"; string campo_input1 = "PERIODO_FINE_FATTURA"; string valore = "'" + cmbAnnoDa.SelectedValue + cmbDaMese.SelectedValue + "'"; string valore1 = "'" + cmbAnnoA.SelectedValue + cmbAMese.SelectedValue + "'"; string campo_output = "Fattura_ID"; DataSet _MyDs = _Function.ControllaDuplicatoPeriodo(tabella, campo_input, campo_input1, valore, valore1, campo_output); if (_MyDs.Tables[0].Rows.Count == 0) { return(false); } else { DataRow _Dr = _MyDs.Tables[0].Rows[0]; if (itemId > 0) { if (Int32.Parse(_Dr[0].ToString()) != itemId) { return(true); // se non sto modificando me stesso restituisco true } else { return(false); // se non sto modificando me stesso restituisco false } } else { return(true); // se sto inserendo e ho trovato qualcosa restituisco true } } }