Ejemplo n.º 1
0
        public override void Operate(ref Common.Transfer Trans)
        {
            Trans.Result = JSONHelper.FromString(false, "未知错误");

            DataTable dAttributeTable = base.XmlToDatatTable(Trans.Attribute);
            DataRow   Row             = dAttributeTable.Rows[0];

            switch (Trans.Command)
            {
            case "Add":
                Trans.Result = Add(Row);
                break;

            case "Delete":
                Trans.Result = Delete(Row);
                break;

            case "Audit":
                Trans.Result = Audit(Row);
                break;

            case "WaitingAuditList":
                Trans.Result = WaitingAuditList(Row);
                break;

            case "AuditList":
                Trans.Result = AuditList(Row);
                break;
            }
        }
Ejemplo n.º 2
0
        private string GetCommunityServiceTel_ZhongJi(DataRow row)
        {
            if (!row.Table.Columns.Contains("CommunityId") || string.IsNullOrEmpty(row["CommunityId"].ToString()))
            {
                return(JSONHelper.FromString(false, "小区编号不能为空"));
            }

            if (!row.Table.Columns.Contains("RoomID") || string.IsNullOrEmpty(row["RoomID"].ToString()))
            {
                return(JSONHelper.FromString(false, "房屋编号不能为空"));
            }

            string roomId      = row["RoomID"].ToString();
            string communityId = row["CommunityId"].ToString();

            //查询小区
            Tb_Community Community = new MobileSoft.BLL.Unified.Bll_Tb_Community().GetModel(communityId);

            //构造链接字符串
            if (Community == null)
            {
                return(JSONHelper.FromString(false, "该小区不存在"));
            }

            string strcon = new Business.CostInfo().GetConnectionStringStr(Community);

            using (IDbConnection conn = new SqlConnection(strcon))
            {
                string sql = @"SELECT Heading AS UserName,InfoContent AS MobileTel FROM view_Tb_HSPR_CommunityInfo_filter_CommServiceTel WHERE CommID = @CommID";

                DataTable dt = conn.ExecuteReader(sql, new { CommID = Community.CommID }).ToDataSet().Tables[0];

                return(JSONHelper.FromString(dt));
            }
        }
Ejemplo n.º 3
0
        private string SetVisitorConfirm(DataRow Row)
        {
            if (!Row.Table.Columns.Contains("VisitorId") || string.IsNullOrEmpty(Row["VisitorId"].ToString()))
            {
                return(JSONHelper.FromString(false, "缺少VisitorId参数"));
            }
            if (!Row.Table.Columns.Contains("CommID") || string.IsNullOrEmpty(Row["CommID"].AsString()))
            {
                return(new ApiResult(false, "缺少参数CommID").toJson());
            }
            string commID    = Row["CommID"].AsString();
            string VisitorId = Row["VisitorId"].ToString();
            string connStr;

            if (!GetDBServerPath(commID, out connStr))
            {
                return(new ApiResult(false, "获取数据库信息失败").toJson());
            }

            int result = 0;

            DateTime ScanDate = DateTime.Now;

            using (IDbConnection conn = new SqlConnection(connStr))
            {
                result = conn.Execute("UPDATE Tb_HSPR_APP_Visitor SET ScanDate = @ScanDate WHERE Id = @Id", new { ScanDate = ScanDate, Id = VisitorId }, null, null, CommandType.Text);
            }

            if (result > 0)
            {
                return(new ApiResult(true, ScanDate.ToString()).toJson());
            }
            return(new ApiResult(false, "确认失败,请重试").toJson());
        }
Ejemplo n.º 4
0
        /// <summary>
        /// 获取部门下用户列表
        /// </summary>
        private string GetUserListWithDep(DataRow row)
        {
            if (!row.Table.Columns.Contains("CorpID") || string.IsNullOrEmpty(row["CorpID"].ToString()))
            {
                return(JSONHelper.FromString(false, "公司ID不能为空"));
            }

            if (!row.Table.Columns.Contains("DepCode") || string.IsNullOrEmpty(row["DepCode"].ToString()))
            {
                return(JSONHelper.FromString(false, "部门不能为空"));
            }

            string corpId = row["CorpID"].ToString();

            //构建链接字符串
            string strcon = "";
            bool   bl     = GetDBServerPathWithCorpID(corpId, out strcon);

            if (bl == false)
            {
                return(JSONHelper.FromString(false, strcon));
            }

            string sql = "SELECT DepCode,UserCode,UserName FROM Tb_Sys_User WHERE DepCode='" + row["DepCode"] + "' AND isnull(IsDelete,0)=0 ORDER BY UserCode";

            using (IDbConnection con = new SqlConnection(strcon))
            {
                return(JSONHelper.FromString(con.ExecuteReader(sql).ToDataSet().Tables[0]));
            }
        }
