Example #1
0
        private void Bind(ref string myDataAppend)
        {
            string error = "";

            try
            {
                if (!Id.Equals(Guid.Empty))
                {
                    Page.Title = "编辑物业公司信息";
                    ComplainRepair     bll   = new ComplainRepair();
                    ComplainRepairInfo model = bll.GetModel(Id);
                    if (model != null)
                    {
                        myDataAppend += "{ \"Id\":\"" + model.Id + "\",\"SysEnumId\":\"" + model.SysEnumId + "\",\"Phone\":\"" + model.Phone + "\",\"Address\":\"" + model.Address + "\",\"Descri\":\"" + model.Descri + "\"}";
                    }
                }
            }
            catch (Exception ex)
            {
                error = ex.Message;
            }

            if (!string.IsNullOrEmpty(error))
            {
                MessageBox.Messager(Page, error, MessageContent.AlertTitle_Ex_Error, "error");
            }
        }
Example #2
0
        /// <summary>
        /// 保存企业投诉保修
        /// </summary>
        /// <param name="username"></param>
        /// <param name="address"></param>
        /// <param name="phone"></param>
        /// <param name="descri"></param>
        /// <returns></returns>
        public string SaveHouseOwnerComplainRepair(string username, string address, string phone, string descri)
        {
            try
            {
                if (string.IsNullOrWhiteSpace(address))
                {
                    return(string.Format("<Rsp><IsOK>{0}</IsOK><RtMsg>{1}</RtMsg></Rsp>", false, "住址为必填项"));
                }
                if (string.IsNullOrWhiteSpace(phone))
                {
                    return(string.Format("<Rsp><IsOK>{0}</IsOK><RtMsg>{1}</RtMsg></Rsp>", false, "联系号码为必填项"));
                }
                if (string.IsNullOrWhiteSpace(descri))
                {
                    return(string.Format("<Rsp><IsOK>{0}</IsOK><RtMsg>{1}</RtMsg></Rsp>", false, "描述为必填项"));
                }

                WebSecurityService wsClient = new WebSecurityService();
                object             userId   = wsClient.GetUserId(username);
                if (userId == null)
                {
                    return(string.Format("<Rsp><IsOK>{0}</IsOK><RtMsg>{1}</RtMsg></Rsp>", false, "用户【" + username + "】不存在或已被删除"));
                }

                SysEnum seBll   = new SysEnum();
                var     seModel = seBll.GetModel(SysEnumHelper.GetEnumNameForComplainRepairType(SysEnumHelper.ComplainRepairType.ResidentFamily));
                if (seModel == null)
                {
                    return(string.Format("<Rsp><IsOK>{0}</IsOK><RtMsg>{1}</RtMsg></Rsp>", false, "找不到投诉保修类型,待系统管理员设定后再使用"));
                }

                ComplainRepairInfo model = new ComplainRepairInfo();
                model.UserId          = Guid.Parse(userId.ToString());
                model.LastUpdatedDate = DateTime.Now;
                model.Phone           = phone.Trim();
                model.Descri          = descri.Trim();
                model.SysEnumId       = Guid.Parse(seModel.Id.ToString());
                model.Status          = (byte)SysEnumHelper.ComplainRepairStatus.受理中;
                model.Address         = address.Trim();

                ComplainRepair bll    = new ComplainRepair();
                int            effect = bll.Insert(model);
                if (effect == 110)
                {
                    return(string.Format("<Rsp><IsOK>{0}</IsOK><RtMsg>{1}</RtMsg></Rsp>", false, "已存在相同数据记录,请勿重复提交!"));
                }
                if (effect < 1)
                {
                    return(string.Format("<Rsp><IsOK>{0}</IsOK><RtMsg>{1}</RtMsg></Rsp>", false, "操作失败,请正确操作!"));
                }
                else
                {
                    return(string.Format("<Rsp><IsOK>{0}</IsOK><RtMsg>{1}</RtMsg></Rsp>", true, "保存成功,我们会尽快处理!"));
                }
            }
            catch (Exception ex)
            {
                return(string.Format("<Rsp><IsOK>{0}</IsOK><RtMsg>{1}</RtMsg></Rsp>", false, "异常:" + ex.Message));
            }
        }
        private void Bind()
        {
            //查询条件
            GetSearchItem();

            int totalRecords = 0;

            ComplainRepair bll  = new ComplainRepair();
            var            list = bll.GetListByJoin(pageIndex, pageSize, out totalRecords, sqlWhere, parms == null ? null : parms.ToArray());

            rpData.DataSource = list;
            rpData.DataBind();

            myDataAppend += "<div id=\"myDataForPage\" style=\"display:none;\">[{\"PageIndex\":\"" + pageIndex + "\",\"PageSize\":\"" + pageSize + "\",\"TotalRecord\":\"" + totalRecords + "\",\"QueryStr\":\"" + queryStr + "\"}]</div>";
        }
Example #4
0
        public string GetComplainRepairModel(Guid Id, string username)
        {
            WebSecurityService wsClient = new WebSecurityService();
            object             userId   = wsClient.GetUserId(username);

            if (userId == null)
            {
                return("");
            }

            ComplainRepair bll   = new ComplainRepair();
            var            model = bll.GetModel(Id);

            if (model == null)
            {
                return(string.Empty);
            }

            return(string.Format("<Rsp><N><Id>{0}</Id><Phone>{1}</Phone><Descr>{2}</Descr><AdTime>{3}</AdTime><Status>{4}</Status><Address>{5}</Address></N></Rsp>", model.Id, model.Phone, model.Descri, model.LastUpdatedDate.ToString("yyyy-MM-dd HH:mm"), SysEnumHelper.GetEnumNameForComplainRepairStatus(model.Status), model.Address));
        }
Example #5
0
        public string GetComplainRepairList(int pageIndex, int pageSize, int repairType, string username)
        {
            string enumCode = SysEnumHelper.GetEnumNameForComplainRepairType(repairType);

            if (string.IsNullOrEmpty(enumCode))
            {
                return(string.Empty);
            }

            WebSecurityService wsClient = new WebSecurityService();
            object             userId   = wsClient.GetUserId(username);

            if (userId == null)
            {
                return(string.Empty);
            }
            int            totalRecords = 0;
            ComplainRepair bll          = new ComplainRepair();
            var            list         = bll.GetListByUser(pageIndex, pageSize, out totalRecords, userId, enumCode);

            if (list == null || list.Count == 0)
            {
                return(string.Empty);
            }

            StringBuilder sb = new StringBuilder();

            sb.Append("<Rsp>");
            foreach (var model in list)
            {
                sb.AppendFormat("<N><Id>{0}</Id><Phone>{1}</Phone><Descr>{2}</Descr><AdTime>{3}</AdTime><Status>{4}</Status><Address>{5}</Address></N>", model.Id, model.Phone, model.Descri, model.LastUpdatedDate.ToString("yyyy-MM-dd HH:mm"), SysEnumHelper.GetEnumNameForComplainRepairStatus(model.Status), model.Address);
            }
            sb.Append("</Rsp>");

            return(sb.ToString());
        }