示例#1
0
    protected void Page_Load(object sender, EventArgs e)
    {
        if (!Page.IsPostBack)
        {
            RentInfoHelper helper = new RentInfoHelper();
            DataTable      dt     = helper.GetRentsByStreet("9");

            foreach (DataRow row in dt.Rows)
            {
                dataInfo += "[" + row["Longitude"].ToString() + ", " + row["Latitude"].ToString() + ", '" + row["Available"].ToString() +
                            "', \"地址:" + row["RAddress"].ToString() + "<br/>" +
                            "房主:" + row["ROwner"].ToString() + " " + helper.OverString(row["RIDCard"].ToString()) + "<br/>" +
                            "状态:" + (row["Available"].ToString().ToUpper() == "已租" ? "<span style='color:red;'>出租中</span>" : "空闲") +
                            "\"],";
            }

            if (!string.IsNullOrEmpty(dataInfo))
            {
                dataInfo = dataInfo.Substring(0, dataInfo.Length - 1);
            }

            string    sql = "select * from Motor_BerthesInfo";
            DataTable mDt = MySQLHelper.ExecuteDataset(MySQLHelper.SqlConnString, MySQLHelper.CreateCommand(sql)).Tables[0];
            foreach (DataRow row in mDt.Rows)
            {
                motordataInfo += "[" + row["Lon"].ToString() + ", " + row["Lat"].ToString() + ", '" + row["Status"].ToString() + "','" + row["BertheNumber"].ToString() + "'],";
            }

            if (!string.IsNullOrEmpty(motordataInfo))
            {
                motordataInfo = motordataInfo.Substring(0, motordataInfo.Length - 1);
            }
        }
    }
示例#2
0
    protected void ddlStation_SelectedIndexChanged(object sender, EventArgs e)
    {
        RentInfoHelper rentHelper = new RentInfoHelper();

        ddlPolice.DataSource = rentHelper.dtPoliceStation(ddlStation.SelectedValue);
        ddlPolice.DataBind();
    }
示例#3
0
    //Scattergram.aspx?category=0&sDate=&eDate=&corpId=&regDeptId=
    protected void Page_Load(object sender, EventArgs e)
    {
        if (!Page.IsPostBack)
        {
            defaultLon = ConfigurationManager.AppSettings["defaultLon"];
            defaultLat = ConfigurationManager.AppSettings["defaultLat"];

            category = Request["category"];
            year     = Request["year"];
            month    = Request["month"];
            day      = Request["day"];
            psname   = Request["psname"];


            RentInfoHelper helper = new RentInfoHelper();

            string startDate = string.Empty;
            string endDate   = string.Empty;
            if (!string.IsNullOrEmpty(day))
            {
                startDate = day;
                endDate   = Convert.ToDateTime(startDate).AddDays(1).ToString("yyyy-MM-dd");
            }
            else if (!string.IsNullOrEmpty(month) && string.IsNullOrEmpty(day) == true)
            {
                startDate = year + "-" + month + "-01";
                endDate   = Convert.ToDateTime(startDate).AddMonths(1).ToString("yyyy-MM-dd");
            }
            else if (string.IsNullOrEmpty(month) && string.IsNullOrEmpty(day))
            {
                startDate = year + "-01-01";
                endDate   = Convert.ToDateTime(startDate).AddYears(1).ToString("yyyy-MM-dd");
            }


            DataTable dt = helper.GetScattergramData(startDate, endDate, psname == "全部" ? "" : psname, LigerRM.Common.SysContext.CurrentUserID.ToString());

            foreach (DataRow row in dt.Rows)
            {
                dataInfo += "[" + row["Longitude"].ToString() + ", " + row["Latitude"].ToString() +
                            //", \"警局:" + row["RPSName"].ToString() + "<br/>" +
                            //"租赁人:" + row["RRAContactName"].ToString() + " " + helper.OverString(row["RRAContactTel"].ToString()) + "<br/>" +
                            ", \"地址:" + row["RAddress"].ToString() + "<br/>" +
                            "房主:" + row["ROwner"].ToString() + " " + helper.OverString(row["RIDCard"].ToString()) + "<br/>" +
                            "状态:" + (row["IsAvailable"].ToString().ToUpper() == "已租" ? "<span style='color:red;'>出租中</span>" : "空闲") +
                            //"时间:" + DateTime.Parse(row["RRAStartDate"].ToString()).ToString("yyyy-MM-dd") + " " + DateTime.Parse(row["RRAEndDate"].ToString()).ToString("yyyy-MM-dd") +
                            "\"],";
            }

            if (!string.IsNullOrEmpty(dataInfo))
            {
                dataInfo = dataInfo.Substring(0, dataInfo.Length - 1);
            }
        }
    }
示例#4
0
        public static AjaxResult UpdateUserCommunityRef(string User, string DataJSON)
        {
            var            data   = new JavaScriptSerializer().Deserialize <List <Dictionary <string, object> > >(DataJSON);
            UserInfoHelper helper = new UserInfoHelper();

            DeleteUserCommunityRef(User);
            foreach (var item in data)
            {
                RentInfoHelper rHelper = new RentInfoHelper();
                string         Region  = item["LSID"].ToString();
                helper.InsertCommunityRelationShip(User, Region);
            }
            return(AjaxResult.Success());
        }
示例#5
0
        public static AjaxResult RemoveRent(string ID)
        {
            RentInfoHelper helper = new RentInfoHelper();

            if (helper.IsExists(ID))
            {
                return(AjaxResult.Error("该房源已经有租赁信息,无法删除!"));
            }
            else
            {
                helper.DeleteCorporation(ID);
                SysLogHelper.AddLog(SysContext.CurrentUserName, "删除房源信息ID:" + ID, "删除-房源信息");
                return(AjaxResult.Success());
            }
        }
示例#6
0
        public static AjaxResult SetHouseStatus()
        {
            RentInfoHelper helper = new RentInfoHelper();
            string         sql    = "select * from v_RentHistory_view where RRAIsActive = 0 and RRAEndDate<'" + DateTime.Now.ToString("yyyy-MM-dd") + "' and isavailable='已租'";
            DataTable      dt     = helper.GetDataTable(sql);

            foreach (DataRow row in dt.Rows)
            {
                sql = "update rent_rent set isavailable=0 where rentno='" + row["RentNO"].ToString() + "'";
                helper.ExcuteSql(sql);
                sql = "Update rent_rentAttribute set RRAIsActive=1 where RRAID=" + row["RRAID"].ToString();
                helper.ExcuteSql(sql);
            }
            return(AjaxResult.Success());
        }
示例#7
0
    protected void Page_Load(object sender, EventArgs e)
    {
        if (!Page.IsPostBack)
        {
            UserInfoHelper helper     = new UserInfoHelper();
            RentInfoHelper rentHelper = new RentInfoHelper();

            ddlStation.DataSource = rentHelper.dtPoliceStation("0");
            ddlStation.DataBind();

            ddlPolice.DataSource = rentHelper.dtPoliceStation(ddlStation.SelectedValue);
            ddlPolice.DataBind();

            ddlUsers.DataSource = helper.GetCFUserList("7");
            ddlUsers.DataBind();
        }
    }
