public static void SaveMallReadPageLog(int type, int id, string deviceid, int userid)
        {
            if (type <= 0)
            {
                return;
            }
            var data = new Mall_ReadPageLog();

            data.DeviceID   = deviceid;
            data.AddTime    = DateTime.Now;
            data.PageType   = type;
            data.UserID     = userid;
            data.Table_Key  = id;
            data.Table_Name = data.MyTableName;
            data.Save();
            if (data.PageType == 1)
            {
                string cmdtext = "select * from [Mall_ReadPageLog] where [DeviceID]=@DeviceID and [PageType]=@PageType and [Table_Key]=@Table_Key;";
                List <SqlParameter> parameters = new List <SqlParameter>();
                parameters.Add(new SqlParameter("@DeviceID", data.DeviceID));
                parameters.Add(new SqlParameter("@PageType", data.PageType));
                parameters.Add(new SqlParameter("@Table_Key", data.Table_Key));
                var list = GetList <Mall_ReadPageLog>(cmdtext, parameters).ToArray();
                if (list.Length == 1)
                {
                    var wechat_msg = Wechat_Msg.GetWechat_Msg(id);
                    if (wechat_msg != null)
                    {
                        wechat_msg.APPCustomerReadCount = (wechat_msg.APPCustomerReadCount > 0 ? wechat_msg.APPCustomerReadCount : 0) + 1;
                        wechat_msg.Save();
                    }
                }
            }
        }
Exemple #2
0
        private void SetInfo(Foresight.DataAccess.Wechat_Msg data)
        {
            this.tdTitle.Value               = data.MsgTitle;
            this.tdSummary.Value             = data.MsgSummary;
            this.tdIsShow.Value              = data.IsShow ? "1" : "0";
            this.hdContent.Value             = string.IsNullOrEmpty(data.HTMLContent) ? data.MsgContent : data.HTMLContent;
            this.tdPublishTime.Value         = data.PublishTime > DateTime.MinValue ? data.PublishTime.ToString("yyyy-MM-dd HH:mm:ss") : "";
            this.tdStartTime.Value           = data.StartTime > DateTime.MinValue ? data.StartTime.ToString("yyyy-MM-dd HH:mm:ss") : "";
            this.tdEndTime.Value             = data.EndTime > DateTime.MinValue ? data.EndTime.ToString("yyyy-MM-dd HH:mm:ss") : "";
            this.tdIsTopShow.Value           = data.IsTopShow ? "1" : "0";
            this.tdIsWechatSend.Checked      = data.IsWechatSend;
            this.tdIsCustomerAPPSend.Checked = data.IsCustomerAPPSend;
            this.tdIsUserAPPSend.Checked     = data.IsUserAPPSend;
            this.tdIsBusinessAPPSend.Checked = data.IsBusinessAPPSend;
            var list          = Foresight.DataAccess.Wechat_MsgProject.GetWechat_MsgProjectList(data.ID);
            var ProjectIDList = list.Select(p => p.ProjectID).ToList();

            if (ProjectIDList.Count > 0)
            {
                this.hdProjectIDs.Value = JsonConvert.SerializeObject(ProjectIDList);
            }
            this.tdCategoryID.Value = data.CategoryID > 0 ? data.CategoryID.ToString() : string.Empty;
            this.tdSortOrder.Value  = data.SortOrder > int.MinValue ? data.SortOrder.ToString() : "";
        }