コード例 #1
0
        /// <summary>
        /// 更新一条数据
        /// </summary>
        public bool Update(Sys_VisitInfo model)
        {
            StringBuilder strSql = new StringBuilder();

            strSql.Append("update Sys_VisitInfo set ");

            strSql.Append(" insertName = @insertName , ");
            strSql.Append(" insertTime = @insertTime , ");
            strSql.Append(" retly_Count = @retly_Count , ");
            strSql.Append(" Contact = @Contact , ");
            strSql.Append(" remark = @remark , ");
            strSql.Append(" vr_Threeid = @vr_Threeid , ");
            strSql.Append(" accid = @accid , ");
            strSql.Append(" rt_Maxid = @rt_Maxid , ");
            strSql.Append(" vr_Maxid = @vr_Maxid , ");
            strSql.Append(" vr_Minid = @vr_Minid , ");
            strSql.Append(" vm_id = @vm_id , ");
            strSql.Append(" initiative = @initiative , ");
            strSql.Append(" vi_Content = @vi_Content , ");
            strSql.Append(" handleStat = @handleStat  ");
            strSql.Append(" where id=@id ");

            int row = DapperHelper.Execute(strSql.ToString(), model);

            if (row > 0)
            {
                return(true);
            }
            else
            {
                return(false);
            }
        }
コード例 #2
0
        /// <summary>
        /// 新增
        /// </summary>
        /// <param name="model"></param>
        /// <returns></returns>
        public new  int Add(Sys_VisitInfo model)
        {
            StringBuilder strSql = new StringBuilder();

            strSql.Append("insert into Sys_VisitInfo(accid,rt_Maxid,vm_id,initiative,vi_Content,handleStat,insertName,insertTime,Contact,remark,vr_Maxid,vr_Minid,vr_Threeid) ");
            strSql.Append(" values(@accid,@rt_Maxid,@vm_id,@initiative,@vi_Content,@handleStat,@insertName,@insertTime,@Contact,@remark,@vr_Maxid,@vr_Minid,@vr_Threeid) ;");
            strSql.Append("select @@IDENTITY;");
            object ro = DapperHelper.ExecuteScalar(strSql.ToString(), model);

            if (ro != null)
            {
                return(Convert.ToInt32(ro));
            }
            else
            {
                return(0);
            }
        }
コード例 #3
0
        /// <summary>
        /// 增加回访信息
        /// </summary>
        /// <param name="accid">店铺ID</param>
        /// <param name="recordType">记录类别</param>
        /// <param name="vmanner">回访方式</param>
        /// <param name="vrOne">第一概要</param>
        /// <param name="vrTwo">第二概要</param>
        /// <param name="vrThress">第三概要</param>
        /// <param name="content">内容</param>
        /// <param name="stat">状态</param>
        /// <param name="insertName">回访人</param>
        /// <param name="tags">标签</param>
        /// <param name="contact">回访方式值</param>
        /// <param name="taskid">任务ID</param>
        /// <returns></returns>
        public static int AddVisitInfo(int accid, int recordType, int vrOne, int vrTwo, int vrThree, int vmanner, string content, int stat, string insertName, string tags = "", string contact = "", int taskid = 0, int feedBack = 0)
        {
            Sys_VisitInfo visitInfo = new Sys_VisitInfo();

            visitInfo.accid      = accid;
            visitInfo.rt_Maxid   = recordType;
            visitInfo.vm_id      = vmanner;
            visitInfo.Contact    = contact;
            visitInfo.initiative = 0;
            visitInfo.vi_Content = content;
            visitInfo.handleStat = stat;
            visitInfo.insertName = insertName;
            visitInfo.insertTime = DateTime.Now;
            visitInfo.remark     = "";

            visitInfo.vr_Maxid   = vrOne;
            visitInfo.vr_Minid   = vrTwo;
            visitInfo.vr_Threeid = vrThree;

            visitInfo.id = BLL.Sys_VisitInfoBLL.Add(visitInfo);

            //回访导入反馈
            if (feedBack == 1)
            {
                string trimContent = StripHTML(content);
                if (AddCustomCareFeedBack(insertName, trimContent, accid, 0) == 0)
                {
                    return(0);
                }
            }


            if (visitInfo.id > 0)
            {
                var AddDelegate = new AddVisitInfoDelegate(AddVisitInfoOtherDispose);
                AddDelegate.BeginInvoke(accid, visitInfo.id, insertName, tags, taskid, null, null);
                return(visitInfo.id);
            }
            else
            {
                return(0);
            }
        }
コード例 #4
0
        /// <summary>
        /// 新增加一条数据
        /// </summary>
        /// <param name="model"></param>
        /// <returns></returns>
        public int Add(Sys_VisitInfo model)
        {
            StringBuilder strSql = new StringBuilder();

            strSql.Append("insert into Sys_VisitInfo(");
            strSql.Append("insertName,insertTime,retly_Count,Contact,remark,vr_Threeid,accid,rt_Maxid,vr_Maxid,vr_Minid,vm_id,initiative,vi_Content,handleStat");
            strSql.Append(") values (");
            strSql.Append("@insertName,@insertTime,@retly_Count,@Contact,@remark,@vr_Threeid,@accid,@rt_Maxid,@vr_Maxid,@vr_Minid,@vm_id,@initiative,@vi_Content,@handleStat");
            strSql.Append(") ");
            strSql.Append(";select @@IDENTITY");
            object obj = DapperHelper.ExecuteScalar(strSql.ToString(), model);

            if (obj != null)
            {
                return(Convert.ToInt32(obj));
            }
            else
            {
                return(0);
            }
        }
コード例 #5
0
        /// <summary>
        /// 更新一条数据
        /// </summary>
        public static bool Update(Sys_VisitInfo model)
        {
            Sys_VisitInfoBaseDAL dal = new Sys_VisitInfoBaseDAL();

            return(dal.Update(model));
        }
コード例 #6
0
        /// <summary>
        /// 新增加一条数据
        /// </summary>
        /// <param name="model"></param>
        /// <returns></returns>
        public static int Add(Sys_VisitInfo model)
        {
            Sys_VisitInfoBaseDAL dal = new Sys_VisitInfoBaseDAL();

            return(dal.Add(model));
        }