示例#8
0
        public static AjaxResult UpdateUserAreaRef(string User, string DataJSON)
        {
            var            data   = new JavaScriptSerializer().Deserialize <List <Dictionary <string, object> > >(DataJSON);
            UserInfoHelper helper = new UserInfoHelper();

            DeleteUserAreaRef(User);
            foreach (var item in data)
            {
                RentInfoHelper rHelper = new RentInfoHelper();
                DataTable      dt      = rHelper.GetDataTable("select * from Rent_PoliceStation where parentId=" + item["PSID"].ToString());
                if (dt.Rows.Count <= 0)
                {
                    string Region = item["PSID"].ToString();
                    helper.InsertRelationShip(User, Region);
                }
            }
            return(AjaxResult.Success());
        }
示例#9
0
    private void DataBindPoliceStation()
    {
        RentInfoHelper rentInfoHelper = new RentInfoHelper();

        DataTable dt = rentInfoHelper.dtPoliceStation(ddlPoliceStationParent.SelectedValue);

        if (dt != null)
        {
            ddlPoliceStation.DataSource     = dt;
            ddlPoliceStation.DataTextField  = "PSName";
            ddlPoliceStation.DataValueField = "PSID";
            ddlPoliceStation.DataBind();

            if (string.IsNullOrEmpty(RentNo) && EditType == "E")
            {
                AddListItem(ddlPoliceStation);
            }
        }
    }
示例#10
0
    private void DataBindRoad()
    {
        RentInfoHelper rentInfoHelper = new RentInfoHelper();

        DataTable dt = rentInfoHelper.dtRoad(ddlDistrict.SelectedValue, ddlStreet.SelectedValue);

        if (dt != null)
        {
            ddlRoad.DataSource     = dt;
            ddlRoad.DataTextField  = "LRName";
            ddlRoad.DataValueField = "LRID";
            ddlRoad.DataBind();

            if (string.IsNullOrEmpty(RentNo) && EditType == "E")
            {
                AddListItem(ddlRoad);
            }
        }
    }
示例#11
0
        public string GetNewFamilyInfo(string newLockId, string userId)
        {
            if (!authentication.ValideLockUser())
            {
                return("{'headerError'}");
            }
            Dictionary <string, string> ret = new Dictionary <string, string>();
            NewLockManager manager          = new NewLockManager();
            //传值校验
            Dictionary <string, string> dic = new Dictionary <string, string>();

            dic.Add("newLockId", newLockId);
            string returnFiled = manager.checkIsNullFild(dic);

            if (returnFiled != string.Empty)
            {
                ret.Add("ret", "1");
                ret.Add("msg", "字段" + returnFiled + "不允许为空!");
                return(JSONHelper.ToJson(ret));
            }
            //判断是否授权
            if (manager.GetIsEnterprise(userId) == "2")
            {
                ret.Add("ret", "1");
                ret.Add("msg", "我公司暂无给贵公司授权,请核对再操做!");
                return(JSONHelper.ToJson(ret));
            }
            //判断接口是否授权
            if (!manager.GetIsInterfacePermissions("7", userId))
            {
                ret.Add("ret", "1");
                ret.Add("msg", "我公司暂无给贵公司授权该接口,请核对再操做!");
                return(JSONHelper.ToJson(ret));
            }
            RentInfoHelper helper = new RentInfoHelper();

            ret.Add("ret", "0");
            ret.Add("msg", helper.GetJSONInfo("select * from v_EnterpriseHomeLock_view where NewLockID='" + newLockId + "'"));
            return(JSONHelper.ToJson(ret));
        }
示例#12
0
    private void GetHouseInfo()
    {
        RentInfoHelper helper = new RentInfoHelper();
        DataTable      dt     = helper.GetRentsByStreet("9");

        HOUSE_TOTALCOUNT = dt.Rows.Count.ToString();
        int leftCount = 0;
        int usedCount = 0;

        foreach (DataRow row in dt.Rows)
        {
            if (row["Available"].ToString() == "True")
            {
                leftCount++;
            }
            else
            {
                usedCount++;
            }
        }

        HOUSE_LEFTCOUNT = leftCount.ToString();
        HOUSE_USEDCOUNT = usedCount.ToString();
    }
