Example #1
0
        public string GetDDLArea(string SanjakID)
        {
            StringBuilder sb = new StringBuilder();

            s_Sanjak model_s_Sanjak = s_Sanjak.FindBySanjakID(Convert.ToDecimal(SanjakID));

            if (model_s_Sanjak != null)
            {
                s_Area model_s_Area = s_Area.FindByAreaID(model_s_Sanjak.AreaID);
                if (model_s_Area != null)
                {
                    sb.Append("<option value=\"" + model_s_Area.AreaID + "\">" + model_s_Area.Name + "</option>");
                }
                else
                {
                    sb.Append("<option value=\"0\">无数据</option>");
                }
            }
            else
            {
                sb.Append("<option value=\"0\">无数据</option>");
            }

            return(sb.ToString());
        }
Example #2
0
        /// <summary>
        /// 表单数据赋值前
        /// </summary>
        /// <param name="sender"></param>
        /// <param name="e"></param>
        protected override void OnSetForm(object sender, EntityFormEventArgs e)
        {
            base.OnSetForm(sender, e);
            if (!IsPostBack)
            {
                string s_LinkTel1 = "(1)所有房间的朝向 (2)房内设施情况 (3)装修保养情况 (4)目前是否有人居住";
                string s_note     = "是否有车位、什么时候可腾房等";
                string s_Remarks  = "钥匙是否在外中介或其他地方的位置";

                if (Entity.LinkTel1.IsNullOrWhiteSpace())
                {
                    frmLinkTel1.ForeColor = System.Drawing.Color.Gray;
                    frmLinkTel1.Text      = s_LinkTel1;
                }
                if (Entity.Note.IsNullOrWhiteSpace())
                {
                    frmnote.ForeColor = System.Drawing.Color.Gray;
                    frmnote.Text      = s_note;
                }
                if (Entity.Remarks.IsNullOrWhiteSpace())
                {
                    frmRemarks.ForeColor = System.Drawing.Color.Gray;
                    frmRemarks.Text      = s_Remarks;
                }

                frmLinkTel1.Attributes.Add("onfocus", "if(this.value=='" + s_LinkTel1 + "')this.value='';this.style.color='#000'");
                frmnote.Attributes.Add("onfocus", "if(this.value=='" + s_note + "')this.value='';this.style.color='#000'");
                frmRemarks.Attributes.Add("onfocus", "if(this.value=='" + s_Remarks + "')this.value='';this.style.color='#000'");

                frmLinkTel1.Attributes.Add("onblur", " this.style.color='#000';if(this.value==''){this.value='" + s_LinkTel1 + "';this.style.color='#999'}");
                frmnote.Attributes.Add("onblur", "this.style.color='#000';if(this.value==''){this.value='" + s_note + "';this.style.color='#999'}");
                frmRemarks.Attributes.Add("onblur", "this.style.color='#000';if(this.value==''){this.value='" + s_Remarks + "';this.style.color='#999'}");

                frmbID.Attributes.Add("onchange", "GetUnitItems_Rent(" + Entity.HouseID + ");");
                //this.frmUnitID.Attributes.Add("onchange", "GetRoomItems_Rent(" + Entity.HouseID + ");");
                frmRoomID.Attributes.Add("onchange", "GetDoorItems_Rent(" + Entity.HouseID + ");");
                //this.frmBuild_area.Attributes.Add("onblur", "GetPrices('" + Entity.HouseID + "')");
                //this.frmSum_price.Attributes.Add("onblur", "GetPrices('" + Entity.HouseID + "')");
                PriceFollowUp.Attributes.Add("href", "House/FollowUpPriceEditor.aspx?NavTabId=" + NavTabId + "&doAjax=true&HouseID=" + Entity.HouseID);
                PriceFollowUp.Attributes.Add("title", "增加压价跟进");
                if (Entity.HouseID > 0)
                {
                    //委托单号
                    orderNum_old.Value = Entity.orderNum.ToString();

                    //跟进
                    ligjRent.Visible = true;
                    if (Current.RoleNames.Contains("信息"))
                    {
                        //积分
                        lijf.Visible = true;
                    }

                    if (!Current.RoleNames.Contains("超级") && !Current.RoleNames.Contains("信息"))
                    {
                        //栋号不能修改
                        frmbID.Enabled = false;
                        frmbuild_id.Attributes.Add("ReadOnly", "true");
                        //室号不能修改
                        frmRoomID.Enabled = false;
                        frmbuild_room.Attributes.Add("ReadOnly", "true");
                    }

                    if (Entity.HouseDicType == "1")
                    {
                        frmbuild_room.CssClass = "Hinput frmbuild_room";
                        if (Entity.Bid.HasValue && Entity.Bid.Value > 0 && Entity.RoomID.HasValue && Entity.RoomID.Value > 0)
                        {
                            List <s_Seat> seatList = s_Seat.FindAll(string.Format(@"select SeatID,SeatName
                                                                                from s_Seat
                                                                                where HouseDicID={0}", Entity.HouseDicID));

                            frmbID.DataSource     = seatList;
                            frmbID.DataTextField  = "SeatName";
                            frmbID.DataValueField = "SeatID";
                            frmbID.DataBind();
                            frmbID.SelectedValue = Entity.Bid.Value.ToString();
                            frmbuild_id.Text     = frmbID.SelectedItem.Text;

                            List <s_Door> doorList = s_Door.FindAll(string.Format(@"select DoorID,DoorNam
                                                                                    from s_Door
                                                                                    where SeatID={0}
                                                                                    and DoorID not in(select RoomID
                                                                                                        from h_houseinfor
                                                                                                        where bID={0}
                                                                                                        and RoomID<>{1}
                                                                                                        and aType=0
                                                                                                        and DelType=0
                                                                                                        and RoomID>0)
                                                                                    order by DoorNam",
                                                                                  Entity.Bid.Value,
                                                                                  Entity.RoomID.Value));

                            frmRoomID.DataSource     = doorList;
                            frmRoomID.DataTextField  = "DoorNam";
                            frmRoomID.DataValueField = "DoorID";
                            frmRoomID.DataBind();
                            frmRoomID.SelectedValue = Entity.RoomID.Value.ToString();
                            frmbuild_room.Text      = frmRoomID.SelectedItem.Text;
                        }
                    }

                    frmlandlord_tel2.Text = "点击查看隐藏信息!";

                    #region 暂时无用 2017-07-14 10:32:15
                    //if (Entity.Bid.HasValue && Entity.Bid > 0)
                    //{
                    //    //var list_s_Seat = s_Seat.Find(string.Format("HouseDicID={0} and SeatID={1}", Entity.HouseDicID, Entity.Bid));
                    //    //frmbID.DataSource = list_s_Seat;
                    //    //frmbID.DataTextField = "SeatName";
                    //    //frmbID.DataValueField = "SeatID";
                    //    //frmbID.DataBind();
                    //    //this.frmUnitID.DataSource = s_Unit.FindAll("SeatID", Entity.Bid);
                    //    //this.frmUnitID.DataTextField = "UnitNam";
                    //    //this.frmUnitID.DataValueField = "UnitID";
                    //    //this.frmUnitID.DataBind();
                    //    //foreach (ListItem li in frmUnitID.Items)
                    //    //{
                    //    //    if (li.Text == Entity.Build_unit)
                    //    //        li.Selected = true;
                    //    //}
                    //}
                    //else
                    //{
                    //    frmbID.Items.Add(new ListItem(Entity.Build_id, "0"));
                    //    //this.frmUnitID.Items.Add(new ListItem(Entity.Build_unit, "0"));
                    //}

                    //if (Entity.UnitID.HasValue && Entity.UnitID > 0)
                    //{
                    //    //List<s_Door> list_s_Door = s_Door.FindAll("UnitID", Entity.UnitID);
                    //    //list_s_Door.OrderBy(x => x.DoorNam);
                    //    //this.frmRoomID.DataSource = list_s_Door;
                    //    //this.frmRoomID.DataTextField = "DoorNam";
                    //    //this.frmRoomID.DataValueField = "DoorID";
                    //    //this.frmRoomID.DataBind();
                    //    //foreach (ListItem li in frmRoomID.Items)
                    //    //{
                    //    //    if (li.Text == Entity.Build_room)
                    //    //        li.Selected = true;
                    //    //}
                    //}
                    //else
                    //    frmRoomID.Items.Add(new ListItem(Entity.Build_room, "0"));
                    #endregion
                }

                if (!CheckRolePermission("不隐号"))
                {
                    //frmNotarizationNum.Text = "***";
                    if (Entity.IsBeiAn.HasValue && Entity.IsBeiAn.Value)
                    {
                        frmbuild_id.Text = "***";
                        //frmbuild_unit.Text = "***";
                        frmbuild_room.Text = "***";
                        this.frmbID.Items.Add(new ListItem("", "***"));
                        //this.frmUnitID.Items.Add(new ListItem("", "***"));
                        frmRoomID.Items.Add(new ListItem("", "***"));
                    }
                }

                //如果没有权限,则委托方式不能修改
                if (!CheckRolePermission("修改委托"))
                {
                    if (Entity.EntrustTypeID.HasValue)
                    {
                        frmEntrustTypeID.SelectedValue = Entity.EntrustTypeID.Value.ToString();
                        ListItem li = frmEntrustTypeID.SelectedItem;
                        frmEntrustTypeID.Items.Clear();
                        frmEntrustTypeID.Items.Add(li);
                    }
                    else
                    {
                        frmEntrustTypeID.Items.Clear();
                        frmEntrustTypeID.Items.Insert(0, new ListItem("一般委托", "1"));
                    }
                }

                frmRemarks.Text    = "***";
                frmMin_priceb.Text = "***";

                if (Entity.SanjakID > 0)
                {
                    s_Sanjak model_s_Sanjak = s_Sanjak.FindBySanjakID(Entity.SanjakID);
                    if (model_s_Sanjak != null)
                    {
                        ddlSanjakID.Items.Add(new ListItem(model_s_Sanjak.Name, model_s_Sanjak.SanjakID.ToString()));

                        s_Area model_s_Area = s_Area.FindByAreaID(model_s_Sanjak.AreaID);

                        if (model_s_Area != null)
                        {
                            ddlArea.Items.Add(new ListItem(model_s_Area.Name, model_s_Area.AreaID.ToString()));
                        }
                    }
                }
            }
        }