protected void Page_Load(object sender, EventArgs e) { if (IsPostBack == false) { ds = cn.RunSql("sp_getbranch '" + Request.Cookies["CompID"].Value + "'", "select"); DDLBranch.DataSource = ds; DDLBranch.DataBind(); } }
protected void Page_Load(object sender, EventArgs e) { if (!IsPostBack) { DDLCollege.DataSource = Participant.GetAllColleges(); DDLCollege.DataBind(); ListItem li = new ListItem(); li.Text = "Other College"; li.Value = "-1"; DDLCollege.Items.Add(li); DDLBranch.DataSource = Participant.GetAllBranches(); DDLBranch.DataBind(); } }
protected void Page_Load(object sender, EventArgs e) { if (!IsPostBack) { try { ds = cn.RunSql("sp_getbranch '" + Request.Cookies["CompID"].Value + "'", "select"); DDLBranch.DataSource = ds; DDLBranch.DataBind(); ds = cn.RunSql("sp_getbranch '" + Request.Cookies["CompID"].Value + "'", "select"); DDL1Branch.DataSource = ds; DDL1Branch.DataBind(); DateTime now = DateTime.Now; var startDate = new DateTime(now.Year, now.Month, 1); var endDate = startDate.AddMonths(1).AddDays(-1); TxtFrmdate.Text = startDate.ToString("dd-MM-yyyy"); TxtToDate.Text = endDate.ToString("dd-MM-yyyy"); TxtDate.Text = DateTime.Now.ToString("dd-MM-yyyy"); if (Request.QueryString["Rpt"] == "1") { LblHead.Text = "Purchase Register"; trDate.Visible = true; tritem.Visible = false; } else if (Request.QueryString["Rpt"] == "5") { LblHead.Text = "Purchase Date Summary"; trDate.Visible = true; tritem.Visible = false; } else if (Request.QueryString["Rpt"] == "7") { LblHead.Text = "Purchase Item Summary"; trDate.Visible = true; tritem.Visible = false; tritem.Visible = true; DDLBranch.Visible = false; } else if (Request.QueryString["Rpt"] == "2") { LblHead.Text = "Sales Register"; trDate.Visible = true; tritem.Visible = false; } else if (Request.QueryString["Rpt"] == "4") { LblHead.Text = "Sales Date Summary"; trDate.Visible = true; tritem.Visible = false; } else if (Request.QueryString["Rpt"] == "6") { LblHead.Text = "Sales Item Summary"; trDate.Visible = true; tritem.Visible = false; tritem.Visible = true; tdbranch.Visible = false; DDLBranch.Visible = false; } else if (Request.QueryString["Rpt"] == "3") { LblHead.Text = "Closing Stock"; trSingleDate.Visible = true; tritem.Visible = true; } else if (Request.QueryString["Rpt"] == "8") { LblHead.Text = "GST Summary"; trDate.Visible = true; tritem.Visible = false; trGst.Visible = true; } else if (Request.QueryString["Rpt"] == "Env") { LblHead.Text = "Envelope"; trCusEnv.Visible = true; } else if (Request.QueryString["Rpt"] == "DB") { LblHead.Text = "Day book"; trSingleDate.Visible = true; } else if (Request.QueryString["Rpt"] == "CashB") { LblHead.Text = "Cash book"; trCusEnv.Visible = true; trDate.Visible = true; ds = cn.RunSql("[Sp_SearchAccType] '2' ", "select"); DDL_Account.DataSource = ds; DDL_Account.DataBind(); TxtCustomer.Visible = false; } else if (Request.QueryString["Rpt"] == "BankB") { LblHead.Text = "Bank book"; trDate.Visible = true; trCusEnv.Visible = true; ds = cn.RunSql("[Sp_SearchAccType] '1' ", "select"); DDL_Account.DataSource = ds; DDL_Account.DataBind(); TxtCustomer.Visible = false; } else if (Request.QueryString["Rpt"] == "StatB") { LblHead.Text = "Statement"; trDate.Visible = true; trCusEnv.Visible = true; DDL_Account.Visible = false; } else if (Request.QueryString["Rpt"] == "Rec") { LblHead.Text = "Receivable"; trSingleDate.Visible = true; trcity.Visible = true; ds = cn.RunSql("[sp_Searchaccount] 'City','" + Request.Cookies["CompID"].Value.ToString() + "'", "data"); ChkCity.DataSource = ds; ChkCity.DataBind(); } else if (Request.QueryString["Rpt"] == "Pay") { LblHead.Text = "Payable"; trSingleDate.Visible = true; trcity.Visible = true; ds = cn.RunSql("[sp_Searchaccount] 'City','" + Request.Cookies["CompID"].Value.ToString() + "'", "data"); ChkCity.DataSource = ds; ChkCity.DataBind(); } else if (Request.QueryString["Rpt"] == "Trail") { LblHead.Text = "Trail Balance"; trSingleDate.Visible = true; } else if (Request.QueryString["Rpt"] == "TA") { LblHead.Text = "Trading Account"; trDate.Visible = true; } else if (Request.QueryString["Rpt"] == "PL") { LblHead.Text = "Profit & Loss"; trDate.Visible = true; } else if (Request.QueryString["Rpt"] == "Bal") { LblHead.Text = "Balance Shit"; trDate.Visible = true; } } catch (Exception ex) { LblHead.Text = ex.Message.ToString(); } } }
protected void Page_Load(object sender, EventArgs e) { Dictionary <int, string> colleges = new Dictionary <int, string>(); foreach (DataRow row in Participant.GetColleges().Tables[0].Rows) { colleges.Add((int)row["CollegeID"], (string)row["CollegeName"]); } ListItem li = new ListItem(); li.Text = "Other College"; li.Value = "-1"; DDLCollege.DataSource = colleges.OrderBy(x => x.Key).ToList().Skip(1).OrderBy(x => x.Value); DDLCollege.DataBind(); DDLCollege.Items.Add(li); DDLBranch.DataSource = Participant.GetBranches(); DDLBranch.DataBind(); if (Session["EmailID"] != null) { pnlProfile.Visible = true; btnRegisterLogin.Visible = false; Participant participant = Participant.GetParticipantDetails(Session["EmailID"].ToString()); lblParticipantName.Text = participant.Name.Split(' ')[0]; drpdwnProfileCollege.DataSource = colleges.OrderBy(x => x.Key).ToList().Skip(1).OrderBy(x => x.Value); drpdwnProfileCollege.DataBind(); drpdwnProfileCollege.Items.Add(li); drpdwnProfileBranch.DataSource = Participant.GetBranches(); drpdwnProfileBranch.DataBind(); drpdwnProfileBranch.SelectedIndex = drpdwnProfileBranch.Items.IndexOf(drpdwnProfileBranch.Items.FindByValue(participant.Branch.ToString())); drpdwnProfileCollege.SelectedIndex = drpdwnProfileCollege.Items.IndexOf(drpdwnProfileCollege.Items.FindByValue(participant.CollegeID.ToString())); txtbxProfileStudentNumber.Text = participant.StudentNo; txtbxProfileName.Text = participant.Name; txtbxProfileEmail.Text = participant.EmailID; txtbxProfileContactNo.Text = participant.ContactNo; chkbxProfileWantTshirt.Checked = participant.WantTShirt; chkbxWantAccomodation.Checked = participant.WantAccomodation; rblProfileGender.SelectedIndex = rblProfileGender.Items.IndexOf(rblProfileGender.Items.FindByText(participant.Gender.ToString())); drpdwnProfileYear.SelectedIndex = drpdwnProfileYear.Items.IndexOf(drpdwnProfileYear.Items.FindByValue(participant.Year.ToString())); if (participant.PartnerID == 0) { txtbxProfilePartnerId.Text = ""; } else { txtbxProfilePartnerId.Text = "TT" + participant.PartnerID.ToString(); } if (drpdwnProfileCollege.SelectedItem.Value == "-1") { profileCollegeDiv.Visible = true; } else { profileCollegeDiv.Visible = false; } if (drpdwnProfileCollege.SelectedItem.Value != "1") { profileStudentNumberDiv.Visible = false; profileAccomodationDiv.Visible = true; profilePartnerIdDiv.Visible = true; } else { profileStudentNumberDiv.Visible = true; profileAccomodationDiv.Visible = false; profilePartnerIdDiv.Visible = false; } LblTTID.Text = "TT" + participant.TTID; } }