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 DeleteItem(object sender, System.EventArgs e) { String id = ((HtmlAnchor)sender).HRef.ToString(); int i = PardakhtClass.Delete(Convert.ToInt32(id)); if (i == 0) { LblMsg.Text = " error "; ScriptManager.RegisterClientScriptBlock(Page, Page.GetType(), Guid.NewGuid().ToString(), "alert('خطا در حذف');", true); } else { BindGrid(); } //LightBox.Value = "0"; }
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 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(); } }
public void UpItem(object sender, EventArgs e) { String id = ((HtmlAnchor)sender).HRef.ToString(); DataSet ds = PardakhtClass.GetList(id, null, null, null, null, null, null, null); DataRow dr = ds.Tables[0].Rows[0]; TXTPardakhtId.Text = id; TXTMablaghFinal.Text = dr["MablaghFinal"].ToString(); TXTFishNum.Text = dr["FishNum"].ToString(); TXTPardakhtDate.Text = dr["date1"].ToString(); DDPardakhtStatusid.SelectedValue = dr["PardakhtStatusid"].ToString(); TXTDesc.Text = dr["Desc"].ToString(); EmptyLight(); BtnInsert.Visible = false; BtnUpdate.Visible = true; }