public string Update(int ID, int Supplier_ID, string Payment_Terms, string Price_Terms, string Code, string Bank_Name, string Address, string Zip_Postal, string State_Province, string Phone, string City, string Country, string Fax) { Financial_Info _Financial_Info = new Financial_Info(); _Financial_Info.ID = ID; _Financial_Info.Supplier_ID = Supplier_ID; _Financial_Info.Payment_Terms = Payment_Terms; _Financial_Info.Price_Terms = Price_Terms; _Financial_Info.Code = Code; _Financial_Info.Bank_Name = Bank_Name; _Financial_Info.Address = Address; _Financial_Info.Zip_Postal = Zip_Postal; _Financial_Info.State_Province = State_Province; _Financial_Info.Phone = Phone; _Financial_Info.City = City; _Financial_Info.Country = Country; _Financial_Info.Fax = Fax; _Financial_Info.UpdatedBy = Session["User"].ToString(); return Financial_Info_DA.Update(_Financial_Info); }
public List<Financial_Info> Get_FinancialTerms_By_SupplierId(int SupplierId) { List<Financial_Info> list_Financial_Info = new List<Financial_Info>(); DataTable dt = Financial_Info_DA.Get_FinancialTerms_By_SupplierId(SupplierId); foreach (DataRow row in dt.Rows) { Financial_Info _Financial_Info = new Financial_Info(); _Financial_Info.ID = int.Parse(row["ID"].ToString()); _Financial_Info.Supplier_ID = int.Parse(row["Supplier_ID"].ToString()); _Financial_Info.Payment_Terms = row["Payment_Terms"].ToString(); _Financial_Info.Price_Terms = row["Price_Terms"].ToString(); _Financial_Info.Code = row["Code"].ToString(); _Financial_Info.Bank_Name = row["Bank_Name"].ToString(); _Financial_Info.Address = row["Address"].ToString(); _Financial_Info.Zip_Postal = row["Zip/Postal"].ToString(); _Financial_Info.State_Province = row["State/Province"].ToString(); _Financial_Info.Phone = row["Phone"].ToString(); _Financial_Info.City = row["City"].ToString(); _Financial_Info.Country = row["Country"].ToString(); _Financial_Info.Fax = row["Fax"].ToString(); list_Financial_Info.Add(_Financial_Info); } return list_Financial_Info; }
public static string Update(Financial_Info _Financial) { DbCommand command = Catalog_Access.CreateCommand(); command.CommandText = "sp_UpdateFinancial_Info"; DbParameter param; param = command.CreateParameter(); param.ParameterName = "@ID"; param.Value = _Financial.ID; param.DbType = DbType.Int32; command.Parameters.Add(param); param = command.CreateParameter(); param.ParameterName = "@Supplier_ID"; param.Value = _Financial.Supplier_ID; param.DbType = DbType.String; command.Parameters.Add(param); param = command.CreateParameter(); param.ParameterName = "@Payment_Terms"; param.Value = _Financial.Payment_Terms; param.DbType = DbType.String; command.Parameters.Add(param); param = command.CreateParameter(); param.ParameterName = "@Price_Terms"; param.Value = _Financial.Price_Terms; param.DbType = DbType.String; command.Parameters.Add(param); param = command.CreateParameter(); param.ParameterName = "@Code"; param.Value = _Financial.Code; param.DbType = DbType.String; command.Parameters.Add(param); param = command.CreateParameter(); param.ParameterName = "@Bank_Name"; param.Value = _Financial.Bank_Name; param.DbType = DbType.String; command.Parameters.Add(param); param = command.CreateParameter(); param.ParameterName = "@Address"; param.Value = _Financial.Address; param.DbType = DbType.String; command.Parameters.Add(param); param = command.CreateParameter(); param.ParameterName = "@Zip_Postal"; param.Value = _Financial.Zip_Postal; param.DbType = DbType.String; command.Parameters.Add(param); param = command.CreateParameter(); param.ParameterName = "@State_Province"; param.Value = _Financial.State_Province; param.DbType = DbType.String; command.Parameters.Add(param); param = command.CreateParameter(); param.ParameterName = "@Phone"; param.Value = _Financial.Phone; param.DbType = DbType.String; command.Parameters.Add(param); param = command.CreateParameter(); param.ParameterName = "@City"; param.Value = _Financial.City; param.DbType = DbType.String; command.Parameters.Add(param); param = command.CreateParameter(); param.ParameterName = "@Country"; param.Value = _Financial.Country; param.DbType = DbType.String; command.Parameters.Add(param); param = command.CreateParameter(); param.ParameterName = "@Fax"; param.Value = _Financial.Fax; param.DbType = DbType.String; command.Parameters.Add(param); param = command.CreateParameter(); param.ParameterName = "@UpdatedBy"; param.Value = _Financial.UpdatedBy; param.DbType = DbType.String; command.Parameters.Add(param); param = command.CreateParameter(); param.ParameterName = "@Return"; param.DbType = DbType.String; param.Size = 2; param.Direction = ParameterDirection.Output; command.Parameters.Add(param); Catalog_Access.ExecuteNonQuery(command); string Return = command.Parameters["@Return"].Value.ToString(); return Return; }