public void BindGrid() { ClAgreementFine cl = new ClAgreementFine(); if (NotDefaultAgree == false) { cl.AgreementID = 0; } else { cl.AgreementID = Convert.ToInt32(AgreementID); } DataSet ds = AgreementFineClass.GetList(cl); DataView dv = new DataView(ds.Tables[0]); if (ViewState["AgreementFineID"] == null) { ViewState["AgreementFineID"] = "AgreementFineID Desc"; } dv.Sort = Securenamespace.SecureData.CheckSecurity(ViewState["AgreementFineID"].ToString()).ToString(); GridView1.DataSource = dv; GridView1.DataBind(); }
protected void BtnSerach_Click(object sender, EventArgs e) { DataSet ds = AgreementFineClass.GetList(Data); GridView1.DataSource = ds; GridView1.DataBind(); LightBox.Value = "0"; }
protected void btnprint21_Click(object sender, EventArgs e) { try { DataSet ds = null; if (Request.QueryString["RName"].ToString() == "Rp_ExplainPrice2" || Request.QueryString["RName"].ToString() == "Rp_SubjectPrice" ) { ClArchiveAgree cl = new ClArchiveAgree(); cl.AgreeID = Convert.ToInt32(ddAgree.SelectedValue); cl.AcrchiveID = ctlArchiveDD.SelectedValue; if (Request.QueryString["RName"].ToString() == "Rp_ExplainPrice2") { ds = ArchiveAgreeClass.GetListReport(cl); } else if (Request.QueryString["RName"].ToString() == "Rp_SubjectPrice") { ds = AgreementClass.GetListSubjectPrice(cl); } } else if (Request.QueryString["RName"].ToString() == "SumPay" || Request.QueryString["RName"].ToString() == "SumPay2" || Request.QueryString["RName"].ToString() == "RptSumPayPage") { ClExplanSubject cl2 = new ClExplanSubject(); cl2.ExplainSubjectID = Convert.ToInt32(CtlAllSubjectExplan.SelectedValue); cl2.SubjectID = Convert.ToInt32(CtlAllSubjectExplan.subjectID); cl2.FromDate = CtlFromToDate.FromDate; cl2.ToDate = CtlFromToDate.ToDate; ds = ExplanSubjectClass.GetListSumPay(cl2, 0); } else if (Request.QueryString["RName"].ToString() == "Rp_Khesarat" || Request.QueryString["RName"].ToString() == "rp_khesart3") { ClAgreementFine cl = new ClAgreementFine(); cl.AgreementID = Convert.ToInt32(ddAgree.SelectedValue); cl.ArchivID = Convert.ToInt32(ctlArchiveDD.SelectedValue); ds = AgreementFineClass.GetList_Rep(cl); } Session["ReportData"] = ds; MyIfarm1.Visible = true; MyIfarm1.Attributes.Add("src", "~/Report/reportview2.aspx?RName=" + Request.QueryString["RName"].ToString() + "&PName=" + Request.QueryString["PName"].ToString()); } catch { } }
public void DeleteItem(object sender, System.EventArgs e) { String AgreementFineID = ((HtmlAnchor)sender).HRef.ToString(); int i = AgreementFineClass.Delete(AgreementFineID); 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) { //if (TXTFineDate.Text == "") // return; if (txtAdressFine.Text == "" || TXTFineComment.Text == "" || DDFineID.Text == "" || TXTFineDate.Text == "" || TXTFinePrice.Text == "" || txtNumberFine.Text == "") { LblMsg.ForeColor = System.Drawing.Color.Red; LblMsg.Text = "تمام اطلاعات باید وارد شوند"; return; } ClAgreementFine cl = new ClAgreementFine(); cl = Data; int t = 0; if (CSharp.PublicFunction.ModeInsert(AgreementFineID.ToString())) { t = AgreementFineClass.insert(cl); } else { t = AgreementFineClass.Update(cl); } if (t == 0) { LblMsg.ForeColor = System.Drawing.Color.Red; LblMsg.Text = "خطا در ثبت"; } else { LblMsg.ForeColor = System.Drawing.Color.Green; LblMsg.Text = "ثبت انجام شد."; BindGrid(); } LightBox.Value = "0"; LblParamAgreementFineID.Text = "0"; }