示例#1
0
        /// <summary>
        /// 获取日志
        /// </summary>
        /// <returns></returns>
        public static List<LogEntity> GetLogs(string guid, EnumLogObjectType type, int pageSize, int pageIndex, ref int totalCount, ref int pageCount, string agentid)
        {
            string tablename = "";
            switch (type)
            {
                case EnumLogObjectType.Customer:
                    tablename = "CustomerLog";
                    break;
                case EnumLogObjectType.Orders:
                    tablename = "OrdersLog";
                    break;
            }

            DataTable dt = CommonBusiness.GetPagerData(tablename, "*", "LogGUID='" + guid + "'", "AutoID", pageSize, pageIndex, out totalCount, out pageCount);

            List<LogEntity> list = new List<LogEntity>();
            foreach (DataRow dr in dt.Rows)
            {
                LogEntity model = new LogEntity();
                model.FillData(dr);
                model.CreateUser = OrganizationBusiness.GetUserByUserID(model.CreateUserID, model.AgentID);

                list.Add(model);
            }
            return list;
        }
示例#2
0
        /// <summary>
        /// 获取日志
        /// </summary>
        /// <returns></returns>
        public static List <LogEntity> GetLogs(string guid, EnumLogObjectType type, int pageSize, int pageIndex, ref int totalCount, ref int pageCount, string clientid)
        {
            string tablename = "";

            switch (type)
            {
            case EnumLogObjectType.Customer:
                tablename = "CustomerLog";
                break;

            case EnumLogObjectType.Orders:
                tablename = "OrdersLog";
                break;

            case EnumLogObjectType.OrderTask:
                tablename = "OrderTaskLog";
                break;
            }

            DataTable dt = CommonBusiness.GetPagerData(tablename, "*", "LogGUID='" + guid + "'", "AutoID", pageSize, pageIndex, out totalCount, out pageCount);

            List <LogEntity> list = new List <LogEntity>();

            foreach (DataRow dr in dt.Rows)
            {
                LogEntity model = new LogEntity();
                model.FillData(dr);
                model.CreateUser = OrganizationBusiness.GetUserCacheByUserID(model.CreateUserID, clientid);

                list.Add(model);
            }
            return(list);
        }
示例#3
0
 /// <summary>
 /// 记录日志
 /// </summary>
 public static async void AddLog(string logguid, EnumLogObjectType type, string remark, string userid, string operateip, string guid, string agentid, string clientid)
 {
     string tablename = "";
     switch (type)
     {
         case EnumLogObjectType.Customer:
             tablename = "CustomerLog";
             break;
         case EnumLogObjectType.Orders:
             tablename = "OrdersLog";
             break;
     }
     await LogDAL.AddLog(tablename, logguid, remark, userid, operateip, guid, agentid, clientid);
 }
示例#4
0
        public static List <ReplyEntity> GetReplys(string guid, EnumLogObjectType type, int pageSize, int pageIndex, ref int totalCount, ref int pageCount, string agentid)
        {
            switch (type)
            {
            case EnumLogObjectType.Customer:
                return(GetCustomerReplys(guid, pageSize, pageIndex, ref totalCount, ref pageCount));

            case EnumLogObjectType.OrderTask:
                return(GetTaskReplys(guid, pageSize, pageIndex, ref totalCount, ref pageCount));

            case EnumLogObjectType.Orders:
                break;
            }

            return(null);
        }
示例#5
0
        /// <summary>
        /// 记录日志
        /// </summary>
        public static async void AddLog(string logguid, EnumLogObjectType type, string remark, string userid, string operateip, string guid, string agentid, string clientid)
        {
            string tablename = "";

            switch (type)
            {
            case EnumLogObjectType.Customer:
                tablename = "CustomerLog";
                break;

            case EnumLogObjectType.Orders:
                tablename = "OrdersLog";
                break;
            }
            await LogDAL.AddLog(tablename, logguid, remark, userid, operateip, guid, agentid, clientid);
        }
示例#6
0
        public JsonResult GetReplys(string guid, EnumLogObjectType type, int pageSize, int pageIndex)
        {
            int totalCount = 0;
            int pageCount  = 0;

            var list = ReplyBusiness.GetReplys(guid, type, pageSize, pageIndex, ref totalCount, ref pageCount, CurrentUser.ClientID);

            JsonDictionary.Add("items", list);
            JsonDictionary.Add("totalCount", totalCount);
            JsonDictionary.Add("pageCount", pageCount);

            return(new JsonResult
            {
                Data = JsonDictionary,
                JsonRequestBehavior = JsonRequestBehavior.AllowGet
            });
        }