Ejemplo n.º 5
0
        /// <summary>
        /// 获取汇报对象
        /// </summary>
        private string GetReportUserList(DataRow row)
        {
            if (!row.Table.Columns.Contains("UserCode") || string.IsNullOrEmpty(row["UserCode"].ToString()))
            {
                return(JSONHelper.FromString(false, "用户编号不能为空"));
            }

            if (!row.Table.Columns.Contains("CorpID") || string.IsNullOrEmpty(row["CorpID"].ToString()))
            {
                return(JSONHelper.FromString(false, "公司ID不能为空"));
            }

            string corpId = row["CorpID"].ToString();

            //构建链接字符串
            string strcon = "";
            bool   bl     = GetDBServerPathWithCorpID(corpId, out strcon);

            if (bl == false)
            {
                return(JSONHelper.FromString(false, strcon));
            }

            using (IDbConnection con = new SqlConnection(strcon))
            {
                DataTable dt = con.ExecuteReader(@"SELECT UserCode,UserName FROM Tb_Sys_User WHERE UserCode IN (SELECT DISTINCT ToUserCode FROM Tb_OAPublicWork_WorkRecordNoticeUser WHERE MyUserCode=@UserCode)", new { UserCode = row["UserCode"].ToString() }).ToDataSet().Tables[0];
                return(JSONHelper.FromString(dt));
            }
        }
Ejemplo n.º 6
0
        /// <summary>
        /// 修改密码
        /// </summary>
        /// <param name="row"></param>
        /// Mobile  手机号【必填】
        /// Pwd  密码【必填】
        /// 返回:
        ///     true:密码修改成功
        ///     false:错误信息
        /// <returns></returns>
        private string UpdateUserPwd(DataRow row)
        {
            if (!row.Table.Columns.Contains("Mobile") || string.IsNullOrEmpty(row["Mobile"].ToString()))
            {
                return(JSONHelper.FromString(false, "手机号不能为空"));
            }
            if (!row.Table.Columns.Contains("Pwd") || string.IsNullOrEmpty(row["Pwd"].ToString()))
            {
                return(JSONHelper.FromString(false, "密码不能为空"));
            }

            IDbConnection Connectionstr = new SqlConnection(Connection.GetConnection("4"));
            string        Sql           = "SELECT  * FROM Tb_User where Mobile=@Mobile";
            Tb_User       user          = Connectionstr.Query <Tb_User>(Sql, new { Mobile = row["Mobile"].ToString() }).SingleOrDefault();

            if (user == null)
            {
                return(JSONHelper.FromString(false, "该用户不存在"));
            }
            else
            {
                user.Pwd = row["Pwd"].ToString();
                Connectionstr.Update(user);
                return(JSONHelper.FromString(true, "密码修改成功"));
            }
        }
Ejemplo n.º 7
0
        /// <summary>
        /// 标记短信为已读
        /// </summary>
        private string MarkMessageRead(DataRow row)
        {
            if (!row.Table.Columns.Contains("MessageCode") || string.IsNullOrEmpty(row["MessageCode"].ToString()))
            {
                return(JSONHelper.FromString(false, "短信ID不能为空"));
            }

            if (!row.Table.Columns.Contains("CorpID") || string.IsNullOrEmpty(row["CorpID"].ToString()))
            {
                return(JSONHelper.FromString(false, "公司ID不能为空"));
            }

            string corpId = row["CorpID"].ToString();

            //构建链接字符串
            string strcon = "";
            bool   bl     = GetDBServerPathWithCorpID(corpId, out strcon);

            if (bl == false)
            {
                return(JSONHelper.FromString(false, strcon));
            }

            string sql = "UPDATE Tb_Sys_Message SET MsgState=2 WHERE MessageCode='" + row["MessageCode"].ToString() + "'";

            using (IDbConnection con = new SqlConnection(strcon))
            {
                return(JSONHelper.FromString(true, con.Execute(sql).ToString()));
            }
        }
Ejemplo n.º 8
0
        public override void Operate(ref Common.Transfer Trans)
        {
            Trans.Result = JSONHelper.FromString(false, "未知错误");

            DataTable dAttributeTable = base.XmlToDatatTable(Trans.Attribute);
            DataRow   Row             = dAttributeTable.Rows[0];

            switch (Trans.Command)
            {
            case "IncidentAccept":                  // 报事提交
                Trans.Result = IncidentAccept(Row);
                break;

            case "IncidentCancel":                  // 报事提交
                Trans.Result = IncidentCancel(Row);
                break;

            case "GetIncidentHistory":              // 获取报事历史
                Trans.Result = GetIncidentHistory(Row);
                break;

            case "GetIncidentDetail":               // 获取报事详情
                Trans.Result = GetIncidentDetail(Row);
                break;

            case "IncidentEvaluate":               // 获取报事详情
                Trans.Result = IncidentEvaluate(Row);
                break;

            default:
                break;
            }
        }
Ejemplo n.º 9
0
        /// <summary>
        /// 业主取消报事
        /// </summary>
        private string IncidentCancel(DataRow row)
        {
            if (!row.Table.Columns.Contains("CommunityId") || string.IsNullOrEmpty(row["CommunityId"].ToString()))
            {
                return(JSONHelper.FromString(false, "小区编号不能为空"));
            }
            if (!row.Table.Columns.Contains("IncidentID") || string.IsNullOrEmpty(row["IncidentID"].ToString()))
            {
                return(JSONHelper.FromString(false, "报事编号不能为空"));
            }


            string communityId = row["CommunityId"].ToString();

            Tb_Community Community = new MobileSoft.BLL.Unified.Bll_Tb_Community().GetModel(communityId);

            //构造链接字符串
            if (Community == null)
            {
                return(JSONHelper.FromString(false, "该小区不存在"));
            }
            string strcon = GetConnectionStringStr(Community);

            using (IDbConnection conn = new SqlConnection(strcon))
            {
                conn.Execute(@"UPDATE Tb_HSPR_IncidentAccept SET IsDelete=1 WHERE IncidentID=@IncidentID", new { IncidentID = row["IncidentID"].ToString() });

                return(JSONHelper.FromString(true, "操作成功"));
            }
        }