示例#13
0
    protected void Page_Load(object sender, EventArgs e)
    {
        if (!Page.IsPostBack)
        {
            category = Request["type"];
            type     = Request["category"];
            year     = Request["year"];
            month    = Request["month"];
            day      = Request["day"];
            psname   = Request["psname"];
            RentInfoHelper helper = new RentInfoHelper();
            //chartData = "{";

            switch (type)
            {
            case "0":
                title    = "年度信息统计";
                subtitle = "日期:" + year;
                yTitle   = "入住数量";
                category = "'1月', '2月', '3月', '4月', '5月', '6月', '7月', '8月', '9月', '10月', '11月', '12月'";
                DataTable dt = helper.GetStatisticTimeData(category, type, year, month, day, psname, LigerRM.Common.SysContext.CurrentUserID.ToString());
                serialName = new string[dt.Rows.Count];
                serialData = new string[dt.Rows.Count];

                for (int i = 0; i < dt.Rows.Count; i++)
                {
                    serialName[i] = dt.Rows[i]["PSName"].ToString();
                    serialData[i] = dt.Rows[i]["num1"].ToString() + "," + dt.Rows[i]["num2"].ToString() + "," + dt.Rows[i]["num3"].ToString() + "," + dt.Rows[i]["num4"].ToString() + "," + dt.Rows[i]["num5"].ToString() + "," + dt.Rows[i]["num6"].ToString() + "," + dt.Rows[i]["num7"].ToString() + ","
                                    + dt.Rows[i]["num8"].ToString() + "," + dt.Rows[i]["num9"].ToString() + "," + dt.Rows[i]["num10"].ToString() + "," + dt.Rows[i]["num11"].ToString() + "," + dt.Rows[i]["num12"].ToString();
                }
                break;

            case "1":
                title    = "月度信息统计";
                subtitle = "日期:" + year + "年" + month + "月";
                yTitle   = "入住数量";
                DataTable dt1 = helper.GetStatisticTimeData(category, type, year, month, day, psname, LigerRM.Common.SysContext.CurrentUserID.ToString());
                serialName = new string[dt1.Rows.Count];
                serialData = new string[dt1.Rows.Count];

                switch (month)
                {
                case "1":
                case "3":
                case "5":
                case "7":
                case "8":
                case "10":
                case "12":
                    category = "'1', '2', '3', '4', '5', '6', '7', '8', '9', '10', '11', '12', '13', '14', '15', '16', '17', '18', '19', '20', '21', '22', '23', '24', '25', '26', '27', '28', '29', '30', '31'";
                    for (int i = 0; i < dt1.Rows.Count; i++)
                    {
                        serialName[i] = dt1.Rows[i]["PSName"].ToString();
                        serialData[i] = dt1.Rows[i]["num1"].ToString() + "," + dt1.Rows[i]["num2"].ToString() + "," + dt1.Rows[i]["num3"].ToString() + "," + dt1.Rows[i]["num4"].ToString() + "," + dt1.Rows[i]["num5"].ToString() + "," + dt1.Rows[i]["num6"].ToString() + "," + dt1.Rows[i]["num7"].ToString() + ","
                                        + dt1.Rows[i]["num8"].ToString() + "," + dt1.Rows[i]["num9"].ToString() + "," + dt1.Rows[i]["num10"].ToString() + "," + dt1.Rows[i]["num11"].ToString() + "," + dt1.Rows[i]["num12"].ToString() + "," + dt1.Rows[i]["num13"].ToString() + "," + dt1.Rows[i]["num14"].ToString() + "," + dt1.Rows[i]["num15"].ToString()
                                        + "," + dt1.Rows[i]["num16"].ToString() + "," + dt1.Rows[i]["num17"].ToString() + "," + dt1.Rows[i]["num18"].ToString() + "," + dt1.Rows[i]["num19"].ToString() + "," + dt1.Rows[i]["num20"].ToString() + "," + dt1.Rows[i]["num21"].ToString() + "," + dt1.Rows[i]["num22"].ToString() + "," + dt1.Rows[i]["num23"].ToString()
                                        + "," + dt1.Rows[i]["num24"].ToString() + "," + dt1.Rows[i]["num25"].ToString() + "," + dt1.Rows[i]["num26"].ToString() + "," + dt1.Rows[i]["num27"].ToString() + "," + dt1.Rows[i]["num28"].ToString() + "," + dt1.Rows[i]["num29"].ToString() + "," + dt1.Rows[i]["num30"].ToString() + "," + dt1.Rows[i]["num31"].ToString();
                    }
                    break;

                case "4":
                case "6":
                case "9":
                case "11":
                    category = "'1', '2', '3', '4', '5', '6', '7', '8', '9', '10', '11', '12', '13', '14', '15', '16', '17', '18', '19', '20', '21', '22', '23', '24', '25', '26', '27', '28', '29', '30'";
                    for (int i = 0; i < dt1.Rows.Count; i++)
                    {
                        serialName[i] = dt1.Rows[i]["PSName"].ToString();
                        serialData[i] = dt1.Rows[i]["num1"].ToString() + "," + dt1.Rows[i]["num2"].ToString() + "," + dt1.Rows[i]["num3"].ToString() + "," + dt1.Rows[i]["num4"].ToString() + "," + dt1.Rows[i]["num5"].ToString() + "," + dt1.Rows[i]["num6"].ToString() + "," + dt1.Rows[i]["num7"].ToString() + ","
                                        + dt1.Rows[i]["num8"].ToString() + "," + dt1.Rows[i]["num9"].ToString() + "," + dt1.Rows[i]["num10"].ToString() + "," + dt1.Rows[i]["num11"].ToString() + "," + dt1.Rows[i]["num12"].ToString() + "," + dt1.Rows[i]["num13"].ToString() + "," + dt1.Rows[i]["num14"].ToString() + "," + dt1.Rows[i]["num15"].ToString()
                                        + "," + dt1.Rows[i]["num16"].ToString() + "," + dt1.Rows[i]["num17"].ToString() + "," + dt1.Rows[i]["num18"].ToString() + "," + dt1.Rows[i]["num19"].ToString() + "," + dt1.Rows[i]["num20"].ToString() + "," + dt1.Rows[i]["num21"].ToString() + "," + dt1.Rows[i]["num22"].ToString() + "," + dt1.Rows[i]["num23"].ToString()
                                        + "," + dt1.Rows[i]["num24"].ToString() + "," + dt1.Rows[i]["num25"].ToString() + "," + dt1.Rows[i]["num26"].ToString() + "," + dt1.Rows[i]["num27"].ToString() + "," + dt1.Rows[i]["num28"].ToString() + "," + dt1.Rows[i]["num29"].ToString() + "," + dt1.Rows[i]["num30"].ToString();
                    }
                    break;

                case "2":
                    if (IsLeap(int.Parse(year)))
                    {
                        category = "'1', '2', '3', '4', '5', '6', '7', '8', '9', '10', '11', '12', '13', '14', '15', '16', '17', '18', '19', '20', '21', '22', '23', '24', '25', '26', '27', '28', '29'";
                        for (int i = 0; i < dt1.Rows.Count; i++)
                        {
                            serialName[i] = dt1.Rows[i]["PSName"].ToString();
                            serialData[i] = dt1.Rows[i]["num1"].ToString() + "," + dt1.Rows[i]["num2"].ToString() + "," + dt1.Rows[i]["num3"].ToString() + "," + dt1.Rows[i]["num4"].ToString() + "," + dt1.Rows[i]["num5"].ToString() + "," + dt1.Rows[i]["num6"].ToString() + "," + dt1.Rows[i]["num7"].ToString() + ","
                                            + dt1.Rows[i]["num8"].ToString() + "," + dt1.Rows[i]["num9"].ToString() + "," + dt1.Rows[i]["num10"].ToString() + "," + dt1.Rows[i]["num11"].ToString() + "," + dt1.Rows[i]["num12"].ToString() + "," + dt1.Rows[i]["num13"].ToString() + "," + dt1.Rows[i]["num14"].ToString() + "," + dt1.Rows[i]["num15"].ToString()
                                            + "," + dt1.Rows[i]["num16"].ToString() + "," + dt1.Rows[i]["num17"].ToString() + "," + dt1.Rows[i]["num18"].ToString() + "," + dt1.Rows[i]["num19"].ToString() + "," + dt1.Rows[i]["num20"].ToString() + "," + dt1.Rows[i]["num21"].ToString() + "," + dt1.Rows[i]["num22"].ToString() + "," + dt1.Rows[i]["num23"].ToString()
                                            + "," + dt1.Rows[i]["num24"].ToString() + "," + dt1.Rows[i]["num25"].ToString() + "," + dt1.Rows[i]["num26"].ToString() + "," + dt1.Rows[i]["num27"].ToString() + "," + dt1.Rows[i]["num28"].ToString() + "," + dt1.Rows[i]["num29"].ToString();
                        }
                    }
                    else
                    {
                        category = "'1', '2', '3', '4', '5', '6', '7', '8', '9', '10', '11', '12', '13', '14', '15', '16', '17', '18', '19', '20', '21', '22', '23', '24', '25', '26', '27', '28'";
                        for (int i = 0; i < dt1.Rows.Count; i++)
                        {
                            serialName[i] = dt1.Rows[i]["PSName"].ToString();
                            serialData[i] = dt1.Rows[i]["num1"].ToString() + "," + dt1.Rows[i]["num2"].ToString() + "," + dt1.Rows[i]["num3"].ToString() + "," + dt1.Rows[i]["num4"].ToString() + "," + dt1.Rows[i]["num5"].ToString() + "," + dt1.Rows[i]["num6"].ToString() + "," + dt1.Rows[i]["num7"].ToString() + ","
                                            + dt1.Rows[i]["num8"].ToString() + "," + dt1.Rows[i]["num9"].ToString() + "," + dt1.Rows[i]["num10"].ToString() + "," + dt1.Rows[i]["num11"].ToString() + "," + dt1.Rows[i]["num12"].ToString() + "," + dt1.Rows[i]["num13"].ToString() + "," + dt1.Rows[i]["num14"].ToString() + "," + dt1.Rows[i]["num15"].ToString()
                                            + "," + dt1.Rows[i]["num16"].ToString() + "," + dt1.Rows[i]["num17"].ToString() + "," + dt1.Rows[i]["num18"].ToString() + "," + dt1.Rows[i]["num19"].ToString() + "," + dt1.Rows[i]["num20"].ToString() + "," + dt1.Rows[i]["num21"].ToString() + "," + dt1.Rows[i]["num22"].ToString() + "," + dt1.Rows[i]["num23"].ToString()
                                            + "," + dt1.Rows[i]["num24"].ToString() + "," + dt1.Rows[i]["num25"].ToString() + "," + dt1.Rows[i]["num26"].ToString() + "," + dt1.Rows[i]["num27"].ToString() + "," + dt1.Rows[i]["num28"].ToString();
                        }
                    }
                    break;
                }
                break;

            case "2":
                title    = "日信息统计";
                subtitle = "日期:" + day;
                yTitle   = "入住数量";
                category = "'00:00', '01:00', '02:00', '03:00', '04:00', '05:00', '06:00', '07:00', '08:00', '09:00', '10:00', '11:00', '12:00', '13:00', '14:00', '15:00', '16:00', '17:00', '18:00', '19:00', '20:00', '21:00', '22:00', '23:00'";
                DataTable dt2 = helper.GetStatisticTimeData(category, type, year, month, day, psname, LigerRM.Common.SysContext.CurrentUserID.ToString());
                serialName = new string[dt2.Rows.Count];
                serialData = new string[dt2.Rows.Count];

                for (int i = 0; i < dt2.Rows.Count; i++)
                {
                    serialName[i] = dt2.Rows[i]["PSName"].ToString();
                    serialData[i] = dt2.Rows[i]["num1"].ToString() + "," + dt2.Rows[i]["num2"].ToString() + "," + dt2.Rows[i]["num3"].ToString() + "," + dt2.Rows[i]["num4"].ToString() + "," + dt2.Rows[i]["num5"].ToString() + "," + dt2.Rows[i]["num6"].ToString() + "," + dt2.Rows[i]["num7"].ToString() + ","
                                    + dt2.Rows[i]["num8"].ToString() + "," + dt2.Rows[i]["num9"].ToString() + "," + dt2.Rows[i]["num10"].ToString() + "," + dt2.Rows[i]["num11"].ToString() + "," + dt2.Rows[i]["num12"].ToString() + "," + dt2.Rows[i]["num13"].ToString() + "," + dt2.Rows[i]["num14"].ToString() + "," + dt2.Rows[i]["num15"].ToString()
                                    + "," + dt2.Rows[i]["num16"].ToString() + "," + dt2.Rows[i]["num17"].ToString() + "," + dt2.Rows[i]["num18"].ToString() + "," + dt2.Rows[i]["num19"].ToString() + "," + dt2.Rows[i]["num20"].ToString() + "," + dt2.Rows[i]["num21"].ToString() + "," + dt2.Rows[i]["num22"].ToString() + "," + dt2.Rows[i]["num23"].ToString() + "," + dt2.Rows[i]["num24"].ToString();
                }
                break;
            }
            if (!string.IsNullOrEmpty(chartData))
            {
                chartData = chartData.Substring(0, chartData.Length - 1);
            }
            chartData = chartData + "}";
        }
    }
