protected void btn_add_Click(object sender, EventArgs e) { DataTable dt = GetTable(); foreach (GridViewRow gr in GridHeSuan.Rows) { DataRow dr = dt.NewRow(); for (int i = 0; i < 4; i++) { dr[i] = ((ITextControl)gr.Cells[i].FindControl("txt" + i)).Text; } dt.Rows.Add(dr); } for (int i = 0; i < int.Parse(num.Text); i++) { dt.Rows.Add(dt.NewRow()); } GridHeSuan.DataSource = dt; GridHeSuan.DataBind(); }
protected void Delete_Click(object sender, EventArgs e) { int id = int.Parse(((LinkButton)sender).CommandArgument) - 1; DataTable dt = GetTable(); for (int i = 0; i < GridHeSuan.Rows.Count; i++) { if (i != id) { GridViewRow gr = GridHeSuan.Rows[i]; DataRow dr = dt.NewRow(); for (int j = 0; j < 4; j++) { dr[j] = ((ITextControl)gr.Cells[j].FindControl("txt" + j)).Text; } dt.Rows.Add(dr); } } GridHeSuan.DataSource = dt; GridHeSuan.DataBind(); }
private void showInfo() { string sqlselect = "select * from View_CM_CONTRACT_REV_INFO_ALL where cr_id='" + id + "'"; DataSet ds = DBCallCommon.FillDataSet(sqlselect); if (ds.Tables[0].Rows.Count > 0) { lbl_UNID.Text = ds.Tables[0].Rows[0]["GUID"].ToString(); //唯一编号 LBpsdh.Text = ds.Tables[0].Rows[0]["CR_ID"].ToString(); //评审单号 lb_HTBH.Text = ds.Tables[0].Rows[0]["PCON_BCODE"].ToString(); //合同号 lb_XMMC.Text = ds.Tables[0].Rows[0]["CR_XMMC"].ToString(); // 项目名称 //lb_GCMC.Text = ds.Tables[0].Rows[0]["PCON_ENGNAME"].ToString();// 工程名称 //lb_SBMC.Text = ds.Tables[0].Rows[0]["CR_SBMC"].ToString(); // 设备名称 //lb_FBFW.Text = ds.Tables[0].Rows[0]["CR_FBFW"].ToString(); // 分包范围 //lb_JE.Text = string.Format("{0:C}",Convert.ToDecimal(ds.Tables[0].Rows[0]["PCON_JINE"].ToString()));// 金额 //lb_JE.Text = Convert.ToDecimal(ds.Tables[0].Rows[0]["PCON_JINE"].ToString()) == 0 ? string.Format("{0:C}", Convert.ToDecimal(ds.Tables[0].Rows[0]["CR_JIN"].ToString())) : string.Format("{0:C}", Convert.ToDecimal(ds.Tables[0].Rows[0]["PCON_JINE"].ToString())); //if (lb_HTBH.Text!=""&&Convert.ToDecimal(ds.Tables[0].Rows[0]["OTHER_MONUNIT"].ToString()) > 0) //有其他币种时 //{ // lb_OtherMonunit.Text = ds.Tables[0].Rows[0]["OTHER_MONUNIT"].ToString() + ds.Tables[0].Rows[0]["PCON_MONUNIT"].ToString(); //} lb_FBS.Text = ds.Tables[0].Rows[0]["CR_FBSMC"].ToString(); //业主供应商 lb_ZDR.Text = ds.Tables[0].Rows[0]["ST_NAME"].ToString(); // 制单人 //lb_Orderid.Text = ds.Tables[0].Rows[0]["PCON_ORDERID"].ToString();//采购订单号 //lb_tbcode.Text = ds.Tables[0].Rows[0]["PCON_TBCODE"].ToString(); //投标评审号(2012年12月13日 Meng) //lb_BZ.Text = ds.Tables[0].Rows[0]["CR_NOTE"].ToString();//备注 以前的审批和合同是分开的,现在合并了,审批表中的备注不要了 lb_BZ.Text = ds.Tables[0].Rows[0]["PCON_NOTE"].ToString();//备注 /********************************************/ /********************************************/ BindSelectReviewer();//绑定已选审批人信息 if (type == "0") { TabPanel4.Visible = true; string sqlstr = "select * from TBPM_CONTRACTPS where ID='" + id + "'"; DataTable dt = DBCallCommon.GetDTUsingSqlText(sqlstr); foreach (Control control in PanelAll.Controls) { if (control is TextBox) { ((TextBox)control).Text = dt.Rows[0][control.ID].ToString(); } } sqlstr = "select * from TBPM_HESUAN where ID='" + id + "'"; GridHeSuan.DataSource = DBCallCommon.GetDTUsingSqlText(sqlstr); GridHeSuan.DataBind(); } } }