Ejemplo n.º 10
0
        /// <summary>
        /// 查询用户租赁信息
        /// </summary>
        /// <param name="Row"></param>
        /// <returns></returns>
        public string RentalHistoryList(DataRow Row)
        {
            string    backstr = "";
            DataTable dt      = null;

            try
            {
                string        ConnStr = ConnectionDb.GetUnifiedConnectionString();
                string        UserId  = Row["UserId"].ToString();
                IDbConnection com     = new SqlConnection(ConnStr);
                //Tb_User User = com.Query<Tb_User>("select * from Tb_User  where Id=@Id", new { Id = UserId }).ToList<Tb_User>().SingleOrDefault();
                //if (User==null)
                //{
                //    return JSONHelper.FromString(false, "该用户不存在");
                //}

                int page = AppGlobal.StrToInt(Row["Page"].ToString());
                int row  = AppGlobal.StrToInt(Row["PageSize"].ToString());
                dt = BaseGetData.GetList(ConnStr, " and UserId='" + UserId + "'", page, row, "RegisterDate", 0, "View_Tb_Rental", "Id").Tables[0];
            }
            catch (Exception ex)
            {
                backstr = ex.Message;
            }
            if (backstr == "")
            {
                return(JSONHelper.FromString(dt));
            }
            else
            {
                return(JSONHelper.FromString(false, backstr));
            }
        }
Ejemplo n.º 11
0
        /// <summary>
        /// 清空购物车   DelShoppingCarAll
        /// </summary>
        /// <param name="row"></param>
        /// UserId          用户编码【必填】
        /// 返回:
        ///     true:
        ///     false:删除失败
        /// <returns></returns>
        private string DelShoppingCarAll(DataRow row)
        {
            if (!row.Table.Columns.Contains("UserId") || string.IsNullOrEmpty(row["UserId"].ToString()))
            {
                return(JSONHelper.FromString(false, "用户编码不能为空"));
            }
            string str = "";

            try
            {
                IDbConnection con = new SqlConnection(PubConstant.GetConnectionString("BusinessContionString"));
                //批量删除购物车明细
                con.ExecuteScalar(" update Tb_ShoppingCar set IsDelete=1 where UserId=@ShoppingId", new { ShoppingId = row["UserId"].ToString() }, null, null, CommandType.Text);
            }
            catch (Exception ex)
            {
                str = ex.Message;
            }
            if (str != "")
            {
                return(JSONHelper.FromString(false, str));
            }
            else
            {
                return(JSONHelper.FromString(true, ""));
            }
        }
Ejemplo n.º 12
0
        // 房屋租赁详情
        public string RentalDetail_v2(DataRow row)
        {
            // 筛选地区
            if (!row.Table.Columns.Contains("Id") || row["Id"].ToString() == "")
            {
                return(JSONHelper.FromString(false, "租售记录id不能为空"));
            }

            var id  = row["Id"].ToString();
            var sql = @"SELECT a.Id,replace(isnull(a.Province,''),'省','') AS Province, replace(isnull(a.City,''),'市','') AS City,
                            CASE WHEN a.Rent IS NULL THEN '面议'
                                WHEN convert(nvarchar(20),a.Rent)='面议' THEN '面议'
                                WHEN convert(decimal(12,2),a.Rent)=0 THEN '面议'
                                ELSE convert(nvarchar(20),convert(decimal(12,0),isnull(Rent,0))) END AS Rent,
                            CASE WHEN a.Amount IS NULL THEN '面议'
                                WHEN convert(nvarchar(20),a.Amount)='面议' THEN '面议'
                                WHEN convert(decimal(12,2),a.Amount)=0 THEN '面议'
                                ELSE convert(nvarchar(20),CONVERT(decimal(12,1),isnull(Amount,0.0)/10000.0))+'万' END AS Amount,
                           isnull(a.Img,'') AS Img,isnull(a.Title,b.CommName) AS Title,isnull(a.HouseType,'住宅') AS HouseType,
                           isnull(a.Orientation,'无') AS Orientation,isnull(a.Renovation,'无') AS Renovation,
                           isnull(a.BuildingType,'住宅') AS BuildingType,a.BuildingAge,isnull(a.ProcessDate,a.RegisterDate) PubDate,
                           isnull(a.SalesMobile,a.Mobile) AS Mobile,isnull(a.Address,b.CommName) AS Address,
                           isnull(BussType,'租售') AS BussType,a.Description,b.CommName,a.BuildArea,a.Floor 
                        FROM Tb_Rental a
                        LEFT JOIN Tb_Community b ON a.CommunityId=b.Id
                        WHERE a.Id=@Id;";

            using (var conn = new SqlConnection(PubConstant.UnifiedContionString))
            {
                var result = conn.Query(sql, new { Id = id }).FirstOrDefault();
                return(new ApiResult(true, result).toJson());
            }
        }