示例#14
0
    public string UpdateRentInfo(string RentNo, string RDName, string RSName, string RRName, string RPSName, string RAddress,
                                 string RDoor, string RTotalDoor, string RRoomType, string RDirection, string RStructure, string RBuildingType, string RFloor, string RTotalFloor, string RHouseAge,
                                 decimal RRentArea, string RProperty, string ROwner, string ROwnerTel, string RIDCard, string RLocationDescription, string RPSParentName, string createdBy, string rentType, string ownType)
    {
        RentInfo rentInfo = new RentInfo(RentNo);

        rentInfo.RentNo = RentNo;
        RentInfoHelper helper = new RentInfoHelper();

        rentInfo.RDName = RDName;
        rentInfo.RSName = RSName;
        rentInfo.RRName = RRName;

        rentInfo.RPSParentName = RPSParentName;
        rentInfo.RPSName       = RPSName;
        rentInfo.RPSID         = RPSName;
        //rentInfo.RPSID = int.Parse(RPSName);

        rentInfo.RAddress   = RAddress;
        rentInfo.RDoor      = RDoor;
        rentInfo.RTotalDoor = int.Parse(RTotalDoor);

        rentInfo.RRoomType     = RRoomType;
        rentInfo.RDirection    = RDirection;
        rentInfo.RStructure    = RStructure;
        rentInfo.RBuildingType = RBuildingType;
        rentInfo.RProperty     = RProperty;

        rentInfo.RFloor      = RFloor;
        rentInfo.RTotalFloor = int.Parse(RTotalFloor);

        rentInfo.RHouseAge            = int.Parse(RHouseAge);
        rentInfo.RRentArea            = RRentArea;
        rentInfo.ROwner               = ROwner;
        rentInfo.ROwnerTel            = ROwnerTel;
        rentInfo.RIDCard              = RIDCard;
        rentInfo.RLocationDescription = RLocationDescription;

        rentInfo.RMapID = 0;

        rentInfo.RCreatedBy    = createdBy;
        rentInfo.RCreatedDate  = DateTime.Now;
        rentInfo.RModifiedBy   = createdBy;
        rentInfo.RModifiedDate = DateTime.Now;

        rentInfo.RentType = rentType;
        rentInfo.OwnType  = ownType;

        string      retStr = GetLocationInfo(RAddress, "天津");
        XmlDocument doc    = new XmlDocument();

        doc.LoadXml(retStr);
        XmlNode status = doc.SelectSingleNode("GeocoderSearchResponse/status");

        if (status.InnerText == "0")
        {
            XmlNode lng = doc.SelectSingleNode("GeocoderSearchResponse/result/location/lng");
            XmlNode lat = doc.SelectSingleNode("GeocoderSearchResponse/result/location/lat");
            rentInfo.Longitude = lng.InnerText;
            rentInfo.Latitude  = lat.InnerText;
        }


        //string retStr = GetLocationInfo(RAddress, "天津");
        //if (retStr.IndexOf("lng") > 0)
        //{
        //    int aa = retStr.IndexOf("\"lng\"");
        //    retStr = retStr.Substring(retStr.IndexOf("\"lng\""));
        //    string lng = retStr.Substring(6, retStr.IndexOf("\n"));
        //    lng = lng.Replace("\n", "").Trim().Replace(",", "");
        //    retStr = retStr.Substring(retStr.IndexOf("\"lat\""));
        //    string lat = retStr.Substring(6, retStr.IndexOf("\n"));
        //    lat = lat.Replace("\n", "").Trim().Replace(",", "");
        //    rentInfo.Longitude = lng;
        //    rentInfo.Latitude = lat;
        //}

        RentInfoHelper rentInfoHelper = new RentInfoHelper();

        try
        {
            rentInfoHelper.UpdateRent(rentInfo);
            return("true");
        }
        catch (Exception ex)
        {
            return("false");
        }
    }
