public void LinkItemWithRecepient(RecepientItem item) { InitializeConnection(); OracleCommand cmd = new OracleCommand { Connection = conn, CommandText = $"insert into Receives_From (Recipient_SSN,Campaign_ID,ItemMainName,ItemName,ItemSubName)" + $" Values({item.Recipient.SSN},{item.Campaign.ID},{item.Item.Main.Name},{item.Item.Name},{item.Item.Sub.Name})", CommandType = CommandType.Text }; cmd.ExecuteNonQuery(); }
public void UpdateLink(RecepientItem item) { OracleCommand cmd = new OracleCommand { Connection = conn, CommandText =$"update Receives_From set Count_={item.Count}" + $"where ItemName={item.Item.Name}, ItemMainName={item.Item.Main.Name}, " + $"ItemSubName={item.Item.Sub.Name},Recipient_SSN={item.Recipient.SSN},Campaign_ID={item.Campaign.ID}", CommandType = CommandType.Text }; cmd.ExecuteNonQuery(); }
public void DeleteLink(RecepientItem item) { FetchTable("Receives_From"); var row = (from entry in dataSet.Tables["Receives_From"].AsEnumerable() where entry.Field <int>("Campaign_ID") == item.Campaign.ID && entry.Field <int>("Recepient_SSN") == item.Recipient.SSN && entry.Field <string>("ItemName") == item.Item.Name && entry.Field <string>("ItemMainName") == item.Item.Main.Name && entry.Field <string>("ItemSubName") == item.Item.Sub.Name select entry).Single(); dataSet.Tables["Receives_From"].Rows.Remove(row); }
public void LinkItemWithRecepient(RecepientItem item) { FetchTable("Receieves_From"); DataRow row = dataSet.Tables["Receieves_From"].NewRow(); row["ItemName"] = item.Item.Name; row["ItemMainName"] = item.Item.Main.Name; row["ItemSubName"] = item.Item.Sub.Name; row["Recepient_SSN"] = item.Recipient.SSN; row["Campaign_ID"] = item.Campaign.ID; row["Count_"] = item.Count; dataSet.Tables["Receieves_From"].Rows.Add(row); }
public void UpdateLink(RecepientItem item) { InitializeConnection(); OracleCommand cmd = new OracleCommand { Connection = conn, CommandText = $"update Donate_to set Count_={item.Count}" + $"where ItemName={item.Item.Name},MainName={item.Item.Main.Name},SubName={item.Item.Sub.Name}", CommandType = CommandType.Text }; cmd.ExecuteNonQuery(); }
public void UpdateLink(RecepientItem recepientItem, int Count) { FetchTable("Receives_From"); var row = (from entry in dataSet.Tables["Receives_From"].AsEnumerable() where entry.Field <int>("Campaign_ID") == recepientItem.Campaign.ID && entry.Field <int>("Recepient_SSN") == recepientItem.Recipient.SSN && entry.Field <string>("ItemName") == recepientItem.Item.Name && entry.Field <string>("ItemMainName") == recepientItem.Item.Main.Name && entry.Field <string>("ItemSubName") == recepientItem.Item.Sub.Name select entry).Single(); row["Count_"] = recepientItem.Count; dataSet.Tables["Receives_From"].AcceptChanges(); }
public void DeleteLink(RecepientItem item) { OracleCommand cmd = new OracleCommand(); cmd.Connection = conn; cmd.CommandText = @"delete from receives_from recipient_ssn=:ssn and itemMainName=:MainName and itemSubName=:SubName and where itemName=:name"; cmd.Parameters.Add("ssn", item.Recipient.SSN); cmd.Parameters.Add("MainName", item.Item.Main.Name); cmd.Parameters.Add("SubName", item.Item.Sub.Name); cmd.Parameters.Add("name", item.Item.Name); cmd.ExecuteNonQuery(); }
public void DeleteLink(RecepientItem item) { throw new NotImplementedException(); }
public void LinkItemWithRecepient(RecepientItem item) { throw new NotImplementedException(); }
public void DeleteLink(RecepientItem item) { dbLayer.DeleteLink(item); }
public void UpdateLink(RecepientItem recepientItem) { dbLayer.UpdateLink(recepientItem); }
public void LinkItemWithRecepient(RecepientItem item) { dbLayer.LinkItemWithRecepient(item); }
public void UpdateLink(RecepientItem recepientItem) { throw new NotImplementedException(); }