/// <summary> /// 修改绑定 /// </summary> public void Bind() { string ContID = Request.QueryString["cid"]; if (!string.IsNullOrWhiteSpace(ContID)) { Hi.Model.YZT_Contract contractModel = new Hi.BLL.YZT_Contract().GetModel(Convert.ToInt32(ContID)); if (contractModel != null) { Hi.Model.BD_Company comp = new Hi.BLL.BD_Company().GetModel(Convert.ToInt32(contractModel.CompID)); if (comp != null) { this.txtCompName.Value = comp.CompName; this.contractCompId = comp.ID; if (this.CompID <= 0) { this.hidCompId.Value = comp.ID.ToString(); } } this.txtcontractNO.Value = contractModel.contractNO; this.txtcontractDate.Value = contractModel.contractDate.ToString("yyyy-MM-dd"); this.txtForceDate.Value = contractModel.ForceDate.ToString("yyyy-MM-dd"); this.txtInvalidDate.Value = contractModel.InvalidDate.ToString("yyyy-MM-dd"); this.txtRemark.Value = contractModel.Remark; this.txtState.Value = contractModel.CState.ToString() == "1" ? "启用" : "停用"; } DataTable dt = new Hi.BLL.YZT_ContractDetail().getDataTable(ContID); if (dt.Rows.Count > 0) { this.RepContractDetail.DataSource = dt; this.RepContractDetail.DataBind(); } } }
/// <summary> /// 修改绑定 /// </summary> public void Bind() { string ContID = Request.QueryString["cid"]; if (!string.IsNullOrWhiteSpace(ContID)) { Hi.Model.YZT_Contract contractModel = new Hi.BLL.YZT_Contract().GetModel(Convert.ToInt32(ContID)); if (contractModel != null) { this.txtcontractNO.Value = contractModel.contractNO; this.txtcontractDate.Value = contractModel.contractDate.ToString("yyyy-MM-dd"); this.txtForceDate.Value = contractModel.ForceDate.ToString("yyyy-MM-dd"); this.txtInvalidDate.Value = contractModel.InvalidDate.ToString("yyyy-MM-dd"); this.txtRemark.Value = contractModel.Remark; this.DropDis.SelectedValue = contractModel.DisID.ToString(); this.CState.Value = contractModel.CState.ToString(); } DataTable dt = new Hi.BLL.YZT_ContractDetail().getDataTable(ContID); if (dt.Rows.Count > 0) { this.RepContractDetail.DataSource = dt; this.RepContractDetail.DataBind(); } } }
/// <summary> /// 修改绑定 /// </summary> /// <param name="type">入库or出库</param> /// <param name="no">单据ID</param> public void Bind() { string ContID = Request.QueryString["cid"]; this.Cid.Value = Request.QueryString["cid"]; if (!string.IsNullOrWhiteSpace(ContID)) { Hi.Model.YZT_Contract contractModel = new Hi.BLL.YZT_Contract().GetModel(Convert.ToInt32(ContID)); if (contractModel != null) { this.txtcontractNO.Value = contractModel.contractNO; this.txtcontractDate.Value = contractModel.contractDate.ToString("yyyy-MM-dd"); this.txtForceDate.Value = contractModel.ForceDate.ToString("yyyy-MM-dd"); this.txtInvalidDate.Value = contractModel.InvalidDate.ToString("yyyy-MM-dd"); this.txtRemark.Value = contractModel.Remark; this.DropDis.SelectedValue = contractModel.DisID.ToString(); this.CState.Value = contractModel.CState.ToString(); } DataTable dt = new Hi.BLL.YZT_ContractDetail().getDataTable(ContID); if (dt.Rows.Count > 0) { tbodyTR.Visible = false; this.RepContractDetail.DataSource = dt; this.RepContractDetail.DataBind(); } List <Hi.Model.YZT_Annex> AnnexDelList = new Hi.BLL.YZT_Annex().GetList("", " dr=0 and fcID=" + ContID + " and fileAlias=3", ""); if (AnnexDelList.Count > 0) { string fileName = ""; foreach (Hi.Model.YZT_Annex item in AnnexDelList) { fileName += item.fileName + ","; } HidFfileName.Value = fileName; } } }