Ejemplo n.º 13
0
        /// <summary>
        /// 设置我的汇报对象
        /// </summary>
        private string AddReportObjects(DataRow row)
        {
            if (!row.Table.Columns.Contains("ReportUsers") || string.IsNullOrEmpty(row["ReportUsers"].AsString()))
            {
                return(new ApiResult(false, "缺少参数ReportUsers").toJson());
            }

            var reportUsers = row["ReportUsers"].AsString();

            using (var conn = new SqlConnection(PubConstant.hmWyglConnectionString))
            {
                var sql = @"INSERT INTO Tb_OAPublicWork_WorkRecordNoticeUser(MyUserCode,ToUserCode)
                            SELECT @UserCode,UserCode 
                            FROM Tb_Sys_User
                            WHERE UserCode IN(SELECT Value FROM SplitString(@ToUserCode,',',1))
                            AND UserCode NOT IN(SELECT ToUserCode FROM Tb_OAPublicWork_WorkRecordNoticeUser 
                            WHERE MyUserCode=@UserCode AND ToUserCode IN(SELECT Value FROM SplitString(@ToUserCode,',',1)))";

                var i = conn.Execute(sql, new { ToUserCode = reportUsers.Trim(','), UserCode = Global_Var.LoginUserCode });

                if (i > 0)
                {
                    return(JSONHelper.FromString(true, "添加成功"));
                }

                return(JSONHelper.FromString(true, "添加失败"));
            }
        }
Ejemplo n.º 14
0
        /// <summary>
        /// 获取某单元下楼层信息
        /// </summary>
        private string GetFloorsWithBuildSNumAndUnitNum(DataRow row)
        {
            if (!row.Table.Columns.Contains("CommID") || string.IsNullOrEmpty(row["CommID"].ToString()))
            {
                return(JSONHelper.FromString(false, "小区ID不能为空"));
            }
            if (!row.Table.Columns.Contains("BuildSNum") || string.IsNullOrEmpty(row["BuildSNum"].ToString()))
            {
                return(JSONHelper.FromString(false, "楼宇编号不能为空"));
            }
            if (!row.Table.Columns.Contains("UnitSNum") || string.IsNullOrEmpty(row["UnitSNum"].ToString()))
            {
                return(JSONHelper.FromString(false, "单元编号不能为空"));
            }

            string commId    = row["CommID"].ToString();
            string BuildSNum = row["BuildSNum"].ToString();
            string UnitSNum  = row["UnitSNum"].ToString();

            string sql = $@"SELECT DISTINCT FloorSNum FROM Tb_HSPR_Room 
                            WHERE isnull(IsDelete, 0)=0 AND UnitSNum IS NOT NULL AND FloorSNum IS NOT NULL AND 
                            CommID={commId} AND BuildSNum='{BuildSNum}' AND UnitSNum='{UnitSNum}' ORDER BY FloorSNum;";

            using (IDbConnection con = new SqlConnection(PubConstant.hmWyglConnectionString))
            {
                return(new ApiResult(true, con.Query <string>(sql)).toJson());
            }
        }
Ejemplo n.º 15
0
        public string RefreshOrder(string CommunityId, string out_trade_no)
        {
            string            ConnStr    = GetConnection(CommunityId);
            string            BankResult = SearchBankOrder(CommunityId, out_trade_no);
            IDbConnection     conn       = new SqlConnection(GetConnection(CommunityId));
            string            query      = "SELECT * FROM Tb_OL_AlipayOrder WHERE out_trade_no=@out_trade_no";
            Tb_OL_AlipayOrder T_Order    = conn.Query <Tb_OL_AlipayOrder>(query, new { out_trade_no = out_trade_no }).SingleOrDefault();

            if (BankResult == "TRADE_SUCCESS")
            {
                //更新订单状态
                UpdateProperyOrder(T_Order.CommunityId.ToString(), T_Order.out_trade_no.ToString(), BankResult, "TRADE_SUCCESS");
                if (T_Order.IsSucc.ToString() != "1")
                {
                    //下账
                    ReceProperyOrder(0, T_Order.CommunityId.ToString(), T_Order.out_trade_no.ToString(), null);
                    return(JSONHelper.FromString(true, "订单状态已更新并下账成功,请刷新订单"));
                }
                else
                {
                    return(JSONHelper.FromString(true, "订单状态已更新,请刷新订单"));
                }
            }
            else
            {
                //更新订单状态
                UpdateProperyOrder(T_Order.CommunityId.ToString(), T_Order.out_trade_no.ToString(), BankResult, "");
            }

            return("");
        }
Ejemplo n.º 16
0
        /// <summary>
        /// 复验确认
        /// </summary>
        private string SaveHouseInspectionReview(DataRow row)
        {
            if (!row.Table.Columns.Contains("CommID") || string.IsNullOrEmpty(row["CommID"].ToString()))
            {
                return(JSONHelper.FromString(false, "小区编号不能为空"));
            }

            if (!row.Table.Columns.Contains("IID") || string.IsNullOrEmpty(row["IID"].ToString()))
            {
                return(JSONHelper.FromString(false, "验房项目不能为空"));
            }

            if (!row.Table.Columns.Contains("Review") || string.IsNullOrEmpty(row["Review"].ToString()))
            {
                return(JSONHelper.FromString(false, "验房项目不能为空"));
            }

            string commID = row["CommID"].ToString();
            string iid    = row["IID"].ToString();
            string result = row["Review"].ToString();

            using (IDbConnection con = new SqlConnection(PubConstant.hmWyglConnectionString))
            {
                string sql = @"UPDATE Tb_HSPR_HousingInspDetail SET Review=@Result WHERE IID=@IID";
                con.Execute(sql, new { Result = result, IID = iid });
                return(JSONHelper.FromString(true, "保存成功"));
            }
        }