示例#15
0
    protected void Page_Load(object sender, EventArgs e)
    {
        if (!Page.IsPostBack)
        {
            string psName = Request["psname"];
            startDate = Request["sDate"];
            endDate   = Request["eDate"];

            statisticType = Request["category"];
            RentInfoHelper helper = new RentInfoHelper();
            chartData = "[";
            switch (statisticType)
            {
            case "AllPoliceStation":
                if (policeStationName != "全部")
                {
                    policeStationName = psName;
                }
                mtitle     = "<b>房源全量统计</b>";
                stitle     = "所属警局:" + policeStationName + " <br />统计日期:" + startDate + " 至 " + endDate;
                yTitle     = "入住数量";
                serieTitle = "入住量";

                DataTable dt = helper.GetStatisticData(statisticType, startDate, endDate, psName == "全部" ? "" : psName, LigerRM.Common.SysContext.CurrentUserID.ToString());
                foreach (DataRow row in dt.Rows)
                {
                    chartData += "['" + row["PSName"].ToString() + "'," + row["RentRecordCount"].ToString() + "],";
                }
                break;

            case "AllDistrict":

                if (policeStationName != "全部")
                {
                    DataTable dt1 = helper.GetDataTable("select * from Rent_PoliceStation where PSName='" + psName + "'");
                    if (dt1.Rows.Count > 0)
                    {
                        policeStationName = dt1.Rows[0]["co_corp_name"].ToString();
                    }
                }

                mtitle     = "<b>所属区域全量统计</b>";
                stitle     = "所属区域:" + policeStationName + " <br />统计日期:" + startDate + " 至 " + endDate;
                yTitle     = "入住数量";
                serieTitle = "入住量";

                DataTable dt2 = helper.GetStatisticData(statisticType, startDate, endDate, psName == "全部" ? "" : psName, LigerRM.Common.SysContext.CurrentUserID.ToString());
                foreach (DataRow row in dt2.Rows)
                {
                    chartData += "['" + row["rd_reg_dept_name"].ToString() + "'," + row["PackageCount"].ToString() + "],";
                }
                break;

            case "AllPoliceHouse":
                if (policeStationName != "全部")
                {
                    policeStationName = psName;
                }
                mtitle     = "<b>所属警局全量统计</b>";
                stitle     = "所属警局:" + policeStationName + " <br />统计日期:" + startDate + " 至 " + endDate;
                yTitle     = "入住数量";
                serieTitle = "入住量";

                DataTable dt3 = helper.GetStatisticData(statisticType, startDate, endDate, psName == "全部" ? "" : psName, LigerRM.Common.SysContext.CurrentUserID.ToString());
                foreach (DataRow row in dt3.Rows)
                {
                    chartData += "['" + row["PSName"].ToString() + "'," + row["RentRecordCount"].ToString() + "],";
                }
                break;
            }
            if (!string.IsNullOrEmpty(chartData))
            {
                chartData = chartData.Substring(0, chartData.Length - 1);
            }
            chartData = chartData + "]";
        }
    }
示例#16
0
    protected void InitialControls()
    {
        RentAttributeHelper rentAttributeHelper = new RentAttributeHelper();

        DataBindProvince();
        DataBindNationName();



        if (EditType == "D")
        {
            RentAttribute rentAttribute = new RentAttribute(int.Parse(RentNo));

            lblRentNo.Text = rentAttribute.RentNo;
            RentInfo rentInfo = new RentInfo(rentAttribute.RentNo);

            txtContactName.Text = rentAttribute.RRAContactName;
            txtIDCard.Text      = rentAttribute.RRAIDCard;
            txtContactTel.Text  = rentAttribute.RRAContactTel;
            txtRentPrice.Text   = rentAttribute.RRentPrice.ToString();

            ddlContactProvince.SelectedIndex = ddlContactProvince.Items.IndexOf(ddlContactProvince.Items.FindByText(rentAttribute.RRAContactProvince));
            ddlNationName.SelectedIndex      = ddlNationName.Items.IndexOf(ddlNationName.Items.FindByText(rentAttribute.RRANationName));
            txtStartDate.Text = rentAttribute.RRAStartDate.ToString("yyyy-MM-dd");
            txtEndDate.Text   = rentAttribute.RRAEndDate.ToString("yyyy-MM-dd");

            txtDescription.Text = rentAttribute.RRADescription;
            lblCreatedBy.Text   = rentAttribute.RRACreatedBy;
            RentInfoHelper helper = new RentInfoHelper();
            DataTable      dtUser = helper.GetDataTable("select * from cf_user where loginName='" + lblCreatedBy.Text + "'");
            foreach (DataRow row in dtUser.Rows)
            {
                lblCreatedByName.Text = row["RealName"].ToString();
            }
            lblCreatedDate.Text = rentAttribute.RRACreatedDate.ToString("yyyy-MM-dd hh:mm:ss");
            btnStart.Visible    = false;
            btnEnd.Visible      = false;
            btnSave.Visible     = false;
        }
        else
        {
            //获取租房者信息
            RentAttribute rentAttribute = new RentAttribute(int.Parse(RentNo));

            lblRentNo.Text = rentAttribute.RentNo;
            RentInfo rentInfo = new RentInfo(rentAttribute.RentNo);

            txtContactName.Text = rentAttribute.RRAContactName;                                                                                         //承租人姓名
            txtIDCard.Text      = rentAttribute.RRAIDCard;                                                                                              //身份证号ID
            txtContactTel.Text  = rentAttribute.RRAContactTel;                                                                                          //承租人联系电话
            txtRentPrice.Text   = rentAttribute.RRentPrice.ToString();                                                                                  //租赁价格

            ddlContactProvince.SelectedIndex = ddlContactProvince.Items.IndexOf(ddlContactProvince.Items.FindByText(rentAttribute.RRAContactProvince)); //获取所属省份
            ddlNationName.SelectedIndex      = ddlNationName.Items.IndexOf(ddlNationName.Items.FindByText(rentAttribute.RRANationName));                //获取所属国籍
            txtStartDate.Text = rentAttribute.RRAStartDate.ToString("yyyy-MM-dd");                                                                      //租赁起始时间
            txtEndDate.Text   = rentAttribute.RRAEndDate.ToString("yyyy-MM-dd");                                                                        //租赁结束时间

            txtDescription.Text = rentAttribute.RRADescription;                                                                                         //备注
            lblCreatedBy.Text   = rentAttribute.RRACreatedBy;
            RentInfoHelper helper = new RentInfoHelper();
            DataTable      dtUser = helper.GetDataTable("select * from cf_user where loginName='" + lblCreatedBy.Text + "'");
            foreach (DataRow row in dtUser.Rows)
            {
                lblCreatedByName.Text = row["RealName"].ToString();                             //创建人
            }
            lblCreatedDate.Text = rentAttribute.RRACreatedDate.ToString("yyyy-MM-dd hh:mm:ss"); //创建时间

            if (EditType == "A")
            {
                lblRentStatus.Text = "此房源已出租";
                btnSave.Visible    = false;
            }
        }
    }
