Esempio n. 1
0
        public common.clsWeb Web_Update(common.clsWeb Web, common.clsUser User)
        {
            string strWebHosts = this.GetSqlSplitString(Web.Domains);
            string strWebRoles = this.GetSqlSplitString(Web.Roles);

            // Try to insert new Web
            spParams = new object[7];
            spParams.SetValue(Web.WebID, 0);
            spParams.SetValue(User.UserID, 1);
            spParams.SetValue(Web.Title, 2);
            spParams.SetValue(Web.MailFromAddress, 3);
            spParams.SetValue(Web.PageFooter, 4);
            spParams.SetValue(strWebHosts, 5);
            spParams.SetValue(strWebRoles, 6);

            // Read data out to set the return Web object
            dr = data.SqlHelper.ExecuteReader(this.strConn, "prc_WEB_ins_upd", spParams);
            dr.Read();

            boolResult = bool.Parse(dr["Result"].ToString());
            strMessage = "\r\r\t" + dr["MessageOut"].ToString() + "<br>";

            Web.WebID   = int.Parse(dr["web_id"].ToString());
            Web.WebGUID = dr["web_guid"].ToString();

            common.clsPage clsPage = new common.clsPage();
            clsPage.PageID       = int.Parse(dr["page_id"].ToString());
            clsPage.PageIDParent = clsPage.PageID;

            Web.Page = clsPage;

            dr.Close();

            return(Web);
        }
Esempio n. 2
0
        private string[] GetRoles(common.clsPage Page)
        {
            spParams = new object[1];
            spParams.SetValue(Page.PageID, 0);

            return(this.GetRoles(data.SqlHelper.ExecuteReader(this.strConn, "prc_ROLE_WEB_PAGE_sel", spParams)));
        }
Esempio n. 3
0
        public bool WebPage_Delete(common.clsPage Page)
        {
            spParams = new object[1];
            spParams.SetValue(Page.PageID, 0);

            this.GetSqlTransResult(data.SqlHelper.ExecuteReader(strConn, "prc_WEB_PAGE_del", spParams));

            return(boolResult);
        }
Esempio n. 4
0
        private common.clsPage SetWebPage(common.clsPage Page, common.clsUser User)
        {
            string strPageRoles = this.GetSqlSplitString(Page.Roles);

            // Try to insert/update WEB_PAGE
            common.clsPage clsPage = new common.clsPage();

            spParams = new object[13];
            spParams.SetValue(Page.PageID, 0);
            spParams.SetValue(Page.PageIDParent, 1);
            spParams.SetValue(Page.WebID, 2);
            spParams.SetValue(Page.SortOrder, 3);
            spParams.SetValue(Page.ShowOnMenu, 4);
            spParams.SetValue(Page.IsNewsPage, 5);
            spParams.SetValue(Page.IsNewsArchive, 6);
            spParams.SetValue(Page.Title, 7);
            spParams.SetValue(Page.Image, 8);
            spParams.SetValue(Page.ControlID, 9);
            spParams.SetValue(Page.Body, 10);
            spParams.SetValue(strPageRoles, 11);
            spParams.SetValue(User.UserID, 12);

            // Read data out to populate the return Page object
            dr = data.SqlHelper.ExecuteReader(this.strConn, "prc_WEB_PAGE_ins_upd", spParams);
            dr.Read();

            boolResult  = bool.Parse(dr["Result"].ToString());
            strMessage  = "\r\t\t" + dr["MessageOut"].ToString() + "<br>";
            Page.PageID = int.Parse(dr["page_id"].ToString());

            dr.Close();

            clsPage.PageID        = Page.PageID;
            clsPage.PageIDParent  = Page.PageIDParent;
            clsPage.WebID         = Page.WebID;
            clsPage.SortOrder     = Page.SortOrder;
            clsPage.ShowOnMenu    = Page.ShowOnMenu;
            clsPage.IsNewsPage    = Page.IsNewsPage;
            clsPage.IsNewsArchive = Page.IsNewsArchive;
            clsPage.Title         = Page.Title;
            clsPage.Image         = Page.Image;
            clsPage.ControlID     = Page.ControlID;
            clsPage.Body          = Page.Body;

            return(clsPage);
        }
