/// <summary> /// 页面加载 /// </summary> /// <param name="sender"></param> /// <param name="e"></param> protected void Page_Load(object sender, EventArgs e) { AjaxPro.Utility.RegisterTypeForAjax(typeof(HouseRentForm), Page); if (!IsPostBack) { frmRoomID.Style.Add("width", "130px"); frmbID.Style.Add("width", "118px"); frmbuild_id.Style.Add("width", "113px"); frmbuild_room.Style.Add("width", "123px"); if (Request.QueryString["todo"] == "1") { frmBackUpDate.Text = DateTime.Now.ToString("yyyy-MM-dd"); frmEntrust_Date.Text = DateTime.Now.ToString("yyyy-MM-dd"); } if (Entity.HouseID > 0) { #region frmStateID.SelectedValue = Entity.StateID.Value.ToString(); if (Entity.aType == 1) { PriceFollowUp.Visible = false; } houseID = Entity.HouseID.ToString(); Prices.Text = Entity.Ohter2ID.ToString(); button_follow.Attributes.Add("onclick", "fbwshow(" + Entity.HouseID + "1)"); if (CheckRolePermission("修改", Entity.OwnerEmployeeID.ToDecimal())) { btnSaveRent.Append("<li><div class=\"buttonActive\"><div class=\"buttonContent\"><button onclick=\"return ClickButs('" + Entity.HouseID.ToString() + "')\" id=\"hf_Buttom\" type=\"button\">保存</button></div></div></li>"); frmMin_priceb.Attributes.Add("onfocus", "show_money('" + Entity.HouseID + "')"); } if (CheckRolePermission("查看实价")) { frmMin_priceb.Attributes.Add("onfocus", "show_money('" + Entity.HouseID + "')"); } BillCs = Entity.BillCode; if (Entity.OwnerEmployeeID > 0) { Employee em = Employee.FindByEmployeeID(Entity.OwnerEmployeeID); frmOperName.Text = "(" + em.Em_id + ")" + em.Em_name; } fexe_date.Text = Entity.Exe_date.ToString(); frmlandlord_tel2.ReadOnly = true; #endregion showAHouse.Attributes.Add("onclick", "ShowRemark('" + Entity.HouseID.ToString() + "');"); showAHouse.Attributes.Add("href", "House/HouseTelForm.aspx?HouseID=" + Entity.HouseID + "&doType=LookTel&NavTabId=" + NavTabId); showAHouse.Attributes.Add("target", "dialog"); showAHouse.Attributes.Add("rel", "TelLookHouseList" + Entity.HouseID.ToString()); showAHouse.Attributes.Add("title", Entity.Shi_id); htlA.HRef = "House/HouseTelForm.aspx?HouseID=" + Entity.HouseID + "&doType=LookTel&NavTabId=" + NavTabId; htlA.Target = "dialog"; htlA.Attributes.Add("onclick", "ShowRemark('" + Entity.HouseID.ToString() + "');"); htlA.Attributes.Add("rel", "TelLookHouseList" + Entity.HouseID.ToString()); htlA.Attributes.Add("title", Entity.Shi_id); if (Current.RoleNames.Contains("信息")) { btnDel.Attributes["style"] = "display:block"; btnDel.HRef += "?OperType=6&doAjax=true&LSH=1&NavTabId=" + NavTabId + "&HouseID=" + Entity.HouseID; } else { frmHouseDicName.ReadOnly = true; } //委托单号判断 if (!CheckRolePermission("修改委托单号", Entity.OwnerEmployeeID.ToDecimal())) { frmorderNum.ReadOnly = true; } } else { #region if (CheckRolePermission("添加")) { btnSaveRent.Append("<li id=\"AddBtnHouseFrom\"><div class=\"buttonActive\"><div class=\"buttonContent\"><button onclick=\"return ClickButs('" + Entity.HouseID.ToString() + "')\" id=\"hf_Buttom\" type=\"button\">保存</button></div></div></li>"); } else { frmHouseDicName.ReadOnly = true; } shi_ids = H_houseinfor.NewHouseCode(); frmshi_id.Text = shi_ids; frmOperName.Text = "(" + Employee.Current.Em_id + ")" + Employee.Current.Em_name; fexe_date.Text = DateTime.Now.ToString(); frmform_bedroom.SelectedIndex = 0; frmform_foreroom.SelectedIndex = 0; BillCs = Employee.Current.OrgCode; #endregion } string OperType = Request.QueryString["OperType"]; string P_LSH = Request.QueryString["LSH"]; string P_HouseID = Request.QueryString["HouseID"]; #region 除操作 if (OperType != null && P_LSH != null) { switch (OperType) { case "1": //删除图片/户型图 h_PicList model_h_PicList = h_PicList.FindByLsh(P_LSH.ToDecimal().Value); h_PicListDel model_h_PicListDel = new h_PicListDel(); model_h_PicListDel.ComID = model_h_PicList.ComID; model_h_PicListDel.EmployeeID = model_h_PicList.EmployeeID; model_h_PicListDel.Exe_date = model_h_PicList.exe_date; model_h_PicListDel.HouseID = model_h_PicList.HouseID; model_h_PicListDel.PicTypeID = model_h_PicList.PicTypeID; model_h_PicListDel.PicURL = model_h_PicList.PicURL; model_h_PicListDel.OrgID = model_h_PicList.OrgID; model_h_PicListDel.DelEmployeeID = Current.EmployeeID.ToInt32(); model_h_PicListDel.DelOrgID = Current.OrgID.ToInt32(); model_h_PicListDel.DelDate = DateTime.Now; model_h_PicListDel.Insert(); Log log = new Log(); log.Action = "删除"; log.Category = "删除房源照片"; log.IP = HttpContext.Current.Request.UserHostAddress; log.OccurTime = DateTime.Now; log.UserID = Convert.ToInt32(Employee.Current.EmployeeID); log.UserName = Employee.Current.Em_name; log.Remark = "房源ID=" + P_HouseID; log.Insert(); DbHelperSQL.ExecuteSql("delete from h_PicList where LSH= " + P_LSH); if (h_PicList.FindCount("HouseID", P_HouseID) <= 0) { H_houseinfor.Meta.Query("update H_houseinfor set HasImage=0 where HouseID=" + P_HouseID); } else { //判断当前人员上传的房源照片(不包括户型图)是否小于5张,如果小于,则需要删除该人员的照片积分 string sql = string.Format("SELECT count(1) FROM h_PicList Where PicTypeID>1 And EmployeeID=" + model_h_PicList.EmployeeID + " And HouseID={0}", P_HouseID); if (Convert.ToInt32(DbHelperSQL.GetSingle(sql)) < 5) { UpdateIntegral("删除房源照片", model_h_PicList.EmployeeID.ToInt32().Value, DateTime.Now, "H_houseinfor", "HouseID", P_HouseID); //判断是否有其他人员上传照片满5张,如果有,则增加照片积分 sql = "select * from h_PicList where EmployeeID<>" + model_h_PicList.EmployeeID + " and HouseID =" + P_HouseID + " and PicTypeID> 1 order by exe_date desc"; List <h_PicList> list_h_PicList = h_PicList.FindAll(sql); if (list_h_PicList.Count >= 5) { if (Entity != null && Entity.Renovation != "毛坯") { UpdateIntegral("上传5张房源照片(租)", list_h_PicList[0].EmployeeID.ToInt32().Value, DateTime.Now, "H_houseinfor", "HouseID", P_HouseID); } } } } StringBuilder sb = new StringBuilder(); sb.Append("<script>$(\"#div_" + P_LSH + "\").hide();alertMsg.correct(\"操作成功!\")</script>"); Response.Write(sb.ToString()); Response.End(); break; case "4": //删除录音 DbHelperSQL.ExecuteSql("update i_InternetPhone set recordUrlDel=0 where phoneID= " + P_LSH); Log l = new Log(); l.Action = "删除"; l.Category = "拨号录音"; l.OccurTime = DateTime.Now; l.Remark = "房源编号:" + Entity.Shi_id; l.Insert(); Response.Write("<script>alertMsg.correct(\"操作成功!\")</script>"); Response.End(); break; case "6": //删除全部照片 List <h_PicList> list_h_PicList_All = h_PicList.FindAllByHouseID(P_HouseID.ToDecimal().Value); foreach (h_PicList item in list_h_PicList_All) { h_PicListDel list_h_PicListDel = new h_PicListDel(); list_h_PicListDel.ComID = item.ComID; list_h_PicListDel.EmployeeID = item.EmployeeID; list_h_PicListDel.Exe_date = item.exe_date; list_h_PicListDel.HouseID = item.HouseID; list_h_PicListDel.PicTypeID = item.PicTypeID; list_h_PicListDel.PicURL = item.PicURL; list_h_PicListDel.OrgID = item.OrgID; list_h_PicListDel.DelEmployeeID = Current.EmployeeID.ToInt32(); list_h_PicListDel.DelOrgID = Current.OrgID.ToInt32(); list_h_PicListDel.DelDate = DateTime.Now; list_h_PicListDel.Insert(); } DbHelperSQL.ExecuteSql("delete from h_PicList where HouseID= " + P_HouseID); H_houseinfor.Update("HasImage=0", "HouseID=" + P_HouseID); Log log1 = new Log(); log1.Action = "删除"; log1.Category = "删除房源照片"; log1.IP = HttpContext.Current.Request.UserHostAddress; log1.OccurTime = DateTime.Now; log1.UserID = Convert.ToInt32(Employee.Current.EmployeeID); log1.UserName = Employee.Current.Em_name; log1.Remark = "房源ID=" + P_HouseID; log1.Insert(); StringBuilder sb1 = new StringBuilder(); sb1.Append("<script>$(\"#div_" + P_LSH + "\").hide();alertMsg.correct(\"操作成功!\")</script>"); Response.Write(sb1.ToString()); Response.End(); break; default: break; } } #endregion DataBinds(); if (frmBackUpDate.Text != "") { frmBackUpDate.Text = Convert.ToDateTime(frmBackUpDate.Text).ToString("yyyy-MM-dd"); } if (frmEntrust_Date.Text != "") { frmEntrust_Date.Text = Convert.ToDateTime(frmEntrust_Date.Text).ToString("yyyy-MM-dd"); } } }
protected void Page_Load(object sender, EventArgs e) { if (!IsPostBack) { myffrmwc.Items.Clear(); myffrmwc.Items.Add(new ListItem("全部", "2")); myffrmwc.Items.Add(new ListItem("未完成", "0")); myffrmwc.Items.Add(new ListItem("已完成", "1")); string temp = GetMySearchControlValue("wc"); if (!temp.IsNullOrWhiteSpace()) { myffrmwc.SelectedValue = temp; } else { myffrmwc.SelectedIndex = 1; } myffrmlq.Items.Clear(); myffrmlq.Items.Add(new ListItem("全部", "")); myffrmlq.Items.Add(new ListItem("未领取", "0")); myffrmlq.Items.Add(new ListItem("已领取", "1")); myffrmsh.Items.Clear(); myffrmsh.Items.Add(new ListItem("全部", "")); myffrmsh.Items.Add(new ListItem("未审核", "0")); myffrmsh.Items.Add(new ListItem("已审核", "1")); FullDropListData(typeof(h_EntrustType), this.myffrmEntrustTypeID, "Name", "EntrustTypeID", ""); } if (CheckRolePermission("修改")) { z_bottom = "<li><a class=\"iconL\" href=\"House/HousePicListYY.aspx?Type=0&doType=lq&NavTabId=" + NavTabId + "&selectPage=" + (gv.PageIndex + 1).ToString() + "&doAjax=true\" rel=\"ids\" target=\"selectedTodo\" title=\"确定要操作吗?\"><span>领取</span></a></li>"; z_bottom += "<li><a class=\"iconL\" href=\"House/HousePicListYY.aspx?Type=0&doType=qxlq&NavTabId=" + NavTabId + "&selectPage=" + (gv.PageIndex + 1).ToString() + "&doAjax=true\" rel=\"ids\" target=\"selectedTodo\" title=\"确定要操作吗?\"><span>取消领取</span></a></li>"; z_bottom += "<li><a class=\"iconL\" href=\"House/HousePicListYY.aspx?Type=0&doType=wc&NavTabId=" + NavTabId + "&selectPage=" + (gv.PageIndex + 1).ToString() + "&doAjax=true\" rel=\"ids\" target=\"selectedTodo\" title=\"确定要操作吗?\"><span>完成</span></a></li>"; z_bottom += "<li><a class=\"delete\" href=\"House/HousePicListYY.aspx?doType=del&NavTabId=" + NavTabId + "&selectPage=" + (gv.PageIndex + 1).ToString() + "&doAjax=true\" rel=\"ids\" target=\"selectedTodo\" title=\"确定要删除吗?\"><span>删除照片</span></a></li>"; z_bottom += "<li><a class=\"edit\" href=\"House/HouseRemarkAdd.aspx?NavTabId=" + NavTabId + "&doAjax=true&ID={ID}\" rel='Bargain1' width=\"360\" height=\"230\" target=\"dialog\" mask=\"true\"><span>增加备注</span></a></li>"; } if (CheckRolePermission("删除")) { z_bottom += "<li><a class=\"iconL\" href=\"House/HousePicListYY.aspx?doType=sh&NavTabId=" + NavTabId + "&selectPage=" + (gv.PageIndex + 1).ToString() + "&doAjax=true\" rel=\"ids\" target=\"selectedTodo\"><span>审核</span></a></li>"; } if (CheckRolePermission("驳回")) { z_bottom += "<li><a class=\"iconL\" href=\"House/HousePicListYY.aspx?doType=bh&NavTabId=" + NavTabId + "&selectPage=" + (gv.PageIndex + 1).ToString() + "&doAjax=true\" rel=\"ids\" target=\"selectedTodo\" title=\"确定要驳回吗?\"><span>驳回</span></a></li>"; } #region 执行操作 if (Request.QueryString["doType"] != null) { //领取 if (Request.QueryString["doType"].ToString() == "lq") { if (!string.IsNullOrEmpty(Request["ids"])) { string sql = string.Format("select * from h_PicList_YY where ID in({0})", Request["ids"]); List <h_PicList_YY> list_h_PicList_YY = h_PicList_YY.FindAll(sql); foreach (h_PicList_YY hfa in list_h_PicList_YY) { //摄影师以提示已经领取任务 if (hfa.Photographer != null) { Response.Write("<script>alertMsg.error(\"任务已被领取,不可在领!\")</script>"); Response.End(); } else { hfa.Photographer = int.Parse(Current.EmployeeID.ToString()); hfa.PotoOrg = int.Parse(Current.OrgID.ToString()); hfa.Update(); } } } } //取消领取 else if (Request.QueryString["doType"].ToString() == "qxlq") { if (!string.IsNullOrEmpty(Request["ids"])) { string sql = string.Format("select * from h_PicList_YY where ID in({0})", Request["ids"]); List <h_PicList_YY> list_h_PicList_YY = h_PicList_YY.FindAll(sql); foreach (h_PicList_YY hfa in list_h_PicList_YY) { hfa.Photographer = null; hfa.PotoOrg = null; hfa.Update(); } } } //完成 else if (Request.QueryString["doType"].ToString() == "wc") { if (!string.IsNullOrEmpty(Request["ids"])) { string sql = string.Format("select * from h_PicList_YY where ID in({0})", Request["ids"]); List <h_PicList_YY> list_h_PicList_YY = h_PicList_YY.FindAll(sql); foreach (h_PicList_YY hfa in list_h_PicList_YY) { //完成时间更新 hfa.Finishtime = DateTime.Now; hfa.Update(); } } } else if (Request.QueryString["doType"].ToString() == "del") { if (!string.IsNullOrEmpty(Request["ids"])) { string sql = string.Format("select * from h_PicList_YY where ID in({0})", Request["ids"]); List <h_PicList_YY> list_h_PicList_YY = h_PicList_YY.FindAll(sql); h_PicList hp; string HouseID; foreach (h_PicList_YY hfa in list_h_PicList_YY) { HouseID = hfa.HouseID.ToString(); //删除全部照片 List <h_PicList> list_h_PicList = h_PicList.FindAllByHouseID(HouseID.ToDecimal().Value); foreach (h_PicList item in list_h_PicList) { h_PicListDel list_h_PicListDel = new h_PicListDel(); list_h_PicListDel.ComID = item.ComID; list_h_PicListDel.EmployeeID = item.EmployeeID; list_h_PicListDel.Exe_date = item.exe_date; list_h_PicListDel.HouseID = item.HouseID; list_h_PicListDel.PicTypeID = item.PicTypeID; list_h_PicListDel.PicURL = item.PicURL; list_h_PicListDel.OrgID = item.OrgID; list_h_PicListDel.DelEmployeeID = Current.EmployeeID.ToInt32(); list_h_PicListDel.DelOrgID = Current.OrgID.ToInt32(); list_h_PicListDel.DelDate = DateTime.Now; list_h_PicListDel.Insert(); } DbHelperSQL.ExecuteSql("delete from h_PicList where PicTypeID!=9 and HouseID= " + HouseID); H_houseinfor.Update("HasImage=0", "HouseID=" + HouseID); Log log1 = new Log(); log1.Action = "删除"; log1.Category = "删除房源照片"; log1.IP = HttpContext.Current.Request.UserHostAddress; log1.OccurTime = DateTime.Now; log1.UserID = Convert.ToInt32(Employee.Current.EmployeeID); log1.UserName = Employee.Current.Em_name; log1.Remark = "房源ID=" + HouseID; log1.Insert(); } StringBuilder sb1 = new StringBuilder(); sb1.Append("<script>alertMsg.correct(\"操作成功!\")</script>"); Response.Write(sb1.ToString()); Response.End(); } } //驳回 else if (Request.QueryString["doType"].ToString() == "bh") { if (!string.IsNullOrEmpty(Request["ids"])) { string sql = string.Format("select * from h_PicList_YY where ID in({0})", Request["ids"]); List <h_PicList_YY> list_h_PicList_YY = h_PicList_YY.FindAll(sql); foreach (h_PicList_YY hfa in list_h_PicList_YY) { hfa.Delete(); } } } //审核 else if (Request.QueryString["doType"].ToString() == "sh") { if (!string.IsNullOrEmpty(Request["ids"])) { string sql = string.Format("select * from h_PicList_YY where ID in({0})", Request["ids"]); List <h_PicList_YY> list_h_PicList_YY = h_PicList_YY.FindAll(sql); foreach (h_PicList_YY hfa in list_h_PicList_YY) { if (hfa.IsCheck == 1) { hfa.IsCheck = 0; } else { hfa.IsCheck = 1; } hfa.Update(); } } } #region 刷新当前页[抓取当页导航数字onclick事件] string JavaScript = " dwzPageBreak({ targetType: \"navTab\", rel: \"\", data: { pageNum: " + Request["selectPage"] + "} });"; JSDo_UserCallBack_Success(JavaScript, "操作成功"); #endregion 刷新当前页[抓取当页导航数字onclick事件] } #endregion }
/// <summary> /// 表单提交前执行 /// </summary> /// <param name="sender"></param> /// <param name="e"></param> protected override void OnSaving(object sender, EntityFormEventArgs e) { //base.OnSaving(sender, e); if (Request.Form["Key"] != null) { HouseID = Request["Key"]; Entity.HouseID = Convert.ToDecimal(HouseID); Entity.EmployeeID = Employee.Current.EmployeeID; Entity.FollowUpText = "此房源照片及描述被信息部驳回,原因为:" + frmRemark.Text; Entity.exe_Date = DateTime.Now; //删除全部照片 List <h_PicList> list_h_PicList = h_PicList.FindAllByHouseID(HouseID.ToDecimal().Value); foreach (h_PicList item in list_h_PicList) { h_PicListDel list_h_PicListDel = new h_PicListDel(); list_h_PicListDel.ComID = item.ComID; list_h_PicListDel.EmployeeID = item.EmployeeID; list_h_PicListDel.Exe_date = item.exe_date; list_h_PicListDel.HouseID = item.HouseID; list_h_PicListDel.PicTypeID = item.PicTypeID; list_h_PicListDel.PicURL = item.PicURL; list_h_PicListDel.OrgID = item.OrgID; list_h_PicListDel.DelEmployeeID = Current.EmployeeID.ToInt32(); list_h_PicListDel.DelOrgID = Current.OrgID.ToInt32(); list_h_PicListDel.DelDate = DateTime.Now; list_h_PicListDel.Insert(); } DbHelperSQL.ExecuteSql("delete from h_PicList where HouseID= " + HouseID); H_houseinfor hh = H_houseinfor.FindByHouseID(Convert.ToDecimal(HouseID)); hh.HasImage = false; hh.IsSh = null; hh.LinkTel1 = null; hh.SeeHouseID = null; hh.NowStateID = null; hh.TaxesID = null; hh.AssortID = null; hh.SaleMotiveID = null; hh.ApplianceID = null; hh.PayServantID = null; hh.Update(); Log log1 = new Log(); log1.Action = "删除"; log1.Category = "删除房源照片"; log1.IP = HttpContext.Current.Request.UserHostAddress; log1.OccurTime = DateTime.Now; log1.UserID = Convert.ToInt32(Employee.Current.EmployeeID); log1.UserName = Employee.Current.Em_name; log1.Remark = "房源ID=" + HouseID; log1.Insert(); try { h_FollowUp.Meta.BeginTrans(); Entity.Insert(); H_houseinfor.Meta.Execute("update h_houseinfor set IsBh=1 where HouseID=" + Entity.HouseID.ToString()); h_FollowUp.Meta.Commit(); } catch { h_FollowUp.Meta.Rollback(); Response.Write(error()); e.Cancel = true; return; } } }