示例#7
0
        public JsonResult SavaReply(EnumLogObjectType type, string entity, string attchmentEntity)
        {
            JavaScriptSerializer serializer = new JavaScriptSerializer();
            ReplyEntity          model      = serializer.Deserialize <ReplyEntity>(entity);

            model.Attachments = serializer.Deserialize <List <Attachment> >(attchmentEntity);
            string replyID = "";

            switch (type)
            {
            case EnumLogObjectType.Customer:
                replyID = ReplyBusiness.CreateCustomerReply(model.GUID, model.Content, CurrentUser.UserID, CurrentUser.ClientID, model.FromReplyID, model.FromReplyUserID, model.FromReplyAgentID);
                ReplyBusiness.AddCustomerReplyAttachments(model.GUID, replyID, model.Attachments, CurrentUser.UserID, CurrentUser.ClientID);
                break;

            case EnumLogObjectType.OrderTask:
                replyID = ReplyBusiness.CreateTaskReply(model.GUID, model.Content, CurrentUser.UserID, CurrentUser.ClientID, model.FromReplyID, model.FromReplyUserID, model.FromReplyAgentID);
                ReplyBusiness.AddTaskReplyAttachments(model.GUID, replyID, model.Attachments, CurrentUser.UserID, CurrentUser.ClientID);
                break;
            }


            List <ReplyEntity> list = new List <ReplyEntity>();

            if (!string.IsNullOrEmpty(replyID))
            {
                model.ReplyID      = replyID;
                model.CreateTime   = DateTime.Now;
                model.CreateUser   = OrganizationBusiness.GetUserCacheByUserID(CurrentUser.UserID, CurrentUser.ClientID);;
                model.CreateUserID = CurrentUser.UserID;
                if (!string.IsNullOrEmpty(model.FromReplyUserID) && !string.IsNullOrEmpty(model.FromReplyAgentID))
                {
                    model.FromReplyUser = OrganizationBusiness.GetUserCacheByUserID(model.FromReplyUserID, model.FromReplyAgentID);
                }
                list.Add(model);
            }
            JsonDictionary.Add("items", list);
            return(new JsonResult
            {
                Data = JsonDictionary,
                JsonRequestBehavior = JsonRequestBehavior.AllowGet
            });
        }
示例#8
0
        public static string CreateReply(EnumLogObjectType type, string guid, string content, string userID, string agentID, string fromReplyID, string fromReplyUserID, string fromReplyAgentID)
        {
            switch (type)
            {
                case EnumLogObjectType.Activity:
                    return ReplyDAL.BaseProvider.CreateActivityReply(guid, content, userID, agentID, fromReplyID, fromReplyUserID, fromReplyAgentID);

                case EnumLogObjectType.Customer:
                    return ReplyDAL.BaseProvider.CreateCustomerReply(guid, content, userID, agentID, fromReplyID, fromReplyUserID, fromReplyAgentID);

                case EnumLogObjectType.Opportunity:
                    return ReplyDAL.BaseProvider.CreateOpportunityReply(guid, content, userID, agentID, fromReplyID, fromReplyUserID, fromReplyAgentID);

                case EnumLogObjectType.Orders:
                    return ReplyDAL.BaseProvider.CreateOrderReply(guid, content, userID, agentID, fromReplyID, fromReplyUserID, fromReplyAgentID);

            }
            return "";
            
        }
示例#9
0
        public static bool DeleteReply(EnumLogObjectType type, string replyid)
        {
            string tablename = "";
            switch (type)
            {
                case EnumLogObjectType.Activity:
                    tablename = "ActivityReply";
                    break;
                case EnumLogObjectType.Customer:
                    tablename = "CustomerReply";
                    break;
                case EnumLogObjectType.Opportunity:
                    tablename = "OpportunityReply";
                    break;
                case EnumLogObjectType.Orders:
                    tablename = "OrderReply";
                    break;
            }

            bool bl = CommonBusiness.Update(tablename, "Status", 9, "ReplyID='" + replyid + "'");
            return bl;
        }
示例#10
0
        public static bool DeleteReply(EnumLogObjectType type, string replyid)
        {
            string tablename = "";

            switch (type)
            {
            case EnumLogObjectType.Customer:
                tablename = "CustomerReply";
                break;

            case EnumLogObjectType.OrderTask:
                tablename = "TaskReply";
                break;

            case EnumLogObjectType.Orders:
                tablename = "OrderReply";
                break;
            }

            bool bl = CommonBusiness.Update(tablename, "Status", 9, "ReplyID='" + replyid + "'");

            return(bl);
        }