Ejemplo n.º 17
0
        /// <summary>
        /// 验证验证码 10分钟有效
        /// </summary>
        /// <param name="Row"></param>
        /// Mobile  手机号【必填】
        /// VerifyCode  验证码【必填】
        /// 返回:
        ///     true:验证成功
        ///     false:错误信息
        /// <returns></returns>
        private string CheckVerifyCode(DataRow Row)
        {
            if (Row["Mobile"] == null || Row["Mobile"].ToString() == "")
            {
                return(JSONHelper.FromString(false, "缺少参数Mobile"));
            }
            if (Row["VerifyCode"] == null || Row["VerifyCode"].ToString() == "")
            {
                return(JSONHelper.FromString(false, "缺少参数VerifyCode"));
            }

            string               conStr = PubConstant.UnifiedContionString.ToString();
            IDbConnection        con    = new SqlConnection(conStr);
            string               sql    = "select * from Tb_SendMessageRecord where Mobile=@Mobile and SendContent='您的验证码为:'+@SendContent+'【天问互联】' and SendType='忘记密码' and SendState=0 and DATEDIFF(mi,SendTime,GETDATE())<10";
            Tb_SendMessageRecord model  = con.Query <Tb_SendMessageRecord>(sql, new { Mobile = Row["Mobile"].ToString(), SendContent = Row["VerifyCode"] }).ToList <Tb_SendMessageRecord>().SingleOrDefault();

            if (model == null)
            {
                return(JSONHelper.FromString(false, "验证失败"));
            }
            else
            {
                return(JSONHelper.FromString(true, "验证成功"));
            }
        }
Ejemplo n.º 18
0
        /// <summary>
        /// 获取建议
        /// </summary>
        /// <param name="row">评价ID</param>
        /// 返回:
        ///     SuggestionsID   建议ID
        ///     CommID          小区ID
        ///     CustID          客户ID
        ///     RoomID          房间ID
        ///     RoomSign        房间编号
        ///     CustName        客户名称
        ///     LinkPhone       联系方式
        ///     SuggestionsType 建议类型
        ///     SuggestionsTitle 建议标题
        ///     SuggestionsImages 建议图片
        ///     IsDelete        是否删除
        ///     SuggestionsContent 建议内容
        ///     CustEvaluation  评价内容
        ///     ReplyStats      回复状态
        ///     ReplyContent    回复内容
        ///     ReplyDate       回复日期
        ///     EvaluationDate  评价日期
        ///     EvaluationLevel  评价级别
        /// <returns></returns>
        private string GetProposalInfo(DataRow row)
        {
            if (!row.Table.Columns.Contains("CommunityId") || string.IsNullOrEmpty(row["CommunityId"].ToString()))
            {
                return(JSONHelper.FromString(false, "小区编码不能为空"));
            }
            if (!row.Table.Columns.Contains("Id") || string.IsNullOrEmpty(row["Id"].ToString()))
            {
                return(JSONHelper.FromString(false, "建议ID不能为空"));
            }

            string Id          = row["Id"].ToString();
            string CommunityId = row["CommunityId"].ToString();

            //运营连接字符串
            IDbConnection Conn = new SqlConnection(Connection.GetConnection("4"));
            //获取小区信息
            string       sql_com   = "select * from dbo.Tb_Community where Id=@Id";
            Tb_Community Community = Conn.Query <Tb_Community>(sql_com, new { Id = CommunityId }).SingleOrDefault();

            if (Community == null)
            {
                return(JSONHelper.FromString(false, "该小区不存在"));
            }
            Conn = new SqlConnection(new CostInfo().GetConnectionStringStr(Community));

            string query = "SELECT * FROM Tb_HSPR_CommunitySuggestions WHERE SuggestionsID='" + Id + "'";

            DataTable dt = Conn.ExecuteReader(query, null, null, null, CommandType.Text).ToDataSet().Tables[0];

            return(JSONHelper.FromString(dt));
        }
Ejemplo n.º 19
0
        /// <summary>
        /// //微信公共号登录  UserLogin_WeiXin
        /// </summary>
        /// <param name="row"></param>
        /// OpenId          必填
        /// <returns></returns>
        private string UserLogin_WeiXin(DataRow row)
        {
            if (!row.Table.Columns.Contains("OpenId"))
            {
                return(JSONHelper.FromString(false, "OpenId不能为空"));
            }
            string openId     = row["OpenId"].ToString();
            string headImgUrl = "";

            if (row.Table.Columns.Contains("HeadImgUrl"))
            {
                headImgUrl = row["HeadImgUrl"].ToString();
            }

            //如果存在该用户.并且头像不为空,就修改用户头像
            if (!string.IsNullOrEmpty(headImgUrl))
            {
                using (IDbConnection conn = new SqlConnection(PubConstant.UnifiedContionString)) {
                    conn.Execute("UPDATE Tb_User SET UserPic = @UserPic FROM Tb_User AS u INNER JOIN Tb_User_WeiXin wx ON u.Id = wx.UserId  WHERE wx.WeChatToken = @openId", new { UserPic = headImgUrl, openId = openId }, null, null, CommandType.Text);
                }
            }
            DataTable dt = null;

            using (IDbConnection conn = new SqlConnection(PubConstant.UnifiedContionString))
            {
                dt = conn.ExecuteReader("SELECT u.Id,u.Name,u.Mobile,u.Email,u.QQ,u.QQToken,w.WeChatToken,u.WeChatNum,u.NickName,u.UserPic,u.Sex FROM Tb_User as u left join Tb_User_WeiXin as w on u.id = w.UserId where w.WeChatToken = @WeChatToken", new { WeChatToken = openId }, null, null, CommandType.Text).ToDataSet().Tables[0];
            }
            if (null == dt || dt.Rows.Count == 0)
            {
                return(JSONHelper.FromString(false, "账号名或者密码错误"));
            }
            return(JSONHelper.FromString(dt));
        }