Esempio n. 5
0
        private common.clsWeb GetWeb(SqlDataReader drToRead)
        {
            // Set the Web and Page objects
            drToRead.Read();

            clsWeb                  = new common.clsWeb();
            clsWeb.WebID            = int.Parse(drToRead["web_id"].ToString());
            clsWeb.WebIDParent      = int.Parse(drToRead["web_id_parent"].ToString());
            clsWeb.WebGUID          = drToRead["web_guid"].ToString();
            clsWeb.Title            = drToRead["web_title"].ToString();
            clsWeb.MailFromAddress  = drToRead["web_mail_from"].ToString();
            clsWeb.PageFooter       = drToRead["page_footer"].ToString();
            clsWeb.PageIDHome       = int.Parse(drToRead["page_id_home"].ToString());
            clsWeb.PathToStylesheet = drToRead["path_to_stylesheet"].ToString();
            clsWeb.PathToDocs       = drToRead["path_to_docs"].ToString();
            clsWeb.PathToImages     = drToRead["path_to_images"].ToString();
            clsWeb.Status           = (common.Status) int.Parse(drToRead["web_status"].ToString());
            clsWeb.Roles            = this.GetRoles(clsWeb);
            clsWeb.Domains          = this.GetDomains(clsWeb);

            clsPage               = new common.clsPage();
            clsPage.PageID        = int.Parse(drToRead["page_id"].ToString());
            clsPage.PageIDParent  = int.Parse(drToRead["page_id_parent"].ToString());
            clsPage.WebID         = clsWeb.WebID;
            clsPage.WizardID      = (drToRead["wizard_id"].ToString().Length > 0) ? int.Parse(drToRead["wizard_id"].ToString()) : 0;
            clsPage.SortOrder     = int.Parse(drToRead["sort_order"].ToString());
            clsPage.ShowOnMenu    = bool.Parse(drToRead["yn_showonmenu"].ToString());
            clsPage.IsNewsPage    = bool.Parse(drToRead["yn_news"].ToString());
            clsPage.IsNewsArchive = bool.Parse(drToRead["yn_news_archive"].ToString());
            clsPage.Title         = drToRead["page_title"].ToString();
            clsPage.ControlID     = (drToRead["control_id"].ToString().Length > 0) ? int.Parse(drToRead["control_id"].ToString()) : 0;
            clsPage.Control       = (drToRead["page_control"].ToString().Length > 0) ? drToRead["page_control"].ToString() : null;
            clsPage.Image         = (drToRead["page_image"].ToString().Length > 0) ? drToRead["page_image"].ToString() : null;
            clsPage.Body          = (drToRead["page_body"].ToString().Length > 0) ? drToRead["page_body"].ToString() : null;
            clsPage.Roles         = this.GetRoles(clsPage);

            drToRead.Close();

            clsWeb.Page = clsPage;

            return(clsWeb);
        }
Esempio n. 6
0
 public common.clsPage WebPage_Update(common.clsPage Page, common.clsUser User)
 {
     return(this.SetWebPage(Page, User));
 }
Esempio n. 7
0
        private common.clsPage SetWebPage(common.clsPage Page, common.clsUser User)
        {
            string strPageRoles = this.GetSqlSplitString(Page.Roles);

            // Try to insert/update WEB_PAGE
            common.clsPage clsPage = new common.clsPage();

            spParams = new object[13];
            spParams.SetValue(Page.PageID,			0);
            spParams.SetValue(Page.PageIDParent,	1);
            spParams.SetValue(Page.WebID,			2);
            spParams.SetValue(Page.SortOrder,		3);
            spParams.SetValue(Page.ShowOnMenu,		4);
            spParams.SetValue(Page.IsNewsPage,		5);
            spParams.SetValue(Page.IsNewsArchive,	6);
            spParams.SetValue(Page.Title,			7);
            spParams.SetValue(Page.Image,			8);
            spParams.SetValue(Page.ControlID,		9);
            spParams.SetValue(Page.Body,			10);
            spParams.SetValue(strPageRoles,			11);
            spParams.SetValue(User.UserID,			12);

            // Read data out to populate the return Page object
            dr = data.SqlHelper.ExecuteReader(this.strConn, "prc_WEB_PAGE_ins_upd", spParams);
            dr.Read();

            boolResult	= bool.Parse(dr["Result"].ToString());
            strMessage	= "\r\t\t" + dr["MessageOut"].ToString() + "<br>";
            Page.PageID	= int.Parse(dr["page_id"].ToString());

            dr.Close();

            clsPage.PageID			= Page.PageID;
            clsPage.PageIDParent	= Page.PageIDParent;
            clsPage.WebID			= Page.WebID;
            clsPage.SortOrder		= Page.SortOrder;
            clsPage.ShowOnMenu		= Page.ShowOnMenu;
            clsPage.IsNewsPage		= Page.IsNewsPage;
            clsPage.IsNewsArchive	= Page.IsNewsArchive;
            clsPage.Title			= Page.Title;
            clsPage.Image			= Page.Image;
            clsPage.ControlID		= Page.ControlID;
            clsPage.Body			= Page.Body;

            return clsPage;
        }
