protected void viewMonth(object sender, EventArgs e) { string connStr = ConfigurationManager.ConnectionStrings["MyDbConn"].ToString(); SqlConnection conn = new SqlConnection(connStr); SqlCommand cmd = new SqlCommand("VieweachMonthHR", conn); cmd.CommandType = CommandType.StoredProcedure; string SVM = StaffVM.Text; string YVM = YearVM.Text; cmd.Parameters.Add(new SqlParameter("@Staff", SVM)); cmd.Parameters.Add(new SqlParameter("@HR", Session["Username"].ToString())); cmd.Parameters.Add(new SqlParameter("@year", YVM)); conn.Open(); cmd.ExecuteNonQuery(); GridViewMonths.EmptyDataText = "No Records Found"; SqlDataAdapter adapter = new SqlDataAdapter(cmd); DataSet ds = new DataSet(); adapter.Fill(ds); if (ds.Tables.Count == 0) { GridViewMonths.Visible = false; Response.Write("no records"); } else { GridViewMonths.DataSource = ds; GridViewMonths.DataBind(); GridViewMonths.Visible = true; } conn.Close(); }
private void validateSearch() { monthToSearch = DropDownListMonths.SelectedItem.ToString(); String year = DropDownListYearsMonth.SelectedItem.ToString(); try { int realyear = int.Parse(year); idNotary = int.Parse(Session["NotaryID"].ToString()); LabelMonth.Text = monthToSearch; //alert(idNotary+ " " + monthToSearch + " " + realyear); GridViewMonthsSearch.DataSource = bll.loadAllWritingsByProtocol(idNotary, monthToSearch, realyear); GridViewMonthsSearch.DataBind(); GridViewMonths.DataSource = null; GridViewMonths.DataBind(); /* GridViewMonthsSearch.Visible = true; * GridViewMonths.Visible = false;*/ clearCoNotary(); } catch (Exception e) { alert("Existe un error en el Año"); } }
private void load() { notary = bll.loadProtocolInfo(Session["ProtocolID"].ToString()); LabelName.Text = notary.NotaryName; LabelInitials.Text = notary.NotaryInitials; LabelRBT.Text = notary.RBTEnabled; LabelAvailable.Text = notary.NotaryAvailable; idNotary = notary.NotaryID; Session["NotaryID"] = idNotary; int allwritingsByNotary = bll.getAllMovemetsByIdNotary(notary.NotaryID, bll.getActualFiscalYear()); LabelTotalYear.Text = allwritingsByNotary + ""; /*Resumen de cada Mes*/ GridViewTotalYear.DataSource = bll.showSummaryYearPerMonths(notary.NotaryID); GridViewTotalYear.DataBind(); LabelAnualActualLimit.Text = (notary.BalanceLimitMonth - allwritingsByNotary) + ""; LabelAnualLimit.Text = notary.BalanceLimitMonth + ""; loadDropDown(); /*Ultimos datos*/ GridViewOwnWritings.DataSource = bll.getAllOwnWritingsByNotary(idNotary, bll.getLastFiscalYear()); GridViewCo_NotaryWritings.DataSource = bll.getAllCoNotariesByNotary(idNotary, bll.getLastFiscalYear()); GridViewOwnWritings.DataBind(); GridViewCo_NotaryWritings.DataBind(); string protocolIDVar1 = Session["ProtocolID"].ToString(); int protocolIDvar = int.Parse(protocolIDVar1); LabelMensualLimit.Text = bll.getMensualLimitByProtocol(protocolIDvar) + ""; LabelMensualActualLimit.Text = bll.getMensualActualLimitByProtocol(LabelName.Text) + ""; LabelMonth.Text = bll.getMonth(); LabelYear.Text = bll.getLastFiscalYear() + ""; GridViewMonths.DataSource = bll.loadAllWritingsByProtocol(notary.NotaryID); GridViewMonths.DataBind(); LabelAnualActualLimitFake.Visible = false; LabelMensualActualLimitFake.Visible = false; switch (Session["Varload"].ToString()) { case "0": Session["Varload"] = "Por Defecto"; alertBalance(); break; } }
protected void ButtonActual_Click(object sender, EventArgs e) { GridViewMonthsSearch.DataSource = null; GridViewMonthsSearch.DataBind(); /*GridViewMonthsSearch.Visible = false; * GridViewMonths.Visible = true;*/ int varr = int.Parse(Session["NotaryID"].ToString()); GridViewMonths.DataSource = bll.loadAllWritingsByProtocol(varr); GridViewMonths.DataBind(); Label2.Text = ""; GridView1.DataSource = null; GridView1.DataBind(); LabelMonth.Text = bll.getMonth(); }