Ejemplo n.º 20
0
        public override void Operate(ref Common.Transfer Trans)
        {
            Trans.Result = JSONHelper.FromString(false, "未知错误");

            DataTable dAttributeTable = base.XmlToDatatTable(Trans.Attribute);
            DataRow   Row             = dAttributeTable.Rows[0];

            switch (Trans.Command)
            {
            case "SubmitProposal":
                Trans.Result = SubmitProposal(Row);    //提交建议
                break;

            case "SetEvaluation":
                Trans.Result = SetEvaluation(Row);    //评价
                break;

            case "GetProposalInfo":
                Trans.Result = GetProposalInfo(Row);    //获取建议
                break;

            case "GetProposalInfoList":    //所有建议
                Trans.Result = GetProposalInfoList(Row);
                break;

            default:
                break;
            }
        }
Ejemplo n.º 21
0
        /// <summary>
        /// 读取短信详情
        /// </summary>
        private string GetMessageDetail(DataRow row)
        {
            if (!row.Table.Columns.Contains("MessageCode") || string.IsNullOrEmpty(row["MessageCode"].ToString()))
            {
                return(JSONHelper.FromString(false, "短信ID不能为空"));
            }

            if (!row.Table.Columns.Contains("CorpID") || string.IsNullOrEmpty(row["CorpID"].ToString()))
            {
                return(JSONHelper.FromString(false, "公司ID不能为空"));
            }

            string corpId = row["CorpID"].ToString();

            //构建链接字符串
            string strcon = "";
            bool   bl     = GetDBServerPathWithCorpID(corpId, out strcon);

            if (bl == false)
            {
                return(JSONHelper.FromString(false, strcon));
            }

            string sql         = "SELECT Content FROM Tb_Sys_Message WHERE MessageCode='" + row["MessageCode"].ToString() + "'";
            string contentHtml = "";

            using (IDbConnection con = new SqlConnection(strcon))
            {
                dynamic messageContent = con.Query(sql).ToList().FirstOrDefault();

                if (messageContent != null && !string.IsNullOrEmpty(messageContent.Content.ToString()))
                {
                    contentHtml = messageContent.Content.ToString();
                    contentHtml = contentHtml.ToLower();

                    if (contentHtml.Contains(hrefString1))
                    {
                        contentHtml = contentHtml.Replace(hrefString1, " href=\"#\" onclick=\"openFile(this);return false;\" x=\"/HM/M_Main/Jscript-Ui/UEditor/net/upload/");
                    }

                    if (contentHtml.Contains(hrefString2))
                    {
                        contentHtml = contentHtml.Replace(hrefString2, " href=\"#\" onclick=\"openFile(this);return false;\" x=\"/HM/M_Main/oauploadfile/");
                    }

                    if (contentHtml.Contains(hrefString3))
                    {
                        contentHtml = contentHtml.Replace(hrefString3, "src=\"/HM/M_Main/Jscript-Ui/UEditor/net/upload/");
                    }

                    if (contentHtml.Contains(hrefString4))
                    {
                        contentHtml = contentHtml.Replace(hrefString4, " href=\"#\" onclick=\"openFile(this);return false;\" x=\"/hm/m_main/jscript-ui/ueditor/net/upload/");
                    }
                }
                contentHtml = contentHtml.Replace("\"", "\\\"");

                return(JSONHelper.FromString(true, contentHtml));
            }
        }
Ejemplo n.º 22
0
        public string RefreshOrder(string CommunityId, string out_trade_no)
        {
            string               strcon     = PubConstant.GetConnectionString("APPConnection");
            string               BankResult = SearchBankOrder(CommunityId, out_trade_no);
            IDbConnection        conn       = new SqlConnection(strcon);
            string               query      = "SELECT * FROM Tb_OL_WeiXinOrder WHERE out_trade_no=@out_trade_no";
            Tb_OL_WeiXinPayOrder T_Order    = conn.Query <Tb_OL_WeiXinPayOrder>(query, new { out_trade_no = out_trade_no }).SingleOrDefault();

            if (BankResult == "00")
            {
                //更新订单状态
                UpdateProperyOrder(T_Order.CommunityId.ToString(), T_Order.out_trade_no.ToString(), BankResult, "成功");
                if (T_Order.IsSucc.ToString() != "1")
                {
                    //下账
                    ReceProperyOrder(T_Order.CommunityId.ToString(), T_Order.out_trade_no.ToString());
                    return(JSONHelper.FromString(true, "订单状态已更新并下账成功,请刷新订单"));
                }
                else
                {
                    return(JSONHelper.FromString(true, "订单状态已更新,请刷新订单"));
                }
            }
            else
            {
                //更新订单状态
                UpdateProperyOrder(T_Order.CommunityId.ToString(), T_Order.out_trade_no.ToString(), BankResult, "失败");
            }

            return("");
        }
