Beispiel #1
0
 public int Update(long Op_QaId, Op_Qa_Info data, IEnumerable <string> columns)
 {
     using (var db = new DBExecutor().GetDatabase())
     {
         return(db.Update(data, Op_QaId, columns));
     }
 }
Beispiel #2
0
 public int Update(Op_Qa_Info data)
 {
     using (var db = new DBExecutor().GetDatabase())
     {
         return(db.Update(data));
     }
 }
Beispiel #3
0
 public long Insert(Op_Qa_Info data)
 {
     using (var db = new DBExecutor().GetDatabase())
     {
         long NewID  = 0;
         var  result = db.Insert(data);
         if (result != null)
         {
             long.TryParse(result.ToString(), out NewID);
         }
         return(NewID);
     }
 }
Beispiel #4
0
        public long Insert(Op_Qa_Info data)
        {
            long newID = 0;

            try
            {
                newID = new Op_Qa_Repo().Insert(data);
            }
            catch (Exception ex)
            {
                log.Exception(ex);
            }
            return(newID);
        }
        public JsonResult SaveOp_Qa(Op_Qa_Info data)
        {
            ResultBase result = new ResultBase();

            result.setMessage("Done");
            if (data.IsActive == 1)
            {
                //審核專用
                var verdata = OQMan.GetBySN(data.Op_QaId);
                verdata.IsActive     = 1;
                verdata.VerifiedDate = DateTime.Now;
                OQMan.Update(verdata);
                return(Json(result, JsonRequestBehavior.DenyGet));
            }
            else
            {
                //一但有任何異動,自動下架
                data.IsActive = 0;
            }
            if (string.IsNullOrEmpty(data.op_title))
            {
                result.setErrorMessage("問題標題不得為空白");
            }
            if (string.IsNullOrEmpty(data.op_content))
            {
                result.setErrorMessage("回覆內容不得為空白");
            }
            if (result.JsonReturnCode > -1)
            {
                data.LastUpdate  = DateTime.Now;
                data.LastUpdator = sessionData.trading.LoginId;
                var olddata = OQMan.GetBySN(data.Op_QaId);
                //checkUploadfiles(data, olddata);
                if (data.Op_QaId > 0)
                {
                    //Keep the existing data.
                    data.hit = olddata.hit;
                    OQMan.Update(data);
                }
                else
                {
                    OQMan.Insert(data);
                }
            }
            return(Json(result, JsonRequestBehavior.DenyGet));
        }
Beispiel #6
0
 public bool Update(Op_Qa_Info data)
 {
     return(new Op_Qa_Repo().Update(data) > 0);
 }
Beispiel #7
0
 public bool Update(long Op_QaId, Op_Qa_Info data, IEnumerable <string> columns)
 {
     return(new Op_Qa_Repo().Update(Op_QaId, data, columns) > 0);
 }