bool CamposOK() { bool booEstado = true; int n_row = 0; for (n_row = 2; n_row <= FgCtto.Rows.Count - 1; n_row++) { if (FgCtto.GetData(n_row, 1).ToString() == "") { MessageBox.Show("¡ No ha especificado el numero de puesto a contratar !", "", MessageBoxButtons.OK, MessageBoxIcon.Information, MessageBoxDefaultButton.Button1); booEstado = false; FgCtto.Focus(); return(booEstado); } if (FgCtto.GetData(n_row, 2).ToString() == "") { MessageBox.Show("¡ No ha especificado numero de contrato !", "", MessageBoxButtons.OK, MessageBoxIcon.Information, MessageBoxDefaultButton.Button1); booEstado = false; FgCtto.Focus(); return(booEstado); } if (funFunciones.NulosC(FgCtto.GetData(n_row, 3)) == "") { MessageBox.Show("¡ No ha especificado la fecha de inicio del contrato !", "", MessageBoxButtons.OK, MessageBoxIcon.Information, MessageBoxDefaultButton.Button1); booEstado = false; FgCtto.Focus(); return(booEstado); } if (funFunciones.NulosC(FgCtto.GetData(n_row, 4)) == "") { MessageBox.Show("¡ No ha especificado la fecha de termino del contrato !", "", MessageBoxButtons.OK, MessageBoxIcon.Information, MessageBoxDefaultButton.Button1); booEstado = false; FgCtto.Focus(); return(booEstado); } if (FgCtto.GetData(n_row, 5).ToString() == "") { MessageBox.Show("¡ No ha especificado el tipo de documento de cobranza que se aplicara al contrato !", "", MessageBoxButtons.OK, MessageBoxIcon.Information, MessageBoxDefaultButton.Button1); booEstado = false; FgCtto.Focus(); return(booEstado); } } return(booEstado); }
void AsignarEntidad() { if (n_QueHace == 1) { // BE_ListaReg.n_id = 0; } else { // BE_ListaReg.n_id = BE_Registro.n_id; } int n_row = 0; string c_dato = ""; lstSocPue.Clear(); for (n_row = 2; n_row <= FgCtto.Rows.Count - 1; n_row++) { BE_COO_SOCIOSPUESTOS entSocPue = new BE_COO_SOCIOSPUESTOS(); entSocPue.n_idemp = STU_SISTEMA.EMPRESAID; entSocPue.n_id = Convert.ToInt32(FgCtto.GetData(n_row, 9).ToString()); entSocPue.n_idsoc = Convert.ToInt32(FgCtto.GetData(n_row, 8).ToString()); entSocPue.n_idpue = Convert.ToInt32(FgCtto.GetData(n_row, 7).ToString()); entSocPue.c_puesto = FgCtto.GetData(n_row, 1).ToString(); entSocPue.c_numctt = FgCtto.GetData(n_row, 2).ToString(); entSocPue.d_fchini = Convert.ToDateTime(FgCtto.GetData(n_row, 3).ToString()); entSocPue.d_fchfin = Convert.ToDateTime(FgCtto.GetData(n_row, 4).ToString()); if (FgCtto.GetData(n_row, 6).ToString() == "ACTIVO") { entSocPue.n_activo = 1; } else { entSocPue.n_activo = 2; } c_dato = FgCtto.GetData(n_row, 5).ToString(); c_dato = funDatos.DataTableBuscar(dtDocCom, "c_des", "n_id", c_dato, "C").ToString(); entSocPue.n_idtipdocemi = Convert.ToInt32(c_dato); if (funFunciones.NulosC(FgCtto.GetData(n_row, 10)) != "") { entSocPue.d_fchter = Convert.ToDateTime(FgCtto.GetData(n_row, 10).ToString()); } lstSocPue.Add(entSocPue); } }
private void CmdAddCtt_Click(object sender, EventArgs e) { if (n_QueHace == 3) { return; } if (funFunciones.NulosC(FgCtto.GetData(FgCtto.Rows.Count - 1, 1)) == "") { MessageBox.Show("¡ No ha especificado el puesto para el ultimo registro agregado !", "", MessageBoxButtons.OK, MessageBoxIcon.Information, MessageBoxDefaultButton.Button1); return; } booAgregando = true; FgCtto.Rows.Count = FgCtto.Rows.Count + 1; string c_dato = ""; c_dato = LblIdSocio.Text; FgCtto.SetData(FgCtto.Rows.Count - 1, 8, c_dato); // ID DEL SOCIO FgCtto.SetData(FgCtto.Rows.Count - 1, 9, "0"); // ID DEL REGISTRO FgCtto.SetData(FgCtto.Rows.Count - 1, 6, "ACTIVO"); // ESTADO DEL REGISTRO POR DEFAULT ACTIVO CUANDO ES NUEVO booAgregando = false; }
private void FgCtto_CellChanged(object sender, C1.Win.C1FlexGrid.RowColEventArgs e) { if (n_QueHace == 3) { FgCtto.AllowEditing = false; return; } if (booAgregando == true) { return; } if (FgCtto.Col == 1) { string c_dato = ""; c_dato = FgCtto.GetData(FgCtto.Row, 1).ToString(); c_dato = funDatos.DataTableBuscar(dtPuestos, "c_puesto", "n_id", c_dato, "C").ToString(); FgCtto.SetData(FgCtto.Row, 7, c_dato); FgCtto.SetData(FgCtto.Row, 8, LblIdSocio.Text); FgCtto.Select(e.Row - 1, 2); return; } //if (FgCtto.Col == 2) //{ // MostrarUnidadMedida(e.Row, FgCtto.GetData(e.Row, 2).ToString()); // GenerarNumeroLote(e.Row, FgCtto.GetData(e.Row, 2).ToString()); // FgItems.Select(e.Row - 1, 3); // return; //} //if (FgCtto.Col == 3) //{ // FgCtto.Select(e.Row - 1, 4); // return; //} //if (FgCtto.Col == 4) //{ // FgCtto.Select(e.Row - 1, 5); // return; //} //if (FgCtto.Col == 5) //{ // FgCtto.SetData(FgCtto.Row, 5, FgCtto.GetData(FgCtto.Row, 5).ToString().ToUpper()); // FgCtto.Select(e.Row - 1, 6); // return; //} //if (FgCtto.Col == 6) //{ // booAgregando = true; // FgCtto.SetData(e.Row, 7, ""); // FgCtto.SetData(e.Row, 8, ""); // FgCtto.Select(e.Row - 1, 7); // booAgregando = false; // return; //} //if (FgItems.Col == 7) //{ // booAgregando = true; // FgCtto.SetData(e.Row, 8, ""); // FgCtto.Select(e.Row - 1, 8); // booAgregando = false; // return; //} //if (FgCtto.Col == 8) //{ // FgCtto.Select(e.Row - 1, 9); // return; //} //if (FgCtto.Col == 9) //{ // FgCtto.Select(e.Row - 1, 10); // return; //} //if (FgCtto.Col == 10) //{ // FgItems.Select(e.Row, 2); // return; //} }