示例#17
0
        public string NewSelPasswordICcard(string newLockId, int type, string userId)
        {
            if (!authentication.ValideLockUser())
            {
                return("{'headerError'}");
            }
            NewLockManager managerNew       = new NewLockManager();
            Dictionary <string, string> ret = new Dictionary <string, string>();
            //传值校验
            Dictionary <string, string> dic = new Dictionary <string, string>();

            dic.Add("newLockId", newLockId);
            dic.Add("type", type.ToString());
            string returnFiled = managerNew.checkIsNullFild(dic);

            if (returnFiled != string.Empty)
            {
                ret.Add("ret", "1");
                ret.Add("msg", "字段" + returnFiled + "不允许为空!");
                return(JSONHelper.ToJson(ret));
            }
            //判断是否授权
            if (managerNew.GetIsEnterprise(userId) == "2")
            {
                ret.Add("ret", "1");
                ret.Add("msg", "我公司暂无给贵公司授权,请核对再操做!");
                return(JSONHelper.ToJson(ret));
            }
            //判断接口是否授权
            if (!managerNew.GetIsInterfacePermissions("12", userId))
            {
                ret.Add("ret", "1");
                ret.Add("msg", "我公司暂无给贵公司授权该接口,请核对再操做!");
                return(JSONHelper.ToJson(ret));
            }
            if (type != 1 && type != 2)
            {
                ret.Add("ret", "1");
                ret.Add("msg", "type参数值超出允许范围!");
                return(JSONHelper.ToJson(ret));
            }
            string lockId = managerNew.getDeviceID(newLockId, "DeviceID");
            string UserId = managerNew.getDeviceID(newLockId, "UserId");

            if (lockId == string.Empty || userId == string.Empty)
            {
                ret.Add("ret", "1");
                ret.Add("msg", "未获取该家庭锁信息!");
                return(JSONHelper.ToJson(ret));
            }
            RentInfoHelper helper = new RentInfoHelper();

            if (type == 1)
            {
                ret.Add("ret", "0");
                ret.Add("msg", helper.GetJSONInfo("select ID,LockID,ICCard,StartDate,EndDate,IsValid,UserId from v_RentICCard_view where LockID='" + lockId + " and Status='0' and UserId='" + UserId + "'and ICCard is not null and len(ICCard)>0"));
                return(JSONHelper.ToJson(ret));
            }
            else
            {
                ret.Add("ret", "0");
                ret.Add("msg", helper.GetJSONInfo("select ID,LockID,Password,StartDate,EndDate,IsValid,UserId from v_RentPass_view where LockID='" + lockId + "' and Status='0' and UserId='" + UserId + "'and IsAdd is not null and len(IsAdd)>0"));
                return(JSONHelper.ToJson(ret));
            }
        }
示例#18
0
    protected void Page_Load(object sender, EventArgs e)
    {
        if (!Page.IsPostBack)
        {
            string psName = Request["psname"];
            startDate = Request["sDate"];
            endDate   = Request["eDate"];

            statisticType = Request["category"];
            RentInfoHelper helper = new RentInfoHelper();
            chartData = "[";
            switch (statisticType)
            {
            case "AllPoliceStation":
            case "AllPoliceHouse":

                if (policeStationName != "全部")
                {
                    policeStationName = psName;
                }
                mtitle     = "<b>房源全量统计</b>";
                stitle     = "所属警局:" + policeStationName + " <br />统计日期:" + startDate + " 至 " + endDate;
                yTitle     = "入住数量";
                serieTitle = "入住量";

                DataTable dt         = helper.GetStatisticData(statisticType, startDate, endDate, psName == "全部" ? "" : psName, LigerRM.Common.SysContext.CurrentUserID.ToString());
                decimal   totalCount = 0;
                foreach (DataRow row in dt.Rows)
                {
                    totalCount += decimal.Parse(row["RentRecordCount"].ToString());
                }

                Random ran      = new Random(1);
                int    rowIndex = ran.Next(0, dt.Rows.Count - 1);
                int    index    = 0;
                foreach (DataRow row in dt.Rows)
                {
                    //{
                    //    name: 'Chrome',
                    //    y: 12.8,
                    //    sliced: true,
                    //    selected: true
                    //},
                    if (rowIndex == index)
                    {
                        chartData += "{name:'" + row["PSName"].ToString() + "',y:" + ((decimal.Parse(row["RentRecordCount"].ToString()) / totalCount) * 100).ToString("f2") + ",sliced: true,selected: true},";
                    }
                    else
                    {
                        chartData += "['" + row["PSName"].ToString() + "'," + ((decimal.Parse(row["RentRecordCount"].ToString()) / totalCount) * 100).ToString("f2") + "],";
                    }
                    index++;
                }
                break;

            case "AllDistrict":

                if (policeStationName != "全部")
                {
                    DataTable dt1 = helper.GetDataTable("select * from Rent_PoliceStation where PSName='" + psName + "'");
                    if (dt1.Rows.Count > 0)
                    {
                        policeStationName = dt1.Rows[0]["co_corp_name"].ToString();
                    }
                }

                mtitle     = "<b>所属区域全量统计</b>";
                stitle     = "所属区域:" + policeStationName + " <br />统计日期:" + startDate + " 至 " + endDate;
                yTitle     = "入住数量";
                serieTitle = "入住量";

                DataTable dt2 = helper.GetStatisticData(statisticType, startDate, endDate, psName == "全部" ? "" : psName, LigerRM.Common.SysContext.CurrentUserID.ToString());
                foreach (DataRow row in dt2.Rows)
                {
                    chartData += "['" + row["rd_reg_dept_name"].ToString() + "'," + row["PackageCount"].ToString() + "],";
                }
                break;
                //case "AllPoliceHouse":
                //    if (policeStationName != "全部")
                //    {
                //        policeStationName = psName;
                //    }
                //    mtitle = "<b>所属警局全量统计</b>";
                //    stitle = "所属警局:" + policeStationName + " <br />统计日期:" + startDate + " 至 " + endDate;
                //    yTitle = "入住数量";
                //    serieTitle = "入住量";

                //    DataTable dt3 = helper.GetStatisticData(statisticType, startDate, endDate, psName == "全部" ? "" : psName);
                //    foreach (DataRow row in dt3.Rows)
                //    {
                //        chartData += "['" + row["PSName"].ToString() + "'," + row["RentRecordCount"].ToString() + "],";
                //    }
                //    break;
            }
            if (!string.IsNullOrEmpty(chartData))
            {
                chartData = chartData.Substring(0, chartData.Length - 1);
            }
            chartData = chartData + "]";
        }
    }
