Пример #1
0
 public void Insert(TMotivoVisitas item) {
     if (this.Exite(item) == false){
         SSData.Servicios consulta = new SSData.Servicios(SSData.Servicios.Proveedor.SQL);
         consulta.Parameters.Add("@motc_nombre", item.Nombre);
         consulta.Parameters.Add("@depe_id", item.Departamento.Id);
         consulta.Parameters.Add("@motc_tiempo", item.Tiempo);
         consulta.Execute.NoQuery("dbo.Citas_Motivos_Insert", System.Data.CommandType.StoredProcedure);
     }
 }
Пример #2
0
        private MotivoVisitas() {
            Lista = new ObservableCollection<TMotivoVisitas>();
            TMotivoVisitas item;
            SSData.Servicios consulta = new SSData.Servicios(SSData.Servicios.Proveedor.SQL);
            
            foreach (System.Data.DataRow fila in consulta.Execute.Dataset("dbo.Citas_Motivos_View", System.Data.CommandType.StoredProcedure).Tables[0].Rows){
                
                item = new TMotivoVisitas();
                item.Id = Convert.ToInt32(fila["motc_id"]);
                item.Nombre = fila["motc_Nombre"].ToString();
                item.Tiempo = Convert.ToDouble(fila["motc_tiempo"]);
                this.Lista.Add(item);

                //item.Id = Convert.ToInt32(fila["dep_id"]);
            }
        }
Пример #3
0
 public bool Exite(TMotivoVisitas item){
     foreach (TMotivoVisitas itemb in Lista) {
         if (itemb.Nombre.Equals(item.Nombre)) return true; 
     }
     return false;
 }