コード例 #1
0
 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();
 }
コード例 #2
0
 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();
 }
コード例 #3
0
        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);
        }
コード例 #4
0
        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);
        }
コード例 #5
0
        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();
        }
コード例 #6
0
        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();
        }
コード例 #7
0
        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();
        }
コード例 #8
0
 public void DeleteLink(RecepientItem item)
 {
     throw new NotImplementedException();
 }
コード例 #9
0
 public void LinkItemWithRecepient(RecepientItem item)
 {
     throw new NotImplementedException();
 }
コード例 #10
0
 public void DeleteLink(RecepientItem item)
 {
     dbLayer.DeleteLink(item);
 }
コード例 #11
0
 public void UpdateLink(RecepientItem recepientItem)
 {
     dbLayer.UpdateLink(recepientItem);
 }
コード例 #12
0
 public void LinkItemWithRecepient(RecepientItem item)
 {
     dbLayer.LinkItemWithRecepient(item);
 }
コード例 #13
0
 public void UpdateLink(RecepientItem recepientItem)
 {
     throw new NotImplementedException();
 }