示例#19
0
    protected void InitialControls()
    {
        DataBindDistrict();
        DataBindPoliceStationParent();

        DataBindRoomType();

        if (string.IsNullOrEmpty(RentNo) && EditType == "E")
        {
            lblCreatedBy.Text     = SysContext.CurrentUserName;
            lblCreatedByName.Text = SysContext.CurrentRealName;
            lblCreatedDate.Text   = System.DateTime.Now.ToString("yyyy-MM-dd hh:mm:ss");

            CFUserInfo info = new CFUserInfo(SysContext.CurrentUserName);
            txtOwner.Text    = info.RealName;
            txtIDCard.Text   = info.IDCard;
            txtOwnerTel.Text = info.Phone;
        }
        else
        {
            ddlDistrict.Enabled = false;
            RentInfo rentInfo = new RentInfo(RentNo);
            ViewState["RentNo"] = RentNo;
            lblRentNo.Text      = RentNo;

            ddlDistrict.SelectedIndex = ddlDistrict.Items.IndexOf(ddlDistrict.Items.FindByValue(rentInfo.RDName));
            DataBindStreet();
            ddlStreet.SelectedIndex = ddlStreet.Items.IndexOf(ddlStreet.Items.FindByValue(rentInfo.RSName));
            DataBindRoad(string.Empty);
            ddlRoad.SelectedIndex = ddlRoad.Items.IndexOf(ddlRoad.Items.FindByValue(rentInfo.RRName));

            ddlPoliceStationParent.SelectedIndex = ddlPoliceStationParent.Items.IndexOf(ddlPoliceStationParent.Items.FindByValue(rentInfo.RPSParentName));

            DataBindPoliceStation();
            if (rentInfo.RPSID != null)
            {
                ddlPoliceStation.SelectedIndex = ddlPoliceStation.Items.IndexOf(ddlPoliceStation.Items.FindByValue(rentInfo.RPSID.ToString()));
            }
            else
            {
                ddlPoliceStation.SelectedIndex = -1;
            }

            ddlRoomType.SelectedIndex     = ddlRoomType.Items.IndexOf(ddlRoomType.Items.FindByValue(rentInfo.RRoomType));
            ddlDirection.SelectedIndex    = ddlDirection.Items.IndexOf(ddlDirection.Items.FindByValue(rentInfo.RDirection));
            ddlBuildingType.SelectedIndex = ddlBuildingType.Items.IndexOf(ddlBuildingType.Items.FindByValue(rentInfo.RBuildingType));
            ddlStructure.SelectedIndex    = ddlStructure.Items.IndexOf(ddlStructure.Items.FindByValue(rentInfo.RStructure));
            ddlProperty.SelectedIndex     = ddlProperty.Items.IndexOf(ddlProperty.Items.FindByValue(rentInfo.RProperty));

            ddlRentType.SelectedIndex = ddlRentType.Items.IndexOf(ddlRentType.Items.FindByValue(rentInfo.RentType));
            ddlOwnType.SelectedIndex  = ddlOwnType.Items.IndexOf(ddlOwnType.Items.FindByValue(rentInfo.OwnType));

            txtAddress.Text = rentInfo.RAddress;
            txtDoor.Text    = rentInfo.RDoor;
            if (rentInfo.RTotalDoor == 0)
            {
                txtTotalDoor.Text = string.Empty;
            }
            else
            {
                txtTotalDoor.Text = rentInfo.RTotalDoor.ToString();
            }
            txtFloor.Text = rentInfo.RFloor.ToString();
            if (rentInfo.RTotalFloor == 0)
            {
                txtTotalFloor.Text = string.Empty;
            }
            else
            {
                txtTotalFloor.Text = rentInfo.RTotalFloor.ToString();
            }
            txtHouseAge.Text      = rentInfo.RHouseAge.ToString();
            txtBuildRentArea.Text = rentInfo.RRentArea.ToString();
            txtOwner.Text         = rentInfo.ROwner;
            txtIDCard.Text        = rentInfo.RIDCard;
            txtOwnerTel.Text      = rentInfo.ROwnerTel;
            txtFee.Text           = rentInfo.RLocationDescription;
            lblCreatedBy.Text     = rentInfo.RCreatedBy;
            RentInfoHelper helper = new RentInfoHelper();
            DataTable      dtUser = helper.GetDataTable("select * from cf_user where loginName='" + lblCreatedBy.Text + "'");
            foreach (DataRow row in dtUser.Rows)
            {
                lblCreatedByName.Text = row["RealName"].ToString();
            }
            lblCreatedDate.Text = rentInfo.RCreatedDate.ToString("yyyy-MM-dd hh:mm:ss");
            txtLangitude.Text   = rentInfo.Longitude;
            txtLatitude.Text    = rentInfo.Latitude;

            if (EditType == "E")
            {
                btnSave.Visible = true;
            }
            else
            {
                btnSave.Visible = false;
            }
        }
    }
