示例#1
0
 public int GetIDbyPageCode(string PageCode)
 {
     int nResult = 0;
     cStaticPages objDAL = new cStaticPages();
     nResult = objDAL.GetIDbyPageCode(PageCode);
     return nResult;
 }
示例#2
0
 public DataTable GetItemByPageCode(string PageCode)
 {
     DataTable tbResult = new DataTable();
     cStaticPages objDAL = new cStaticPages();
     tbResult = objDAL.GetItemByPageCode(PageCode);
     return tbResult;
 }
示例#3
0
 public bool CheckExistPage(string PageCode)
 {
     bool isExist = false;
     cStaticPages objDAL = new cStaticPages();
     isExist = objDAL.CheckExistPage(PageCode);
     return isExist;
 }
示例#4
0
 public int DeleteById(int ID)
 {
     int nResult = 0;
     cStaticPages objDAL = new cStaticPages();
     try
     {
         objDAL.LoadByPrimaryKey(ID);
         objDAL.MarkAsDeleted();
         objDAL.Save();
         nResult = ID;
     }
     catch
     {
         nResult = 0;
     }
     return nResult;
 }
示例#5
0
 public int Insert()
 {
     int nResult = 0;
     cStaticPages objInfor = new cStaticPages();
     try
     {
         objInfor.AddNew();
         this.MappingData(objInfor);
         objInfor.Save();
         nResult = objInfor.StaticPageID ;
     }
     catch
     {
         nResult = 0;
     }
     return nResult;
 }
示例#6
0
 public void DeleteChildItem(int ParentPage)
 {
     cStaticPages objDAL = new cStaticPages();
     objDAL.DeleteChildItem(ParentPage);
 }
示例#7
0
        private void MappingData(cStaticPages objInfor)
        {
            objInfor.PageCode = Data.PageCode;
            try { objInfor.PageName = Data.PageName; }
            catch { objInfor.PageName = ""; }
            try { objInfor.MenuName = Data.MenuName; }
            catch { objInfor.MenuName = ""; }
            objInfor.Parent = Data.Parent;
            try { objInfor.PageContent = Data.PageContent; }
            catch { objInfor.PageContent = ""; }
            objInfor.DateCreated = Data.DateCreated;
            objInfor.Images = Data.Images;
            objInfor.Priority = Data.Priority;
            objInfor.Status = Data.Status;

            try { objInfor.GroupID = Data.GroupID; }
            catch { objInfor.GroupID = 0; }

            try { objInfor.InitContent = Data.InitContent; }
            catch { objInfor.InitContent = ""; }
        }
示例#8
0
 public int UpdateStatus(int ID, int Status)
 {
     int nResult = 0;
     cStaticPages objDAL = new cStaticPages();
     try
     {
         objDAL.LoadByPrimaryKey(ID);
         objDAL.Status = Status;
       //  objDAL.DateCreated  = DateTime.Today;
         objDAL.Save();
         nResult = objDAL.StaticPageID ;
     }
     catch
     {
         nResult = 0;
     }
     return nResult;
 }
示例#9
0
 private void ConvertData(cStaticPages objInfor)
 {
     Data.PageCode = objInfor.PageCode;
     Data.PageName = objInfor.PageName;
     Data.MenuName = objInfor.MenuName;
     Data.Parent = objInfor.Parent;
     Data.PageContent = objInfor.PageContent;
     Data.DateCreated = objInfor.DateCreated;
     Data.Images = objInfor.Images;
     Data.Priority = objInfor.Priority;
     Data.Status = objInfor.Status;
     Data.GroupID = objInfor.GroupID;
     Data.InitContent = objInfor.InitContent;
 }
示例#10
0
        public int UpdatePriority(int StaticPageID, int Priority)
        {
            int nResult = 0;
            cStaticPages objDAL = new cStaticPages();
            try
            {
                objDAL.LoadByPrimaryKey(StaticPageID);
                objDAL.Priority = Priority;

                objDAL.Save();
                nResult = objDAL.StaticPageID;
            }
            catch
            {
                nResult = 0;
            }
            return nResult;
        }
示例#11
0
 public int Update(int ID)
 {
     int nResult = 0;
     cStaticPages objInfor = new cStaticPages();
     try
     {
         objInfor.LoadByPrimaryKey(ID);
         this.MappingData(objInfor);
         objInfor.Save();
         nResult = ID;
     }
     catch
     {
         nResult = 0;
     }
     return nResult;
 }
示例#12
0
 public DataTable SearchAll()
 {
     DataTable tbResult = new DataTable();
     cStaticPages objDAL = new cStaticPages();
     tbResult = objDAL.SearchAll();
     return tbResult;
 }
示例#13
0
 public DataTable Search(string Title, int Parent, int GroupID,  int Status, int PageIndex, int PageSize, ref int PageCount)
 {
     DataTable tbResult = new DataTable();
     cStaticPages objDAL = new cStaticPages();
     tbResult = objDAL.Search(Title, Parent, GroupID, Status, PageIndex, PageSize, ref  PageCount);
     return tbResult;
 }
示例#14
0
 public void LoadById(int ID)
 {
     cStaticPages objDAL = new cStaticPages();
     objDAL.LoadByPrimaryKey(ID);
     ConvertData(objDAL);
 }