Exemplo n.º 1
0
 public int Insert()
 {
     int nResult = 0;
     cFAQs objInfor = new cFAQs();
     try
     {
         objInfor.AddNew();
         this.MappingData(objInfor);
         objInfor.Save();
         nResult = 1;
     }
     catch
     {
         nResult = 0;
     }
     return nResult;
 }
Exemplo n.º 2
0
 public int DeleteById(int ID)
 {
     int nResult = 0;
     cFAQs objDAL = new cFAQs();
     try
     {
         objDAL.LoadByPrimaryKey(ID);
         objDAL.MarkAsDeleted();
         objDAL.Save();
         nResult = ID;
     }
     catch
     {
         nResult = 0;
     }
     return nResult;
 }
Exemplo n.º 3
0
 public int Update(int ID)
 {
     int nResult = 0;
     cFAQs objInfor = new cFAQs();
     try
     {
         objInfor.LoadByPrimaryKey(ID);
         this.MappingData(objInfor);
         objInfor.Save();
         nResult = ID;
     }
     catch
     {
         nResult = 0;
     }
     return nResult;
 }
Exemplo n.º 4
0
 public DataTable Search(int ItemView, int ItemID, string Question, int FAQCatId, int Status,
     int PageIndex, int PageSize, ref int PageCount)
 {
     DataTable tbResult = new DataTable();
     cFAQs objDAL = new cFAQs();
     tbResult = objDAL.Search(ItemView, ItemID, Question, FAQCatId, Status, PageIndex, PageSize, ref  PageCount);
     return tbResult;
 }
Exemplo n.º 5
0
 public void LoadById(int ID)
 {
     cFAQs objDAL = new cFAQs();
     objDAL.LoadByPrimaryKey(ID);
     ConvertData(objDAL);
 }
Exemplo n.º 6
0
        private void MappingData(cFAQs objInfor)
        {
            objInfor.Question = Data.Question;
            objInfor.Answer = Data.Answer;
            objInfor.FAQCategoryID = Data.FAQCategoryID;
            try { objInfor.ModifiedDate = Data.ModifiedDate; }
            catch { objInfor.ModifiedDate = 0; }

            objInfor.Status = Data.Status;
        }
Exemplo n.º 7
0
 private void ConvertData(cFAQs objInfor)
 {
     Data.Question = objInfor.Question;
     Data.Answer = objInfor.Answer;
     Data.FAQCategoryID = objInfor.FAQCategoryID;
     Data.ModifiedDate = objInfor.ModifiedDate;
     Data.Status = objInfor.Status;
 }
Exemplo n.º 8
0
        public int UpdateStatus(int ID, int Status)
        {
            int nResult = 0;
            cFAQs objDAL = new cFAQs();
            try
            {
                objDAL.LoadByPrimaryKey(ID);
                objDAL.Status = Status;

                objDAL.Save();
                nResult = objDAL.FAQID;
            }
            catch
            {
                nResult = 0;
            }
            return nResult;
        }