/// <summary> /// 选择数据 /// </summary> protected void refresh() { DataView dv = new CawInfoAgentGoods().Select(ViewState["AgentInfoGuid"].ToString()); GridView1.DataSource = dv; GridView1.DataBind(); //调用一个js函数,用于强制执行datagrid的颜色变换。如不用,因updatapanel中数据更新后将无法引起datagridcolor.js的执行 CallJsFun("ChangeColor();"); }
/// <summary> /// 绑定表单 /// </summary> /// <param name="Guid"></param> /// <returns></returns> private void InitiData(string Guid) { //获取明细 Detail_CAW_AGENTSHIPINFO DCASI = AgentShipDB.GetDetail(Guid); lblStatus.Text = DCASI.DATASTATUS_NAME; this.txtShipNameCN.Text = DCASI.SHIPNAMECN; this.txtSHIPNAMEEN.Text = DCASI.SHIPNAMEEN; this.txtCALLLETTER.Text = DCASI.CALLLETTER; this.txtOWNER.Text = DCASI.OWNER; this.ntbYearNum.Text = DCASI.BUILDDATE.ToString(); this.txtNationality.Text = DCASI.NATIONNALITY; this.ddlShipType.SelectedValue = DCASI.SHIPTYPE.ToString(); this.ntbShipHoist.Text = DCASI.SHIPHOIST.ToString(); this.ntbShipHold.Text = DCASI.SHIPHOLD.ToString(); this.ntxtTOTALTON.Text = DCASI.TOTALTON.ToString(); this.ntxtNETTON.Text = DCASI.NETTON.ToString(); this.ntxtLOADTON.Text = DCASI.LOADTON.ToString(); this.ntxtSHIPLENGTH.Text = DCASI.SHIPLENGTH.ToString(); this.ntxtSHIPWIDTH.Text = DCASI.SHIPWIDTH.ToString(); this.ntxtLENGTH.Text = DCASI.LENGTH.ToString(); this.ntxtHEIGHT.Text = DCASI.HEIGHT.ToString(); this.ntxtDEPTH.Text = DCASI.DEPTH.ToString(); this.ntxtLOLLDEPTH.Text = DCASI.LOLLDEPTH.ToString(); this.txtSHIPMENNATIONNALITY.Text = DCASI.SHIPMENNATIONNALITY; this.txtGOODSINFO.Text = DCASI.GOODSINFO; this.txtPREVIOUSHARBOUR.Text = DCASI.PREVIOUSHARBOUR; this.txtNEXTHARBOUR.Text = DCASI.NEXTHARBOUR; this.ddlCorp.SelectedIndex = this.ddlCorp.Items.IndexOf(this.ddlCorp.Items.FindByValue(DCASI.PORTGUID)); new CawBindInfoDB().BindCorpBerth(this.ddlBerth, this.ddlCorp.SelectedItem.Value); this.ddlBerth.SelectedIndex = this.ddlBerth.Items.IndexOf(this.ddlBerth.Items.FindByValue(DCASI.BERTHGUID)); this.txtFEEINFO.Text = DCASI.FEEINFO; this.dtbARRIVEDATE.Text = DCASI.ARRIVEYANGTSERIVERDATE == DateTime.MinValue ? string.Empty : DCASI.ARRIVEYANGTSERIVERDATE.ToShortDateString(); this.ntbArriveHour.Text = DCASI.ARRIVEYANGTSERIVERDATE == DateTime.MinValue ? "00" : DCASI.ARRIVEYANGTSERIVERDATE.Hour.ToString(); this.ntbArriveMinute.Text = DCASI.ARRIVEYANGTSERIVERDATE == DateTime.MinValue ? "00" : DCASI.ARRIVEYANGTSERIVERDATE.Minute.ToString(); this.dtbARRIVEZJGDATE.Text = DCASI.ARRIVEZJGDATE == DateTime.MinValue ? string.Empty : DCASI.ARRIVEZJGDATE.ToShortDateString(); this.ntbZJGHour.Text = DCASI.ARRIVEZJGDATE == DateTime.MinValue ? "00" : DCASI.ARRIVEZJGDATE.Hour.ToString(); this.ntbZJGMinute.Text = DCASI.ARRIVEZJGDATE == DateTime.MinValue ? "00" : DCASI.ARRIVEZJGDATE.Minute.ToString(); this.ddlDealGoodsCmp.SelectedIndex = this.ddlDealGoodsCmp.Items.IndexOf(this.ddlDealGoodsCmp.Items.FindByValue(DCASI.DEALGOODSCMPGUID)); this.txtLOADHARBOUR.Text = DCASI.LOADHARBOUR; this.txtUNLOADHARBOUR.Text = DCASI.UNLOADHARBOUR; ViewState["CurrStatus"] = DCASI.DATASTATUS; //根据传入的参数进行按钮的可见和可用设置 //根据明细判断:审核用(按钮全隐藏) //数据状态:0保存未提交(可修改);1提交待审批(不可修改);2审批通过(不可修改);3退回(可修改);4审批暂停(可修改) //从岸线申请中获取项目名称 //以下为按钮控制 bool InCheck = false; if (Request.QueryString["InCheck"] != null) { InCheck = true; } //注意传入的按钮顺序,如果没有则填null,分别为:保存按钮、提交按钮、返回按钮、添加附件按钮 new CommonFun().SetBtnStatus(InCheck, ViewState["CurrStatus"].ToString(), btnEdit, btnSubmit, btnReturn, null); DataView dv = new CawInfoAgentGoods().Select(DCASI.GUID); GridView1.DataSource = dv; GridView1.DataBind(); //调用一个js函数,用于强制执行datagrid的颜色变换。如不用,因updatapanel中数据更新后将无法引起datagridcolor.js的执行 CallJsFun("ChangeColor();"); this.trCargo.Visible = false; if (Session["IsCAW"].ToString() == "Y") this.trCargo.Visible = true; if (Request.QueryString["type"] != null) { this.btnEdit.Visible = false; this.btnSubmit.Visible = false; this.trCargo.Visible = true; } }