public void RegisterDonation(string Name, string Amount, string Branch, string UsedFor)
        {
            Donations D = new Donations();

            D.Name    = Name;
            D.Amount  = Amount;
            D.Branch  = Branch;
            D.UsedFor = UsedFor;
            D.NewEntry(D);
        }
        public void UpdateDonation(int sno, string Name, string Amount, string Branch, string UsedFor)
        {
            Donations D = new Donations();

            D.Sno     = sno;
            D.Name    = Name;
            D.Amount  = Amount;
            D.Branch  = Branch;
            D.UsedFor = UsedFor;
            D.UpdateDonation(D);
        }
        public void NewEntry(Donations D)
        {
            string query = "Donation";

            MyCon.Open();
            SqlCommand cmd = new SqlCommand(query, MyCon);

            cmd.CommandType = CommandType.StoredProcedure;
            cmd.Parameters.AddWithValue("@CN", D.Name);
            cmd.Parameters.AddWithValue("@Donation", D.Amount);
            cmd.Parameters.AddWithValue("@IB", D.Branch);
            cmd.Parameters.AddWithValue("@UF", D.UsedFor);
            cmd.ExecuteNonQuery();
            MyCon.Close();
        }
        public void UpdateDonation(Donations d)
        {
            string query = "UpdatingDonation";

            MyCon.Open();
            SqlCommand cmd = new SqlCommand(query, MyCon);

            cmd.CommandType = CommandType.StoredProcedure;
            cmd.Parameters.AddWithValue("@Sno", d.Sno);
            cmd.Parameters.AddWithValue("@Name", d.Name);
            cmd.Parameters.AddWithValue("@Donation", d.Amount);
            cmd.Parameters.AddWithValue("@Branch", d.Branch);
            cmd.Parameters.AddWithValue("@Used", d.UsedFor);
            cmd.ExecuteNonQuery();
            MyCon.Close();
        }
        public Donations GetDonationByID(int id)
        {
            Donations D     = new Donations();
            string    query = "Select Sno,CompanyNameUser,Donation,InBranch,UsedFor from Donations where Sno='" + id + "'";

            MyCon.Open();
            SqlCommand    cmd    = new SqlCommand(query, MyCon);
            SqlDataReader reader = cmd.ExecuteReader();

            while (reader.Read())
            {
                D.Sno     = int.Parse(reader[0].ToString());
                D.Name    = reader[1].ToString();
                D.Amount  = reader[2].ToString();
                D.Branch  = reader[3].ToString();
                D.UsedFor = reader[4].ToString();
            }
            MyCon.Close();
            return(D);
        }
        public Donations GetDonationsByID(int ID)
        {
            Donations D = new Donations();

            return(D.GetDonationByID(ID));
        }
        public DataSet SearchID(int ID)
        {
            Donations D = new Donations();

            return(D.SearchID(ID));
        }
        public DataSet GetDonation()
        {
            Donations D = new Donations();

            return(D.GetAllDonations());
        }