2 using System.Collections.Generic;
6 using System.ComponentModel;
11 using System.Windows.Forms;
13 using System.ComponentModel.DataAnnotations;
22 public bool _EnUso =
false;
28 [DisplayName(
"CODIGO")]
29 public override string _Codigo
38 base._Codigo = (! String.IsNullOrEmpty(value) ? value.ToString().PadLeft(3,
'0') : value);
45 [FieldName(
"Solucion")]
46 [DisplayName(
"SOLUCION")]
48 [DataType(DataType.Text)]
49 public string _Solucion
53 return Convert.ToString(_Campo(GetFieldName(nameof(_Solucion))));
62 _Campo(GetFieldName(nameof(_Solucion)), value);
85 this._Codigo = tcCodigo;
89 private void Inicializar()
92 this._Clave =
"Codigo";
93 this._DataBase =
"SERVICES";
94 this._Tabla =
"solucion";
95 this._TituloMantenimiento =
"Mantenimiento de definiciones de soluciones";
97 this._Pantalla =
"solucion_net";
98 this._FormManteBaseType = typeof(Visual.Forms.frmSolucion);
100 this._Codigo =
string.Empty;
111 DataTable ldtInf =
new DataTable();
112 string lcMensaje =
string.Empty;
115 lcSql = String.Format(
"SELECT COUNT(*) AS registros, Max(NUMERO) FROM {0} WHERE COD_SOLUC = '" + _Codigo +
"'", DB.SQLDatabase(
"SERVICES",
"C_SERVICIOS"));
117 DB.SQLExec(lcSql, ref ldtInf);
119 if (ldtInf == null || ldtInf.Rows.Count == 0)
123 var loInf = ldtInf.AsEnumerable().Where(y => y.Field<Int32>(
"registros") != 0).ToList();
124 if (loInf.Count() == 0)
128 for (
int lnInd = 0; lnInd < loInf.Count(); lnInd++)
130 if (!
string.IsNullOrWhiteSpace(lcMensaje))
131 lcMensaje = lcMensaje +
" y ";
133 lcMensaje = lcMensaje + Convert.ToString(loInf[lnInd][1]);
139 return base._Delete();
141 _Error_Message =
"Este código de solución está asignado al servicio número " + lcMensaje.Trim() +
". No se puede borrar la solución.";
Clase de negocio base para mantenimientos
Es como el tipo de entrada asientos pero por negocio, sin formulario, pq quiero que me haga las propu...
override bool _Delete()
Elimina el registro actual
Solucion()
Constructor vacío
Solucion(string tcCodigo)
Constructor con código