private static SqlParameter[] SplitItemToParameter(ClsTraspaso Traspaso, bool isNew, int Opcion) { try { SqlParameter[] Parameters; //if (isNew) Parameters = new SqlParameter[6]; //else // Parameters = new SqlParameter[7]; Parameters[0] = new SqlParameter(); Parameters[0].Direction = ParameterDirection.Input; Parameters[0].SqlDbType = SqlDbType.Int; Parameters[0].ParameterName = "@IdObraOrigen"; Parameters[0].Value = Traspaso.IdObraOrigen; Parameters[1] = new SqlParameter(); Parameters[1].Direction = ParameterDirection.Input; Parameters[1].SqlDbType = SqlDbType.Int; Parameters[1].ParameterName = "@IdObraDestino"; Parameters[1].Value = Traspaso.IdObraDestino; Parameters[2] = new SqlParameter(); Parameters[2].Direction = ParameterDirection.Input; Parameters[2].SqlDbType = SqlDbType.Int; Parameters[2].ParameterName = "@IdArticulo"; Parameters[2].Value = Traspaso.IdArticulo; Parameters[3] = new SqlParameter(); Parameters[3].Direction = ParameterDirection.Input; Parameters[3].SqlDbType = SqlDbType.Decimal; Parameters[3].ParameterName = "@CantidadArtTrasp"; Parameters[3].Value = Traspaso.CantidadArtTrasp; Parameters[4] = new SqlParameter(); Parameters[4].Direction = ParameterDirection.Input; Parameters[4].SqlDbType = SqlDbType.Int; Parameters[4].ParameterName = "@Opcion"; Parameters[4].Value = Opcion; Parameters[5] = new SqlParameter(); Parameters[5].Direction = ParameterDirection.Input; Parameters[5].SqlDbType = SqlDbType.Int; Parameters[5].ParameterName = "@IdArticuloObra"; Parameters[5].Value = Traspaso.IdArtObra; return(Parameters); } catch (Exception EX) { throw new Exception(EX.Message, EX.InnerException); } }
//** /// <summary> /// Borra Logicamente un Traspaso /// </summary> /// <param name="Contacto">recibe un objeto del tipo ClsTraspaso</param> public static void DeleteArticulo(ClsTraspaso Traspaso) { try { Data DataAccess = new Data(System.Configuration.ConfigurationManager.ConnectionStrings["SISCOC_FEL.Properties.Settings.SISCOC_CON"].ToString()); DataAccess.ExecuteSPNonQuery(SplitItemToParameter(Traspaso, false, 1), "Sp_Update_Traspaso"); DataAccess.CloseConnection(); } catch (Exception EX) { throw new Exception(EX.Message, EX.InnerException); } }
private static ClsTraspaso FillProv(DataRow Row) { ClsTraspaso Prov = new ClsTraspaso(); try { Prov.IdProv = Convert.ToInt32(Row["IdProveedor"]); Prov.Prov = Convert.ToString(Row["Nombre"]); return(Prov); } catch (Exception EX) { throw new Exception(EX.Message, EX.InnerException); } }
private static ClsTraspaso FillObra(DataRow Row) { ClsTraspaso Obra = new ClsTraspaso(); try { Obra.IdObra = Convert.ToInt32(Row["IdObra"]); Obra.NomObra = Convert.ToString(Row["NombreObra"]); return(Obra); } catch (Exception EX) { throw new Exception(EX.Message, EX.InnerException); } }
private static ClsTraspaso FillArt_Obra(DataRow Row) { ClsTraspaso Art_Obra = new ClsTraspaso(); try { //Art_Obra.Check = Convert.ToString(Row["Check"]); Art_Obra.NombreArt = Convert.ToString(Row["Articulo"]); Art_Obra.IdArtObra = Convert.ToInt32(Row["IdArticulo"]); Art_Obra.Cantidad = Convert.ToInt32(Row["Cantidad"]); return(Art_Obra); } catch (Exception EX) { throw new Exception(EX.Message, EX.InnerException); } }
private static ClsTraspaso FillTraspaso(DataRow Row) { ClsTraspaso Traspaso = new ClsTraspaso(); try { Traspaso.IdTraspasos = Convert.ToInt32(Row["IdTraspasos"]); Traspaso.IdObraOrigen = Convert.ToInt32(Row["IdObraOrigen"]); Traspaso.IdObraDestino = Convert.ToInt32(Row["IdObraDestino"]); Traspaso.IdArticulo = Convert.ToInt32(Row["IdArticulo"]); Traspaso.CantidadArtTrasp = Convert.ToDouble(Row["CantidadArtTrasp"]); Traspaso.Fecha = Convert.ToDateTime(Row["Fecha"]); Traspaso.Status = Convert.ToInt16(Row["Status"]); return(Traspaso); } catch (Exception EX) { throw new Exception(EX.Message, EX.InnerException); } }
public static List <ClsTraspaso> DatosObra(string IdObra, string Obra) { try { List <ClsTraspaso> LDatosObra = new List <ClsTraspaso>(); ClsTraspaso Idobr = new ClsTraspaso(); ClsTraspaso Obr = new ClsTraspaso(); Idobr._IdObr = IdObra; Obr._Obr = Obra; LDatosObra.Add(Idobr); LDatosObra.Add(Obr); return(LDatosObra); } catch (Exception EX) { throw new Exception(EX.Message.ToString(), EX.InnerException); } }