private void CalKol() { if (DDSubjectExplainID.SelectedValue.ToString() != "-1") { return; } ClArea cl = new ClArea(); cl.SubjectID = Convert.ToInt32(ddSubject.SelectedValue); cl.ParkID = Convert.ToInt32(DDParkID.SelectedValue); DataSet ds = AreaClass.GetList(cl); if (ds.Tables[0].Rows.Count > 0) { DataRow dr = ds.Tables[0].Rows[0]; TXTUnitNumber.Text = dr["sumkol"].ToString();// +"00"; } else { TXTUnitNumber.Text = "0"; } ds.Dispose(); }
protected void BtnSerach_Click(object sender, EventArgs e) { DataSet ds = AreaClass.GetList(Data); GridView1.DataSource = ds; GridView1.DataBind(); // LightBox.Value = "0"; }
public void BindGrid() { ClArea cl = new ClArea(); cl.AgreementID = Convert.ToInt32(AgreementID); cl.SubjectID = Convert.ToInt32(ddSubject.SelectedValue); cl.ParkID = Convert.ToInt32(DDParkID.SelectedValue.ToString()); DataSet ds = AreaClass.GetList(cl); DataView dv = new DataView(ds.Tables[0]); if (ViewState["AreaID "] == null) { ViewState["AreaID"] = "AreaID Desc"; } dv.Sort = Securenamespace.SecureData.CheckSecurity(ViewState["AreaID"].ToString()).ToString(); GridView1.DataSource = dv; GridView1.DataBind(); CalKol(); }
private void BindGridContetnt2() { int ParkID = 0; ClArea cl = new ClArea(); cl.PeymanID = Convert.ToInt32(ddPeyman2.SelectedValue); cl.AgreementID = Convert.ToInt32(ddPeyman.SelectedValue); GridViewRow grow; for (int i = 0; i < Grid1.Rows.Count; i++) { grow = Grid1.Rows[i]; ParkID = Convert.ToInt32(((grow.FindControl("lblPark") as Label).Text)); cl.ParkID = Convert.ToInt32(ParkID); DataSet ds = AreaClass.GetList(cl); Label txtChaman_Kol = grow.FindControl("txtChaman_Kol") as Label; TextBox txtChamanAbDasti = grow.FindControl("txtChamanAbDasti") as TextBox; TextBox txtChamanPSA = grow.FindControl("txtChamanPSA") as TextBox; TextBox txtChamanPGP = grow.FindControl("txtChamanPGP") as TextBox; Label txtParchinKol = grow.FindControl("LblParchin_Kol") as Label; TextBox txtParchinAbChah = grow.FindControl("txtParchinAbChah") as TextBox; TextBox txtParchinShilang = grow.FindControl("txtParchinShilang") as TextBox; TextBox txtParchinFeshar = grow.FindControl("txtParchinFeshar") as TextBox; Label txt_Poshesh_KOL = grow.FindControl("txt_Poshesh_KOL") as Label; TextBox txtPoshesh_SHILANG = grow.FindControl("txtPoshesh_SHILANG") as TextBox; TextBox txtPoshesh_Feshar = grow.FindControl("txtPoshesh_Feshar") as TextBox; Label txt_Fasli_KOL = grow.FindControl("txt_Fasli_KOL") as Label; TextBox txtFasli_SHILANG = grow.FindControl("txtFasli_SHILANG") as TextBox; TextBox txtFasli_Feshar = grow.FindControl("txtFasli_Feshar") as TextBox; Label txt_ROz_KOL = grow.FindControl("txt_ROz_KOL") as Label; TextBox txtROz_SHILANG = grow.FindControl("txtROz_SHILANG") as TextBox; TextBox txtROz_Feshar = grow.FindControl("txtROz_Feshar") as TextBox; TextBox txtROz = grow.FindControl("txtROz") as TextBox; TextBox txtROzDerakht = grow.FindControl("txtROzDerakht") as TextBox; Label txt_drakht_KOL = grow.FindControl("txt_drakht_KOL") as Label; TextBox txtdrakht_AbChah = grow.FindControl("txtdrakht_AbChah") as TextBox; TextBox txtdrakht_Tashtak = grow.FindControl("txtdrakht_Tashtak") as TextBox; TextBox txt_drakht_Shilang = grow.FindControl("txt_drakht_Shilang") as TextBox; TextBox txtdrakht_Feshar = grow.FindControl("txtdrakht_Feshar") as TextBox; TextBox txtdrakht_Tanker = grow.FindControl("txtdrakht_Tanker") as TextBox; TextBox txtHashieKhiaban = grow.FindControl("txtHashieKhiaban") as TextBox; for (int t = 0; t < ds.Tables[0].Rows.Count; t++) { ////////چمن/متر مربع if (ds.Tables[0].Rows[t]["ParkID"].ToString() == ParkID.ToString()) { if (ds.Tables[0].Rows[t]["SubjectID"].ToString() == "15" && ds.Tables[0].Rows[t]["SubjectExplainID"].ToString() == "9017") { txtChamanAbDasti.Text = ds.Tables[0].Rows[t]["UnitNumber"].ToString(); } if (ds.Tables[0].Rows[t]["SubjectID"].ToString() == "15" && ds.Tables[0].Rows[t]["SubjectExplainID"].ToString() == "9015") { txtChamanPSA.Text = ds.Tables[0].Rows[t]["UnitNumber"].ToString(); } if (ds.Tables[0].Rows[t]["SubjectID"].ToString() == "15" && ds.Tables[0].Rows[t]["SubjectExplainID"].ToString() == "9019") { txtChamanPGP.Text = ds.Tables[0].Rows[t]["UnitNumber"].ToString(); } txtChaman_Kol.Text = ( Convert.ToDecimal(txtChamanAbDasti.Text == "" ? "0" : txtChamanAbDasti.Text) + Convert.ToDecimal(txtChamanPSA.Text == "" ? "0" : txtChamanPSA.Text) + Convert.ToDecimal(txtChamanPGP.Text == "" ? "0" : txtChamanPGP.Text)).ToString(); //////////////////پرچینی /متر مربع if (ds.Tables[0].Rows[t]["SubjectID"].ToString() == "2" && ds.Tables[0].Rows[t]["SubjectExplainID"].ToString() == "9041") { txtParchinAbChah.Text = ds.Tables[0].Rows[t]["UnitNumber"].ToString(); } if (ds.Tables[0].Rows[t]["SubjectID"].ToString() == "2" && ds.Tables[0].Rows[t]["SubjectExplainID"].ToString() == "9043") { txtParchinShilang.Text = ds.Tables[0].Rows[t]["UnitNumber"].ToString(); } if (ds.Tables[0].Rows[t]["SubjectID"].ToString() == "2" && ds.Tables[0].Rows[t]["SubjectExplainID"].ToString() == "9323") { txtParchinFeshar.Text = ds.Tables[0].Rows[t]["UnitNumber"].ToString(); } txtParchinKol.Text = ( Convert.ToDecimal(txtParchinAbChah.Text == "" ? "0" : txtParchinAbChah.Text) + Convert.ToDecimal(txtParchinShilang.Text == "" ? "0" : txtParchinShilang.Text) + Convert.ToDecimal(txtParchinFeshar.Text == "" ? "0" : txtParchinFeshar.Text) ).ToString(); /////////پوششی/مترمربع if (ds.Tables[0].Rows[t]["SubjectID"].ToString() == "10" && ds.Tables[0].Rows[t]["SubjectExplainID"].ToString() == "9061") { txtPoshesh_SHILANG.Text = ds.Tables[0].Rows[t]["UnitNumber"].ToString(); } if (ds.Tables[0].Rows[t]["SubjectID"].ToString() == "10" && ds.Tables[0].Rows[t]["SubjectExplainID"].ToString() == "9013") { txtPoshesh_Feshar.Text = ds.Tables[0].Rows[t]["UnitNumber"].ToString(); } txt_Poshesh_KOL.Text = ( Convert.ToDecimal(txtPoshesh_Feshar.Text == "" ? "0" : txtPoshesh_Feshar.Text) + Convert.ToDecimal(txtPoshesh_SHILANG.Text == "" ? "0" : txtPoshesh_SHILANG.Text)).ToString(); /////////گل فصلی / متر مربع if (ds.Tables[0].Rows[t]["SubjectID"].ToString() == "12" && ds.Tables[0].Rows[t]["SubjectExplainID"].ToString() == "9077") { txtFasli_SHILANG.Text = ds.Tables[0].Rows[t]["UnitNumber"].ToString(); } if (ds.Tables[0].Rows[t]["SubjectID"].ToString() == "12" && ds.Tables[0].Rows[t]["SubjectExplainID"].ToString() == "9073") { txtFasli_Feshar.Text = ds.Tables[0].Rows[t]["UnitNumber"].ToString(); } txt_Fasli_KOL.Text = ( Convert.ToDecimal(txtFasli_SHILANG.Text == "" ? "0" : txtFasli_SHILANG.Text) + Convert.ToDecimal(txtFasli_Feshar.Text == "" ? "0" : txtFasli_Feshar.Text)).ToString(); /////////رز و درختچه زینتی / متر مربع if (ds.Tables[0].Rows[t]["SubjectID"].ToString() == "13" && ds.Tables[0].Rows[t]["SubjectExplainID"].ToString() == "9097") { txtROz_SHILANG.Text = ds.Tables[0].Rows[t]["UnitNumber"].ToString(); } if (ds.Tables[0].Rows[t]["SubjectID"].ToString() == "13" && ds.Tables[0].Rows[t]["SubjectExplainID"].ToString() == "9095") { txtROz_Feshar.Text = ds.Tables[0].Rows[t]["UnitNumber"].ToString(); } txt_ROz_KOL.Text = ( Convert.ToDecimal(txtROz_SHILANG.Text == "" ? "0" : txtROz_SHILANG.Text) + Convert.ToDecimal(txtROz_Feshar.Text == "" ? "0" : txtROz_Feshar.Text)).ToString(); if (ds.Tables[0].Rows[t]["SubjectID"].ToString() == "13" && ds.Tables[0].Rows[t]["SubjectExplainID"].ToString() == "9333") { txtROz.Text = ds.Tables[0].Rows[t]["UnitNumber"].ToString(); } if (ds.Tables[0].Rows[t]["SubjectID"].ToString() == "13" && ds.Tables[0].Rows[t]["SubjectExplainID"].ToString() == "9334") { txtROzDerakht.Text = ds.Tables[0].Rows[t]["UnitNumber"].ToString(); } /////////درخت معابر و جنگلی داخل محدوده / متر مربع if (ds.Tables[0].Rows[t]["SubjectID"].ToString() == "14" && ds.Tables[0].Rows[t]["SubjectExplainID"].ToString() == "9114") { txtdrakht_AbChah.Text = ds.Tables[0].Rows[t]["UnitNumber"].ToString(); } if (ds.Tables[0].Rows[t]["SubjectID"].ToString() == "14" && ds.Tables[0].Rows[t]["SubjectExplainID"].ToString() == "9118") { txtdrakht_Tashtak.Text = ds.Tables[0].Rows[t]["UnitNumber"].ToString(); } if (ds.Tables[0].Rows[t]["SubjectID"].ToString() == "14" && ds.Tables[0].Rows[t]["SubjectExplainID"].ToString() == "9120") { txt_drakht_Shilang.Text = ds.Tables[0].Rows[t]["UnitNumber"].ToString(); } if (ds.Tables[0].Rows[t]["SubjectID"].ToString() == "14" && ds.Tables[0].Rows[t]["SubjectExplainID"].ToString() == "9116") { txtdrakht_Feshar.Text = ds.Tables[0].Rows[t]["UnitNumber"].ToString(); } if (ds.Tables[0].Rows[t]["SubjectID"].ToString() == "14" && ds.Tables[0].Rows[t]["SubjectExplainID"].ToString() == "9122") { txtdrakht_Tanker.Text = ds.Tables[0].Rows[t]["UnitNumber"].ToString(); } if (ds.Tables[0].Rows[t]["SubjectID"].ToString() == "14" && ds.Tables[0].Rows[t]["SubjectExplainID"].ToString() == "9335") { txtHashieKhiaban.Text = ds.Tables[0].Rows[t]["UnitNumber"].ToString(); } txt_drakht_KOL.Text = ( Convert.ToDecimal(txtdrakht_AbChah.Text == "" ? "0" : txtdrakht_AbChah.Text) + Convert.ToDecimal(txtdrakht_Tashtak.Text == "" ? "0" : txtdrakht_Tashtak.Text) + Convert.ToDecimal(txtdrakht_Feshar.Text == "" ? "0" : txtdrakht_Feshar.Text) + Convert.ToDecimal(txt_drakht_Shilang.Text == "" ? "0" : txt_drakht_Shilang.Text) + Convert.ToDecimal(txtdrakht_Tanker.Text == "" ? "0" : txtdrakht_Tanker.Text).ToString() + Convert.ToDecimal(txtHashieKhiaban.Text == "" ? "0" : txtHashieKhiaban.Text)).ToString(); ///////////////////////////////////////////////////////// } } calallcolumn((TextBox)Grid1.HeaderRow.FindControl("txtHashieKhiabanSum"), txtHashieKhiaban); calallcolumn((TextBox)Grid1.HeaderRow.FindControl("txtchamanDastiSum"), txtChamanAbDasti); calallcolumn((TextBox)Grid1.HeaderRow.FindControl("txtchamanPSASum"), txtChamanPSA); calallcolumn((TextBox)Grid1.HeaderRow.FindControl("txtchamanPGPSum"), txtChamanPGP); calallcolumn((TextBox)Grid1.HeaderRow.FindControl("txtparchinAbChahSum"), txtParchinAbChah); calallcolumn((TextBox)Grid1.HeaderRow.FindControl("txtParchinShilangSum"), txtParchinShilang); calallcolumn((TextBox)Grid1.HeaderRow.FindControl("txtParchinFesharSum"), txtParchinFeshar); calallcolumn((TextBox)Grid1.HeaderRow.FindControl("txtPosheshiShilangSum"), txtPoshesh_SHILANG); calallcolumn((TextBox)Grid1.HeaderRow.FindControl("txtPosheshiFesharSum"), txtPoshesh_Feshar); calallcolumn((TextBox)Grid1.HeaderRow.FindControl("txtGolfasliFesharSum"), txtFasli_Feshar); calallcolumn((TextBox)Grid1.HeaderRow.FindControl("txtRozShilangSum"), txtROz_SHILANG); calallcolumn((TextBox)Grid1.HeaderRow.FindControl("txtRozfesharSum"), txtROz_Feshar); calallcolumn((TextBox)Grid1.HeaderRow.FindControl("txtderakhtchahSum"), txtdrakht_AbChah); calallcolumn((TextBox)Grid1.HeaderRow.FindControl("txtderakhttashtakSum"), txtdrakht_Tashtak); calallcolumn((TextBox)Grid1.HeaderRow.FindControl("txtderakhtshilangsum"), txt_drakht_Shilang); calallcolumn((TextBox)Grid1.HeaderRow.FindControl("txtderakhtfesharSum"), txtdrakht_Feshar); calallcolumn((TextBox)Grid1.HeaderRow.FindControl("txtderakhttankerSum"), txtdrakht_Tanker); calallcolumn((TextBox)Grid1.HeaderRow.FindControl("txtGolfasliShilangSum"), txtFasli_SHILANG); calallcolumn((TextBox)Grid1.HeaderRow.FindControl("txtRozSum"), txtROz); calallcolumn((TextBox)Grid1.HeaderRow.FindControl("txtRozderakhtSum"), txtROzDerakht); ds.Dispose(); } }