示例#20
0
    protected void btnSave_Click(object sender, EventArgs e)
    {
        RentInfoHelper rentInfoHelper = new RentInfoHelper();
        //if (rentInfoHelper.IsExistsSameAddressRent(ddlDistrict.Text,ddlStreet.Text,ddlRoad.Text,txtDoor.Text.Trim()))
        //{
        //    string detailAddress = ddlDistrict.Text + "-" + ddlStreet.Text + "-" + ddlRoad.Text + "-" + txtDoor.Text.Trim();
        //    ScriptManager.RegisterStartupScript(btnSave, GetType(), "warning", "javascript:$.ligerDialog.warn('相同的房源名称("+ detailAddress + ")已经存在,请重新填写!');", true);
        //}
        //else
        //{

        //if (string.IsNullOrEmpty(lblRentNo.Text))
        //{
        //    lblRentNo.Text = rentInfoHelper.GetRentNo(ddlDistrict.SelectedValue);
        //}

        RentInfo rentInfo = new RentInfo(lblRentNo.Text);

        rentInfo.RentNo               = lblRentNo.Text;
        rentInfo.RDName               = ddlDistrict.SelectedValue;
        rentInfo.RSName               = ddlStreet.SelectedValue;
        rentInfo.RRName               = ddlRoad.SelectedValue;
        rentInfo.RPSParentName        = ddlPoliceStationParent.SelectedValue;
        rentInfo.RPSName              = ddlPoliceStation.SelectedValue;
        rentInfo.RLocationDescription = txtFee.Text;
        //rentInfo.RPSID = Convert.ToInt32(ddlPoliceStation.SelectedValue);
        rentInfo.RPSID = ddlPoliceStation.SelectedValue;

        rentInfo.RAddress = txtAddress.Text.Trim();
        rentInfo.RDoor    = txtDoor.Text.Trim();

        if (!string.IsNullOrEmpty(txtTotalDoor.Text.Trim()))
        {
            rentInfo.RTotalDoor = Convert.ToInt16(txtTotalDoor.Text.Trim());
        }
        else
        {
            rentInfo.RTotalDoor = 0;
        }

        if (ddlRoomType.SelectedValue != "0")
        {
            rentInfo.RRoomType = ddlRoomType.SelectedItem.Value;
        }
        else
        {
            rentInfo.RRoomType = string.Empty;
        }
        if (ddlDirection.SelectedValue != "0")
        {
            rentInfo.RDirection = ddlDirection.SelectedItem.Value;
        }
        else
        {
            rentInfo.RDirection = string.Empty;
        }
        if (ddlStructure.SelectedValue != "0")
        {
            rentInfo.RStructure = ddlStructure.SelectedItem.Value;
        }
        else
        {
            rentInfo.RStructure = string.Empty;
        }
        if (ddlBuildingType.SelectedValue != "0")
        {
            rentInfo.RBuildingType = ddlBuildingType.SelectedItem.Value;
        }
        else
        {
            rentInfo.RBuildingType = string.Empty;
        }
        if (ddlProperty.SelectedValue != "0")
        {
            rentInfo.RProperty = ddlProperty.SelectedItem.Value;
        }
        else
        {
            rentInfo.RProperty = string.Empty;
        }

        rentInfo.RFloor = txtFloor.Text.Trim();
        if (!string.IsNullOrEmpty(txtTotalFloor.Text.Trim()))
        {
            rentInfo.RTotalFloor = Convert.ToInt16(txtTotalFloor.Text.Trim());
        }
        else
        {
            rentInfo.RTotalFloor = 0;
        }
        rentInfo.RentType  = ddlRentType.SelectedValue;
        rentInfo.OwnType   = ddlOwnType.SelectedValue;
        rentInfo.RHouseAge = Convert.ToInt16(txtHouseAge.Text.Trim());
        rentInfo.RRentArea = Convert.ToDecimal(txtBuildRentArea.Text.Trim());
        rentInfo.ROwner    = txtOwner.Text.Trim();
        rentInfo.ROwnerTel = txtOwnerTel.Text.Trim();
        rentInfo.RIDCard   = txtIDCard.Text.Trim();
        //rentInfo.RLocationDescription = txtLocationDescription.Text.Trim();

        rentInfo.RMapID = 0;

        if (string.IsNullOrEmpty(RentNo))
        {
            rentInfo.RCreatedBy   = SysContext.CurrentUserName;
            rentInfo.RCreatedDate = System.DateTime.Now;
        }
        else
        {
            rentInfo.RModifiedBy   = SysContext.CurrentUserName;
            rentInfo.RModifiedDate = System.DateTime.Now;
        }

        rentInfo.Longitude = txtLangitude.Text;
        rentInfo.Latitude  = txtLatitude.Text;

        rentInfoHelper.UpdateRent(rentInfo);
        Session["RentNo"] = null;
        ScriptManager.RegisterStartupScript(btnSave, GetType(), "warning", "javascript:SubmitDialog('" + rentInfo.RentNo + "');", true);
        //}
    }
示例#21
0
    public string GetHousesByCondition(int pageSize, int pageIndex, string housetype, string rentType, string address, string isAvalible, string userID, string startdate, string endate)
    {
        string where = "1=1 and isObsoleted=0 ";
        if (!string.IsNullOrEmpty(housetype))
        {
            where += " and RRoomType='" + housetype + "'";
        }
        if (!string.IsNullOrEmpty(rentType))
        {
            where += " and RRentType='" + rentType + "'";
        }
        if (!string.IsNullOrEmpty(address))
        {
            where += " and RAddress like '%" + address + "%'";
        }

        string    dateSql = "select distinct rentno from Rent_RentAttribute where (((rrastartdate BETWEEN '" + startdate + "' and '" + endate + "') or (rraenddate BETWEEN '" + startdate + "' and '" + endate + "')) or ((rrastartdate <'" + startdate + "' and rraenddate>'" + endate + "'))) and rrastatus in ('0','1','2','6')";
        DataTable dateDt  = MySQLHelper.ExecuteDataset(MySQLHelper.SqlConnString, MySQLHelper.CreateCommand(dateSql)).Tables[0];

        dateSql = string.Empty;
        foreach (DataRow row in dateDt.Rows)
        {
            dateSql += "'" + row["rentno"].ToString() + "',";
        }

        dateSql = " and rentno not in (" + dateSql + "'')";

        RentInfoHelper helper = new RentInfoHelper();

        if (!userID.Equals("1"))
        {
            string    tempStr = string.Empty;
            DataTable dt      = helper.GetDataTable("select * from dbo.Rent_user_dept_relationship where t_wu_user_id = (select userid from cf_user where loginname = '" + userID + "')");
            foreach (DataRow row in dt.Rows)
            {
                tempStr += row["t_ad_reg_dept_id"].ToString() + ",";
            }

            if (!string.IsNullOrEmpty(tempStr))
            {
                tempStr = tempStr.Substring(0, tempStr.Length - 1);
                where  += " and Region in (" + tempStr + ")";
            }
        }

        where += dateSql;

        System.Data.SqlClient.SqlDataReader r = helper.GetList(pageSize, pageIndex, "v_RentDetail_view", "RID", where, "*", "RCreatedDate", true);
        //return helper.GetJSONInfo(r);
        var list = new List <Hashtable>();

        list = JSONHelper.DbReaderToHash(r);
        //查询所有数据
        string sqlArray = string.Empty;

        for (int j = 0; j < list.Count; j++)
        {
            if (j == (list.Count - 1))
            {
                sqlArray += "'" + list[j]["RentNO"].ToString() + "'";
            }
            else
            {
                sqlArray += "'" + list[j]["RentNO"].ToString() + "',";
            }
        }
        var arrayKayObject = new Hashtable();  //配凑Key=>value

        if (!string.IsNullOrEmpty(sqlArray))
        {
            //根据地区的房屋id获取该地区评分的数据
            string  sqlEvaluation  = "SELECT  RentNO, sum(count)/count(*) as count FROM (SELECT RentNO, (EvaluateItem0+EvaluateItem1+EvaluateItem2)/3 as count FROM v_Rent_Evaluation_view WHERE EvaluateType = 1 and RentNO in(" + sqlArray + ")) as a GROUP BY a.RentNO ORDER BY count DESC";
            DataSet dataEvaluation = MySQLHelper.ExecuteDataset(MySQLHelper.SqlConnString, MySQLHelper.CreateCommand(sqlEvaluation));
            foreach (DataRow row in dataEvaluation.Tables[0].Rows)
            {
                var name  = row["RentNO"].ToString();
                var value = row["count"].ToString();
                arrayKayObject[name] = value;
            }
        }
        for (int k = 0; k < list.Count; k++)
        {
            string           rentNo      = list[k]["RentNO"].ToString();
            RentImageHelper  helperImage = new RentImageHelper();
            string           count       = string.Empty;
            List <Hashtable> images      = helperImage.GetRentImages(rentNo, out count);
            var item1 = new Hashtable();
            for (int q = 0; q < images.Count; q++)
            {
                list[k].Add("Image" + q, images[q]["ImagePath"].ToString());  //添加图片
            }
            //筛选key
            if (arrayKayObject.Contains(rentNo))
            {
                list[k].Add("Evaluate", arrayKayObject[rentNo]);   //添加评分
            }
        }
        return(JSONHelper.ToJson(list));
    }