Profiles.Edit.Utilities.DataIO.DeleteOnePublication C# (CSharp) Méthode

DeleteOnePublication() public méthode

public DeleteOnePublication ( int personid, long subjectID, string pubid, XmlDocument PropertyListXML ) : void
personid int
subjectID long
pubid string
PropertyListXML System.Xml.XmlDocument
Résultat void
        public void DeleteOnePublication(int personid, long subjectID, string pubid, XmlDocument PropertyListXML)
        {
            ActivityLog(PropertyListXML, subjectID, "PubID", pubid);
            string skey = string.Empty;
            string sparam = string.Empty;

            try
            {
                SessionManagement sm = new SessionManagement();
                string connstr = ConfigurationManager.ConnectionStrings["ProfilesDB"].ConnectionString;

                SqlConnection dbconnection = new SqlConnection(connstr);

                SqlCommand comm = new SqlCommand();

                comm.Parameters.Add(new SqlParameter("PersonID", personid));
                comm.Parameters.Add(new SqlParameter("PubID", pubid));

                comm.Connection = dbconnection;
                comm.Connection.Open();
                comm.CommandType = CommandType.StoredProcedure;
                comm.CommandText = "[Profile.Data].[Publication.DeleteOnePublication]";
                comm.ExecuteScalar();

                comm.Connection.Close();

                if (dbconnection.State != ConnectionState.Closed)
                    dbconnection.Close();

                this.UpdateEntityOnePerson(personid);

            }
            catch (Exception e)
            {
                Framework.Utilities.DebugLogging.Log(e.Message + e.StackTrace);
                throw new Exception(e.Message);
            }
        }

Usage Example

Exemple #1
0
        protected void deleteOne_Onclick(object sender, EventArgs e)
        {
            ImageButton lb = (ImageButton)sender;

            string key = lb.CommandArgument;

            //string key = grdEditPublications.DataKeys[0].Value.ToString();
            Utilities.DataIO data = new Profiles.Edit.Utilities.DataIO();


            data.DeleteOnePublication(Convert.ToInt32(Session["ProfileUsername"]), key);
            this.Counter = 0;
            grdEditPublications.DataBind();
            upnlEditSection.Update();
        }
All Usage Examples Of Profiles.Edit.Utilities.DataIO::DeleteOnePublication