Exemplo n.º 1
0
        public static List <ReplyEntity> GetTaskReplys(string guid, int pageSize, int pageIndex, ref int totalCount, ref int pageCount)
        {
            List <ReplyEntity> list = new List <ReplyEntity>();

            DataSet   ds          = ReplyDAL.BaseProvider.GetTaskReplys(guid, pageSize, pageIndex, ref totalCount, ref pageCount);
            DataTable replys      = ds.Tables["Replys"];
            DataTable attachments = ds.Tables["Attachments"];

            foreach (DataRow dr in replys.Rows)
            {
                ReplyEntity model = new ReplyEntity();
                model.FillData(dr);
                model.CreateUser = OrganizationBusiness.GetUserCacheByUserID(model.CreateUserID, model.ClientID);
                if (!string.IsNullOrEmpty(model.FromReplyID))
                {
                    model.FromReplyUser = OrganizationBusiness.GetUserCacheByUserID(model.FromReplyUserID, model.FromReplyAgentID);
                }

                model.Attachments = new List <Attachment>();
                if (attachments.Rows.Count > 0)
                {
                    foreach (DataRow dr2 in attachments.Select(" Guid='" + model.ReplyID + "'"))
                    {
                        Attachment attachment = new Attachment();
                        attachment.FillData(dr2);

                        model.Attachments.Add(attachment);
                    }
                }
                list.Add(model);
            }

            return(list);
        }
Exemplo n.º 2
0
        public static List <ReplyEntity> GetReplys(string guid, int pageSize, int pageIndex, ref int totalCount, ref int pageCount)
        {
            List <ReplyEntity> list     = new List <ReplyEntity>();
            string             whereSql = " Status<>9 and GUID='" + guid + "' ";
            DataTable          dt       = CommonBusiness.GetPagerData("CustomerReply", "*", 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);
        }