示例#11
0
        public static List<ReplyEntity> GetReplys(string guid, EnumLogObjectType type, int pageSize, int pageIndex, ref int totalCount, ref int pageCount, string agentid)
        {
            string tablename = "";
            switch (type)
            {
                case EnumLogObjectType.Activity:
                    tablename = "ActivityReply";
                    break;
                case EnumLogObjectType.Customer:
                    tablename = "CustomerReply";
                    break;
                case EnumLogObjectType.Opportunity:
                    tablename = "OpportunityReply";
                    break;
                case EnumLogObjectType.Orders:
                    tablename = "OrderReply";
                    break;
            }

            List<ReplyEntity> list = new List<ReplyEntity>();
            string whereSql = " Status<>9 and GUID='" + guid + "' ";
            DataTable dt = CommonBusiness.GetPagerData(tablename, "*", whereSql, "AutoID", "CreateTime desc ", pageSize, pageIndex, out totalCount, out pageCount, false);

            foreach (DataRow dr in dt.Rows)
            {
                ReplyEntity model = new ReplyEntity();
                model.FillData(dr);
                model.CreateUser = OrganizationBusiness.GetUserByUserID(model.CreateUserID, model.AgentID);
                if (!string.IsNullOrEmpty(model.FromReplyID))
                {
                    model.FromReplyUser = OrganizationBusiness.GetUserByUserID(model.FromReplyUserID, model.FromReplyAgentID);
                }
                list.Add(model);
            }

            return list;
        }
示例#12
0
 public static async void AddActionLog(EnumSystemType systemtype, EnumLogObjectType objecttype, EnumLogType actiontype,  string operateip, string userid, string agentid, string clientid)
 {
     await LogDAL.AddActionLog((int)systemtype, (int)objecttype, (int)actiontype, operateip, userid, agentid, clientid);
 }
示例#13
0
        public JsonResult SavaReply(EnumLogObjectType type, string entity)
        {
            JavaScriptSerializer serializer = new JavaScriptSerializer();
            ReplyEntity model = serializer.Deserialize<ReplyEntity>(entity);

            string replyID = "";
            replyID = ReplyBusiness.CreateReply(type, model.GUID, model.Content, CurrentUser.UserID, CurrentUser.AgentID, model.FromReplyID, model.FromReplyUserID, model.FromReplyAgentID);

            List<ReplyEntity> list = new List<ReplyEntity>();
            if (!string.IsNullOrEmpty(replyID))
            {
                model.ReplyID = replyID;
                model.CreateTime = DateTime.Now;
                model.CreateUser = CurrentUser;
                model.CreateUserID = CurrentUser.UserID;
                model.AgentID = CurrentUser.AgentID;
                if (!string.IsNullOrEmpty(model.FromReplyUserID) && !string.IsNullOrEmpty(model.FromReplyAgentID))
                {
                    model.FromReplyUser = OrganizationBusiness.GetUserByUserID(model.FromReplyUserID, model.FromReplyAgentID);
                }
                list.Add(model);
            }
            JsonDictionary.Add("items", list);
            return new JsonResult
            {
                Data = JsonDictionary,
                JsonRequestBehavior = JsonRequestBehavior.AllowGet
            };
        }
示例#14
0
        /// <summary>
        /// 获取评论备忘
        /// </summary>
        /// <param name="guid"></param>
        /// <param name="type"></param>
        /// <param name="pageSize"></param>
        /// <param name="pageIndex"></param>
        /// <returns></returns>
        public JsonResult GetReplys(string guid, EnumLogObjectType type, int pageSize, int pageIndex)
        {
            int totalCount = 0;
            int pageCount = 0;

            var list = ReplyBusiness.GetReplys(guid, type, pageSize, pageIndex, ref totalCount, ref pageCount, CurrentUser.AgentID);

            JsonDictionary.Add("items", list);
            JsonDictionary.Add("totalCount", totalCount);
            JsonDictionary.Add("pageCount", pageCount);

            return new JsonResult
            {
                Data = JsonDictionary,
                JsonRequestBehavior = JsonRequestBehavior.AllowGet
            };
        }
示例#15
0
 public static async void AddActionLog(EnumSystemType systemtype, EnumLogObjectType objecttype, EnumLogType actiontype, string operateip, string userid, string clientid)
 {
     await LogDAL.AddActionLog((int)systemtype, (int)objecttype, (int)actiontype, operateip, userid, clientid);
 }