public void BindGrid() { DataSet ds = null; if (LicensingId.ToString() == "0") { ds = PardakhtClass.GetList(null, null, null, null, null, CuttingTreeID.ToString(), null, null); } else { ds = PardakhtClass.GetList(null, null, null, null, null, null, LicensingId.ToString(), null); } // DataSet ds = PardakhtClass.GetList(null, null, null,null, null,CuttingTreeID.ToString(),LicensingId.ToString(),null ); if (ds != null) { DataView dv = new DataView(ds.Tables[0]); //if (Securenamespace.SecureData.CheckSecurity(ViewState["Abbaha"].ToString()) == null) //{ // ViewState["Abbaha"] = "id Desc"; //} //dv.Sort = Securenamespace.SecureData.CheckSecurity(ViewState["Abbaha"].ToString()).ToString(); GridView1.DataSource = dv; GridView1.DataBind(); } }
public void BindGrid() { DataSet ds; if (LicensingId == 0) { // ds = GreenSpaceDAL.TreeBonCutting.GetList(null, null, null, null, CuttingTreeID.ToString(), null, null,null ,MantaghehID.ToString(),null,null ,null ); ds = GreenSpaceDAL.TreeBonCutting.GetList(null, null, null, null, CuttingTreeID.ToString(), null, null, null, lblMantagheid.Text, null, null, null); trJabejaei.Visible = false; trMandegari.Visible = false; trZaribBazdarnde.Visible = true; trKhesaratPrecent.Visible = true; } else { //ds = GreenSpaceDAL.TreeBonCutting.GetList(null, null, null, null, null, null, LicensingId.ToString(), null, MantaghehID.ToString(),null ,null,null ); ds = GreenSpaceDAL.TreeBonCutting.GetList(null, null, null, null, null, null, LicensingId.ToString(), null, lblMantagheid.Text, null, null, null); trJabejaei.Visible = true; trMandegari.Visible = true; trZaribBazdarnde.Visible = false; trKhesaratPrecent.Visible = false; } if (ds != null) { DataView dv = new DataView(ds.Tables[0]); //if (Securenamespace.SecureData.CheckSecurity(ViewState["Sakhtikar"].ToString()) == null) //{ // ViewState["Sakhtikar"] = "id Desc"; //} //dv.Sort = Securenamespace.SecureData.CheckSecurity(ViewState["Sakhtikar"].ToString()).ToString(); GridView1.DataSource = dv; GridView1.DataBind(); } }
protected void BtnUpdate_Click1(object sender, EventArgs e) { int i = PardakhtClass.Update(TXTPardakhtId.Text, TXTFishNum.Text, TXTDesc.Text, TXTMablaghFinal.Text, DDPardakhtStatusid.SelectedValue.ToString(), CuttingTreeID.ToString(), LicensingId.ToString(), TXTPardakhtDate.Text); if (i == 0) { LblMsg.ForeColor = System.Drawing.Color.Red; LblMsg.Text = "خطا"; } else { LblMsg.ForeColor = System.Drawing.Color.Green; LblMsg.Text = "ویرایش انجام شد"; BindGrid(); } }
protected void BtnInsert_Click(Object sender, System.EventArgs e) { int t = PardakhtClass.insert(TXTFishNum.Text, TXTDesc.Text, TXTMablaghFinal.Text, DDPardakhtStatusid.SelectedValue.ToString(), CuttingTreeID.ToString(), LicensingId.ToString(), TXTPardakhtDate.Text); if (t == 0) { LblMsg.ForeColor = System.Drawing.Color.Red; LblMsg.Text = "خطا در ثبت"; } else { LblMsg.ForeColor = System.Drawing.Color.Green; LblMsg.Text = "ثبت انجام شد."; BindGrid(); } }
protected void BtnInsert_Click(object sender, EventArgs e) { int t = TreeBonCutting.insert(DDTreeTypeId.SelectedValue.ToString(), TXTCount.Text, DDStreetTypeid.SelectedValue.ToString(), CuttingTreeID.ToString(), TXTBon.Text, LblLicensingId.Text, TXTZaribBazdarnde.Text, TXTKhesaratPrecent.Text, TXTJabejaei.Text.Replace(",", "").ToString(), TXTZaribMandegari.Text); if (t == 0) { LblMsg.ForeColor = System.Drawing.Color.Red; LblMsg.Text = "خطا در ثبت"; } else { LblMsg.ForeColor = System.Drawing.Color.Green; LblMsg.Text = "ثبت انجام شد."; BindGrid(); } }