Ejemplo n.º 1
0
        public bool InsertFeedback(mFeedback pFeedback)
        {
            try
            {
                tbl_customer_feedback vFeedback = new tbl_customer_feedback();
                var query = from b in Db.tbl_customer_feedback
                            orderby b.cust_feedback_id descending
                            select b;
                vFeedback = query.FirstOrDefault();

                tbl_customer_feedback f = new tbl_customer_feedback();
                f.cust_feedback_title       = pFeedback.cust_feedback_title;
                f.cust_feedback_img         = pFeedback.cust_feedback_img;
                f.cust_feedback_exp         = pFeedback.cust_feedback_exp;
                f.cust_address              = pFeedback.cust_address;
                f.cust_company_title        = pFeedback.cust_company_title;
                f.cust_feedback_project_img = pFeedback.cust_feedback_project_img;
                f.cust_feedback_id          = vFeedback.cust_feedback_id + 1;
                Db.tbl_customer_feedback.Add(f);
                return(Convert.ToBoolean(Db.SaveChanges()));
            }
            catch (Exception)
            {
                return(false);
            }
        }
Ejemplo n.º 2
0
 public bool fUpdateFeedback(mFeedback pFeedback)
 {
     try
     {
         tbl_customer_feedback f = new tbl_customer_feedback();
         f.cust_feedback_id          = pFeedback.cust_feedback_id;
         f.cust_company_title        = pFeedback.cust_company_title;
         f.cust_feedback_img         = pFeedback.cust_feedback_img;
         f.cust_feedback_exp         = pFeedback.cust_feedback_exp;
         f.cust_address              = pFeedback.cust_address;
         f.cust_feedback_title       = pFeedback.cust_feedback_title;
         f.cust_feedback_project_img = pFeedback.cust_feedback_project_img;
         Db.tbl_customer_feedback.Attach(f);
         Db.Entry(f).State = System.Data.Entity.EntityState.Modified;
         return(Convert.ToBoolean(Db.SaveChanges()));
     }
     catch (Exception)
     {
         return(false);
     }
 }