Ejemplo n.º 23
0
        /// <summary>
        /// 获取下属列表
        /// </summary>
        private string GetSubordinateList(DataRow row)
        {
            if (!row.Table.Columns.Contains("UserCode") || string.IsNullOrEmpty(row["UserCode"].ToString()))
            {
                return(JSONHelper.FromString(false, "用户编号不能为空"));
            }

            if (!row.Table.Columns.Contains("CorpID") || string.IsNullOrEmpty(row["CorpID"].ToString()))
            {
                return(JSONHelper.FromString(false, "公司ID不能为空"));
            }

            string corpId = row["CorpID"].ToString();

            //构建链接字符串
            string strcon = "";
            bool   bl     = GetDBServerPathWithCorpID(corpId, out strcon);

            if (bl == false)
            {
                return(JSONHelper.FromString(false, strcon));
            }

            using (IDbConnection con = new SqlConnection(strcon))
            {
                DataTable dt = con.ExecuteReader(@"SELECT b.UserCode,b.UserName,b.DepCode, 
                            DepName=(SELECT top 1 DepName FROM Tb_Sys_Department WHERE DepCode=b.DepCode)
                            FROM Tb_OAPublicWork_WorkRecordNoticeUser a LEFT JOIN Tb_Sys_User b ON a.MyUserCode=b.UserCode
                            WHERE ToUserCode=@ToUserCode", new { ToUserCode = row["UserCode"].ToString() }).ToDataSet().Tables[0];
                return(JSONHelper.FromString(dt));
            }
        }
Ejemplo n.º 24
0
        /// <summary>
        /// 获取当前可用的优惠券余额
        /// </summary>
        public string GetCanUseCouponBalanceInBuss(DataRow row)
        {
            if (!row.Table.Columns.Contains("UserId") || string.IsNullOrEmpty(row["UserId"].ToString()))
            {
                return(JSONHelper.FromString(false, "用户id不能为空"));
            }

            if (!row.Table.Columns.Contains("CorpId") || string.IsNullOrEmpty(row["CorpId"].ToString()))
            {
                return(JSONHelper.FromString(false, "物业公司id不能为空"));
            }

            if (!row.Table.Columns.Contains("BussId") || string.IsNullOrEmpty(row["BussId"].ToString()))
            {
                return(JSONHelper.FromString(false, "商家id不能为空"));
            }

            using (IDbConnection conn = new SqlConnection(ConnectionDb.GetBusinessConnection()))
            {
                DataTable dt = conn.ExecuteReader(@"SELECT CorpId,BussId,isnull(Balance,0) as Balance FROM Tb_Resources_CouponBalance WHERE UserId=@UserId
                                                    AND CorpId=@CorpId AND (BussId=@BussId OR BussId IS NULL)",
                                                  new { UserId = row["UserId"], CorpId = row["CorpId"], BussId = row["BussId"] }).ToDataSet().Tables[0];

                return(JSONHelper.FromString(dt));
            }
        }
Ejemplo n.º 25
0
        /// <summary>
        /// 获取小区信息
        /// </summary>
        private string GetCommunityInfo(DataRow row)
        {
            if (!row.Table.Columns.Contains("CommunityId") || string.IsNullOrEmpty(row["CommunityId"].ToString()))
            {
                return(JSONHelper.FromString(false, "小区编号不能为空"));
            }

            string communityId = row["CommunityId"].AsString();

            //查询小区
            Tb_Community Community = new MobileSoft.BLL.Unified.Bll_Tb_Community().GetModel(communityId);

            //构造链接字符串
            if (Community == null)
            {
                return(JSONHelper.FromString(false, "该小区不存在"));
            }
            return(new ApiResult(true, new
            {
                Id = communityId,
                CorpID = Community.CorpID,
                CorpName = Community.CorpName,
                CommID = Community.CommID,
                CommName = Community.CommName,
                Province = Community.Province,
                Area = Community.Area,
                City = Community.City,
                Tel = Community.Tel,
                ModuleRights = Community.ModuleRights,
                IsMultiDoorControlServer = Community.IsMultiDoorControlServer
            }).toJson());
        }
Ejemplo n.º 26
0
        /// <summary>
        /// 优惠券使用历史
        /// </summary>
        public string GetCouponUsedHistoryList(DataRow row)
        {
            if (!row.Table.Columns.Contains("UserId") || string.IsNullOrEmpty(row["UserId"].ToString()))
            {
                return(JSONHelper.FromString(false, "用户id不能为空"));
            }

            int pageCount = 0;
            int Counts    = 0;
            int PageIndex = 1;
            int PageSize  = 10;

            if (row.Table.Columns.Contains("PageIndex") && AppGlobal.StrToInt(row["PageIndex"].ToString()) > 0)
            {
                PageIndex = AppGlobal.StrToInt(row["PageIndex"].ToString());
            }
            if (row.Table.Columns.Contains("PageSize") && AppGlobal.StrToInt(row["PageSize"].ToString()) > 0)
            {
                PageSize = AppGlobal.StrToInt(row["PageSize"].ToString());
            }

            using (IDbConnection conn = new SqlConnection(ConnectionDb.GetBusinessConnection()))
            {
                string sql = @"SELECT * FROM
                                (
                                    select R.Id, R.Amount, B.BussName,R.ReceiptDate,R.PayDate,
                                    OffsetMoney=(SELECT sum(isnull(x.OffsetMoney,0)) FROM Tb_Charge_ReceiptDetail x WHERE x.ReceiptCode=R.Id)
                                    FROM Tb_Charge_Receipt as R left join Tb_System_BusinessCorp as B on b.BussId = R.BussId
                                    WHERE  R.UserId='" + row["UserId"].ToString() + @"'
                                ) t WHERE t.OffsetMoney>0";

                DataTable dt = BussinessCommon.GetList(out pageCount, out Counts, sql, PageIndex, PageSize, "PayDate", 1, "Id", ConnectionDb.GetBusinessConnection(), "*").Tables[0];
                return(JSONHelper.FromString(dt));
            }
        }
Ejemplo n.º 27
0
        /// <summary>
        /// 泰禾高端定制
        /// </summary>
        private string GetCommunityServices(DataRow row)
        {
            if (!row.Table.Columns.Contains("CommunityId") || string.IsNullOrEmpty(row["CommunityId"].ToString()))
            {
                return(JSONHelper.FromString(false, "小区编号不能为空"));
            }

            string communityId = row["CommunityId"].AsString();

            //查询小区
            Tb_Community Community = new MobileSoft.BLL.Unified.Bll_Tb_Community().GetModel(communityId);

            //构造链接字符串
            if (Community == null)
            {
                return(JSONHelper.FromString(false, "该小区不存在"));
            }
            string strcon = new Business.CostInfo().GetConnectionStringStr(Community);

            using (IDbConnection conn = new SqlConnection(PubConstant.UnifiedContionString))
            {
                DataTable dataTable = conn.ExecuteReader(string.Format(@"SELECT TOP 9 Sort,CustomizedType,CustomizedImage,CarouselDescribe,CarouselImage,ImgLink,Phone FROM Tb_CommunityService 
                    WHERE isnull(IsDelete,0)=0 AND CommunityId LIKE '%{0}%'", communityId)).ToDataSet().Tables[0];
                return(JSONHelper.FromString(dataTable));
            }
        }
Ejemplo n.º 28
0
        /// <summary>
        /// 获取App下载链接
        /// </summary>
        private string GetAppDownloadUrl(DataRow row)
        {
            if (!row.Table.Columns.Contains("AppID") || string.IsNullOrEmpty(row["AppID"].AsString()))
            {
                return(new ApiResult(false, "缺少参数AppID").toJson());
            }
            if (!row.Table.Columns.Contains("Platform") || string.IsNullOrEmpty(row["Platform"].AsString()))
            {
                return(new ApiResult(false, "缺少参数Platform").toJson());
            }

            var appId    = row["AppID"].AsString();
            var platform = row["Platform"].AsString().ToLower();

            using (var conn = new SqlConnection(PubConstant.UnifiedContionString))
            {
                var sql = @"SELECT DownloadUrl FROM Tb_App_DownloadInfo WHERE IsDelete=0";

                if (platform == "ios")
                {
                    sql += " AND AppleBundleID=@AppID";
                }
                if (platform == "android")
                {
                    sql += " AND AndroidPackageName=@AppID";
                }

                var url = conn.Query <string>(sql, new { AppID = appId }).FirstOrDefault();
                if (url != null)
                {
                    return(JSONHelper.FromString(true, url));
                }
                return(JSONHelper.FromString(false, "还未配置App下载路径"));
            }
        }
Ejemplo n.º 29
0
        public override void Operate(ref Common.Transfer Trans)
        {
            Trans.Result = JSONHelper.FromString(false, "未知错误");

            DataTable dAttributeTable = base.XmlToDatatTable(Trans.Attribute);
            DataRow   Row             = dAttributeTable.Rows[0];

            switch (Trans.Command)
            {
            case "GetFeesStatistics":                 // 获取欠费或预存信息
                Trans.Result = GetFeesStatistics(Row);
                break;

            case "GetFeesStatistics_ZhongJi":                 // 获取欠费或预存信息
                Trans.Result = GetFeesStatistics_ZhongJi(Row);
                break;

            case "GetDebtsFeesList":                  // 获取欠费列表
                Trans.Result = GetDebtsFeesList(Row);
                break;

            case "GetDebtsFeesList_ZhongJi":                  // 获取欠费列表
                Trans.Result = GetDebtsFeesList_ZhongJi(Row);
                break;

            case "GetFeesHistoryList":                 // 获取历史账单
                Trans.Result = GetFeesHistoryList(Row);
                break;

            default:
                break;
            }
        }
Ejemplo n.º 30
0
        /// <summary>
        /// 审核操作
        /// </summary>
        private string Audit(DataRow row)
        {
            if (!row.Table.Columns.Contains("IID") || string.IsNullOrEmpty(row["IID"].ToString()))
            {
                return(JSONHelper.FromString(false, "缺少IID参数"));
            }
            if (!row.Table.Columns.Contains("IsAllows") || string.IsNullOrEmpty(row["IsAllows"].ToString()))
            {
                return(JSONHelper.FromString(false, "缺少IsAllows参数"));
            }
            if (!row.Table.Columns.Contains("Remark"))
            {
                return(JSONHelper.FromString(false, "缺少Remark参数"));
            }

            int IsAllows = 0;

            if (row["IsAllows"].ToString() == "1" || row["IsAllows"].ToString() == "通过")
            {
                IsAllows = 1;
            }

            string IID    = row["IID"].ToString();
            string Remark = row["Remark"].ToString();

            return(Audit(IsAllows, IID, Remark));
        }