using System; using System.Drawing; using System.Web.UI.WebControls; using SuperMap.RealEstate.CoreFrameWork; using SuperMap.RealEstate.Web.UI.WebControls; using SuperMap.RealEstate.HighWay.Storage.Business; using Business = SuperMap.RealEstate.SendRec.Storage.Business; namespace SuperMap.RealEstate.SendRec.Modules.PrintBill { public partial class Default : BasePage { protected override void OnLoadComplete(EventArgs e) { base.OnLoadComplete(e); } protected void Page_Load(object sender, EventArgs e) { if (IsPostBack) return; InitWebControls(); //初始化并加载列表 GridViewEx1.SelectingWithInit(ObjectDataSource1, GridPageEx1, DictionaryHelper.GetDictionary(Transaction, "APPLYPROINST_TYPE")); //工具条按钮事件 //GridViewEx1.SetOpenControl(ButtonNew); //设置回车焦点按钮 SetControlClientAction(ButtonSearch); if (!string.IsNullOrEmpty(Request["APPLYPROINST_CODE"])) { SERVERPART_ID.Visible = false; APPLYPROINST_TYPE.Visible = false; APPLYPROINST_STATE.Visible = false; } } private void InitWebControls() { APPLYPROINST_TYPE.Clear(); ListItemEx _ListItemEx = new ListItemEx(); _ListItemEx.Text = "全部业务"; _ListItemEx.Value = "1=1"; APPLYPROINST_TYPE.Items.Add(_ListItemEx); DictionaryHelper.BindingDropDownList("APPLYPROINST_TYPE", APPLYPROINST_TYPE.Items, this.Transaction); APPLYPROINST_TYPE.SelectedIndex = 1; SERVERPART_ID.Clear(); SERVERPART_ID.Items.Add(new ListItemEx() { Text = "全部", Value = "1=1" }); new SERVERPART(Transaction).BindingDropDownList(SERVERPART_ID.Items, "", PassportInfo.CityAuthority, false, 0, " AND STATISTICS_TYPE IN (1000,1001)"); SERVERPART_ID.SelectedValue = "1=1"; } //查询 protected void ButtonSearch_CallBackClick(object sender, ClientSetEventArgs e) { GridViewEx1.Selecting(ObjectDataSource1, GridPageEx1); //设置UI变化 e.SetValue(GridViewEx1); e.SetValue(GridPageEx1); } //翻页事件 protected void GridPageEx1_CallBackPageChanged(object src, ClientSetEventArgs e) { GridViewEx1.Pagging(ObjectDataSource1, GridPageEx1); //设置UI变化 e.SetValue(GridViewEx1); } //查询SQL设置 protected void GridViewEx1_SelectMethodParameters(object sender, SelectMethodParametersArgs e) { //搜索选项的搜索条件过滤 if (!string.IsNullOrEmpty(TextBox_Search.Text)) e.AddOrParams(GridViewSearch1, TextBox_Search.Text); //且搜索条件 e.AddAndParams("1", 1); if (string.IsNullOrEmpty(Request["APPLYPROINST_CODE"])) { //查询业务类型 if (APPLYPROINST_TYPE.SelectedIndex > -1 && APPLYPROINST_TYPE.SelectedValue != "1=1") { e.AddAndParams("APPLYPROINST_TYPE", APPLYPROINST_TYPE.SelectedValue); } //查询业务办理的服务区 if (SERVERPART_ID.SelectedValue != "" && SERVERPART_ID.SelectedValue != "1=1") { e.AddAndParams("SERVERPART_ID", SERVERPART_ID.SelectedValue); } else { e.SetOtherUserCustomWhereSqlString += (e.SetOtherUserCustomWhereSqlString == "" ? "" : " AND ") + "SERVERPART_ID IN (" + new SERVERPART(Transaction).GetPassportServerPartID(PassportInfo.CityAuthority) + ")"; } //查询业务流程状态 if (APPLYPROINST_STATE.SelectedValue == "0") { e.SetOtherUserCustomWhereSqlString += (e.SetOtherUserCustomWhereSqlString == "" ? "" : " AND ") + "((APPLYPROINST_STATE < 9000 AND APPLYPROINST_TYPE <> 1000) OR (APPLYPROINST_STATE < 5000 AND APPLYPROINST_TYPE = 1000))"; } else if (APPLYPROINST_STATE.SelectedValue == "1") { e.SetOtherUserCustomWhereSqlString += (e.SetOtherUserCustomWhereSqlString == "" ? "" : " AND ") + "(APPLYPROINST_STATE >= 9000 OR (APPLYPROINST_STATE >= 5000 AND APPLYPROINST_TYPE = 1000))"; } e.SetOtherUserCustomWhereSqlString += (e.SetOtherUserCustomWhereSqlString == "" ? "" : " AND ") + "APPLYPROINST_TYPE > 0"; } else { e.SetOtherUserCustomWhereSqlString += (e.SetOtherUserCustomWhereSqlString == "" ? "" : " AND ") + " APPLYPROINST_CODE IN ('" + Request["APPLYPROINST_CODE"].ToDecrypt() + "')"; } if (!string.IsNullOrEmpty(Request["SENDREC_TYPE"])) { e.SetOtherUserCustomWhereSqlString += (e.SetOtherUserCustomWhereSqlString == "" ? "" : " AND ") + " DEPARTMENT_ID = " + Request["SENDREC_TYPE"]; } else { e.SetOtherUserCustomWhereSqlString += (e.SetOtherUserCustomWhereSqlString == "" ? "" : " AND ") + "NVL(DEPARTMENT_ID,0) != 9990"; } //或搜索条件 //e.AddOrParams(字段名, 值); //排序 e.AddOrderByParams(GridViewOrderBy1); } #region 方法 -> 行绑定事件 protected void GridViewEx1_RowDataBound(object sender, GridViewRowEventArgs e) { if (e.Row.RowType == DataControlRowType.DataRow) { string _APPLYPROINST_ID = GridViewEx1.DataKeys[e.Row.RowIndex].Values["APPLYPROINST_ID"].ToString().ToEncrypt(); e.Row.Attributes["data-code"] = _APPLYPROINST_ID; e.Row.Attributes["ondblclick"] = "showDetail(this)"; e.Row.Attributes["itemtype"] = "datatype"; e.Row.ToolTip = "双击查看详情"; LinkButton ApprovedBill = (LinkButton)e.Row.FindControl("ApprovedBill"); LinkButton _LinkButton_More = e.Row.FindControl("LinkButton_More") as LinkButton; _LinkButton_More.OnClientClick = GridViewEx1.GetOpenPopDialogClientScript( "../SearchProinst/APPLYPROINSTPage.aspx?ID=" + _APPLYPROINST_ID + "&EditType=" + Request["EditType"]); if (e.Row.Cells[6].Text == "冲红业务") { e.Row.Cells[6].ForeColor = Color.Red; } SERVERPART _SERVERPART = new SERVERPART(this.Transaction); _SERVERPART.SERVERPART_ID_Encrypt = e.Row.Cells[e.Row.Cells.Count - 3].Text.ToEncrypt(); if (_SERVERPART.Select()) { e.Row.Cells[e.Row.Cells.Count - 3].Text = _SERVERPART.SERVERPART_NAME; } if (!string.IsNullOrEmpty(e.Row.Cells[e.Row.Cells.Count - 4].Text.Replace(" ", ""))) { FrameWork.Business.User _User = new FrameWork.Business.User(Transaction); _User.User_ID_Encrypt = e.Row.Cells[e.Row.Cells.Count - 4].Text.ToEncrypt(); if (_User.Select()) { e.Row.Cells[e.Row.Cells.Count - 4].Text = _User.User_Name; } } if (!string.IsNullOrEmpty(e.Row.Cells[8].Text.Replace(" ", ""))) { FrameWork.Business.User _User = new FrameWork.Business.User(Transaction); _User.User_ID_Encrypt = e.Row.Cells[8].Text.ToEncrypt(); if (_User.Select()) { e.Row.Cells[8].Text = _User.User_Name; } } #region 环节转化 if (!string.IsNullOrEmpty(Request["SENDREC_TYPE"])) { switch (e.Row.Cells[6].Text) { case "申购业务": case "区域采购": switch (e.Row.Cells[7].Text) { case "1000": e.Row.Cells[7].Text = "服务区申请"; if (e.Row.Cells[7].Text == "10") { e.Row.Cells[6].Text += "【补】"; } break; case "2000": e.Row.Cells[7].Text = "服务区审核"; break; case "3000": e.Row.Cells[7].Text = "片区审核"; break; case "4000": e.Row.Cells[7].Text = "部门审核"; break; case "5000": e.Row.Cells[7].Text = "部长审核"; break; case "5050": e.Row.Cells[7].Text = "分管领导审批"; break; default: e.Row.Cells[7].Text = "办结"; ApprovedBill.Visible = true; ApprovedBill.OnClientClick = GridViewEx1.GetOpenPopDialogClientScript( "Material/BillDefault.aspx?ID=" + _APPLYPROINST_ID, 1000, 600); break; } break; case "入库业务": switch (e.Row.Cells[7].Text) { case "10": e.Row.Cells[6].Text += "【补】"; e.Row.Cells[7].Text = "服务区申请"; break; case "1000": e.Row.Cells[7].Text = "服务区申请"; break; case "2000": e.Row.Cells[7].Text = "服务区审核"; break; case "3000": e.Row.Cells[7].Text = "片区审核"; break; default: if (e.Row.Cells[7].Text == "9090") { e.Row.Cells[6].Text += "【补】"; } e.Row.Cells[7].Text = "办结"; ApprovedBill.Visible = true; ApprovedBill.OnClientClick = GridViewEx1.GetOpenPopDialogClientScript( "Material/BillDefaultForRk.aspx?ID=" + _APPLYPROINST_ID, 1000, 600); break; } break; case "领料业务": case "区域配送": switch (e.Row.Cells[7].Text) { case "10": e.Row.Cells[6].Text += "【补】"; e.Row.Cells[7].Text = "服务区申请"; break; case "1000": e.Row.Cells[7].Text = "服务区申请"; if (e.Row.Cells[7].Text == "10") { e.Row.Cells[6].Text += "【补】"; } break; case "2000": e.Row.Cells[7].Text = "服务区审核"; break; default: if (e.Row.Cells[7].Text == "9090") { e.Row.Cells[6].Text += "【补】"; } e.Row.Cells[7].Text = "办结"; ApprovedBill.Visible = true; ApprovedBill.OnClientClick = GridViewEx1.GetOpenPopDialogClientScript( "Material/BillDefaultForLy.aspx?ID=" + _APPLYPROINST_ID, 1000, 600); break; } break; case "退货业务": case "冲红业务": switch (e.Row.Cells[7].Text) { case "1000": e.Row.Cells[7].Text = "退货填写"; break; default: e.Row.Cells[7].Text = "办结"; ApprovedBill.Visible = true; ApprovedBill.OnClientClick = GridViewEx1.GetOpenPopDialogClientScript( "Material/BillDefaultForTH.aspx?ID=" + _APPLYPROINST_ID, 1000, 600); break; } break; } } else { switch (e.Row.Cells[6].Text) { case "申购业务": case "区域采购": switch (e.Row.Cells[7].Text) { case "1000": e.Row.Cells[7].Text = "申请填写"; if (e.Row.Cells[7].Text == "10") { e.Row.Cells[6].Text += "【补】"; } break; case "2000": e.Row.Cells[7].Text = "部门负责人审核"; break; case "3000": e.Row.Cells[7].Text = "财务审核"; break; case "4000": e.Row.Cells[7].Text = "经理审批"; break; default: e.Row.Cells[7].Text = "办结"; ApprovedBill.Visible = true; ApprovedBill.OnClientClick = GridViewEx1.GetOpenPopDialogClientScript( "BillDefault.aspx?ID=" + _APPLYPROINST_ID, 1000, 600); break; } break; case "入库业务": switch (e.Row.Cells[7].Text) { case "10": e.Row.Cells[6].Text += "【补】"; e.Row.Cells[7].Text = "采购员填写"; break; case "1000": e.Row.Cells[7].Text = "采购员填写"; break; case "2000": e.Row.Cells[7].Text = "验收员审核"; break; case "3000": e.Row.Cells[7].Text = "仓管审核"; break; default: if (e.Row.Cells[7].Text == "9090") { e.Row.Cells[6].Text += "【补】"; } e.Row.Cells[7].Text = "办结"; ApprovedBill.Visible = true; ApprovedBill.OnClientClick = GridViewEx1.GetOpenPopDialogClientScript( "BillDefaultForRk.aspx?ID=" + _APPLYPROINST_ID, 1000, 600); break; } break; case "领料业务": case "区域配送": switch (e.Row.Cells[7].Text) { case "10": e.Row.Cells[6].Text += "【补】"; e.Row.Cells[7].Text = "领料填写"; break; case "1000": e.Row.Cells[7].Text = "领料填写"; if (e.Row.Cells[7].Text == "10") { e.Row.Cells[6].Text += "【补】"; } break; case "2000": e.Row.Cells[7].Text = "部门负责人审核"; break; case "3000": e.Row.Cells[7].Text = "仓管审核"; break; case "4000": e.Row.Cells[7].Text = "财务审核"; break; case "5000": e.Row.Cells[7].Text = "经理审批"; break; default: if (e.Row.Cells[7].Text == "9090") { e.Row.Cells[6].Text += "【补】"; } e.Row.Cells[7].Text = "办结"; ApprovedBill.Visible = true; ApprovedBill.OnClientClick = GridViewEx1.GetOpenPopDialogClientScript( "BillDefaultForLy.aspx?ID=" + _APPLYPROINST_ID, 1000, 600); break; } break; case "退货业务": case "冲红业务": switch (e.Row.Cells[7].Text) { case "1000": e.Row.Cells[7].Text = "退货填写"; break; default: e.Row.Cells[7].Text = "办结"; ApprovedBill.Visible = true; ApprovedBill.OnClientClick = GridViewEx1.GetOpenPopDialogClientScript( "BillDefaultForTH.aspx?ID=" + _APPLYPROINST_ID, 1000, 600); break; } break; } } //APPLYPROINST_TYPE APPLYPROINST_STATE 7 #endregion } } #endregion } }