public ActionResult addAssert(int cid, string content)
        {
            try
            {
                var user = GetUserData();

                CustomerAssertModel model = new CustomerAssertModel()
                {
                    CID           = cid,
                    AssertContent = content,
                    UserId        = user.UserId
                };

                if (CustomerLogic.AddCustomerAssert(model) > 0)
                {
                    return(Json(new ResultModel(ApiStatusCode.OK, "保存成功")));
                }
                else
                {
                    return(Json(new ResultModel(ApiStatusCode.添加失败, "保存失败")));
                }
            }
            catch (Exception ex)
            {
                LogHelper.Log(string.Format("AddCustomerAssert:message:{0},StackTrace:{1}", ex.Message, ex.StackTrace), LogHelperTag.ERROR);
                return(Json(new ResultModel(ApiStatusCode.SERVICEERROR)));
            }
        }
 /// <summary>
 /// 添加客户维护信息
 /// </summary>
 /// <param name="model"></param>
 /// <returns></returns>
 public static int AddCustomerAssert(CustomerAssertModel model)
 {
     using (var dal = FactoryDispatcher.CustomerFactory())
     {
         return(dal.AddCustomerAssert(model));
     }
 }
Exemple #3
0
        /// <summary>
        /// 添加客户维护信息
        /// </summary>
        /// <param name="model"></param>
        /// <returns></returns>
        public int AddCustomerAssert(CustomerAssertModel model)
        {
            string strSql = "insert into BM_CustomerAssert (CID,UserId,AssertContent) values(@CID,@UserId,@AssertContent);select @@IDENTITY;";
            var    param  = new[] {
                new SqlParameter("@CID", model.CID),
                new SqlParameter("@UserId", model.UserId),
                new SqlParameter("@AssertContent", model.AssertContent)
            };
            object obj = DbHelperSQLP.ExecuteScalar(WebConfig.getConnectionString(), CommandType.Text, strSql, param);

            if (obj != null)
            {
                DbHelperSQLP.ExecuteScalar(WebConfig.getConnectionString(), CommandType.Text, string.Format("update BM_CustomerManage set isTip=0 where ID={0}", model.CID));
                return(Convert.ToInt32(obj));
            }
            return(0);
        }