Esempio n. 8
0
        private common.clsWeb GetWeb(SqlDataReader drToRead)
        {
            // Set the Web and Page objects
            drToRead.Read();

            clsWeb	= new common.clsWeb();
            clsWeb.WebID			= int.Parse(drToRead["web_id"].ToString());
            clsWeb.WebIDParent		= int.Parse(drToRead["web_id_parent"].ToString());
            clsWeb.WebGUID			= drToRead["web_guid"].ToString();
            clsWeb.Title			= drToRead["web_title"].ToString();
            clsWeb.MailFromAddress	= drToRead["web_mail_from"].ToString();
            clsWeb.PageFooter		= drToRead["page_footer"].ToString();
            clsWeb.PageIDHome		= int.Parse(drToRead["page_id_home"].ToString());
            clsWeb.PathToStylesheet	= drToRead["path_to_stylesheet"].ToString();
            clsWeb.PathToDocs		= drToRead["path_to_docs"].ToString();
            clsWeb.PathToImages		= drToRead["path_to_images"].ToString();
            clsWeb.Status			= (common.Status) int.Parse(drToRead["web_status"].ToString());
            clsWeb.Roles			= this.GetRoles(clsWeb);
            clsWeb.Domains			= this.GetDomains(clsWeb);

            clsPage = new common.clsPage();
            clsPage.PageID			= int.Parse(drToRead["page_id"].ToString());
            clsPage.PageIDParent	= int.Parse(drToRead["page_id_parent"].ToString());
            clsPage.WebID			= clsWeb.WebID;
            clsPage.WizardID		= (drToRead["wizard_id"].ToString().Length > 0) ? int.Parse(drToRead["wizard_id"].ToString()) : 0;
            clsPage.SortOrder		= int.Parse(drToRead["sort_order"].ToString());
            clsPage.ShowOnMenu		= bool.Parse(drToRead["yn_showonmenu"].ToString());
            clsPage.IsNewsPage		= bool.Parse(drToRead["yn_news"].ToString());
            clsPage.IsNewsArchive	= bool.Parse(drToRead["yn_news_archive"].ToString());
            clsPage.Title			= drToRead["page_title"].ToString();
            clsPage.ControlID		= (drToRead["control_id"].ToString().Length > 0) ? int.Parse(drToRead["control_id"].ToString()) : 0;
            clsPage.Control			= (drToRead["page_control"].ToString().Length > 0) ? drToRead["page_control"].ToString() : null;
            clsPage.Image			= (drToRead["page_image"].ToString().Length > 0) ? drToRead["page_image"].ToString() : null;
            clsPage.Body			= (drToRead["page_body"].ToString().Length > 0) ? drToRead["page_body"].ToString() : null;
            clsPage.Roles			= this.GetRoles(clsPage);

            drToRead.Close();

            clsWeb.Page	= clsPage;

            return clsWeb;
        }
Esempio n. 9
0
        public common.clsWeb Web_Update(common.clsWeb Web, common.clsUser User)
        {
            string	strWebHosts = this.GetSqlSplitString(Web.Domains);
            string	strWebRoles	= this.GetSqlSplitString(Web.Roles);

            // Try to insert new Web
            spParams = new object[7];
            spParams.SetValue(Web.WebID,			0);
            spParams.SetValue(User.UserID,			1);
            spParams.SetValue(Web.Title,			2);
            spParams.SetValue(Web.MailFromAddress,	3);
            spParams.SetValue(Web.PageFooter,		4);
            spParams.SetValue(strWebHosts,			5);
            spParams.SetValue(strWebRoles,			6);

            // Read data out to set the return Web object
            dr = data.SqlHelper.ExecuteReader(this.strConn, "prc_WEB_ins_upd", spParams);
            dr.Read();

            boolResult		= bool.Parse(dr["Result"].ToString());
            strMessage		= "\r\r\t" + dr["MessageOut"].ToString() + "<br>";

            Web.WebID		= int.Parse(dr["web_id"].ToString());
            Web.WebGUID		= dr["web_guid"].ToString();

            common.clsPage clsPage	= new common.clsPage();
            clsPage.PageID			= int.Parse(dr["page_id"].ToString());
            clsPage.PageIDParent	= clsPage.PageID;

            Web.Page = clsPage;

            dr.Close();

            return Web;
        }