protected void GridView1_RowCommand(object sender, GridViewCommandEventArgs e)
 {
     if (e.CommandName.ToString() == "cmddelete")
     {
         int         rowindex = Convert.ToInt32(e.CommandArgument.ToString());
         GridViewRow row      = (GridViewRow)GridView1.Rows[rowindex];
         Label       l        = (Label)row.FindControl("Label1");
         Businessobjects.BusinessObjectsclass objbo = new Businessobjects.BusinessObjectsclass();
         objbo.Did = l.Text;
         Businesslogiclayer.Businesslogiclayerclass objbll = new Businesslogiclayer.Businesslogiclayerclass();
         int i = objbll.DeleteDestinationpoint(objbo);
         FillDpoints();
     }
     else if (e.CommandName.ToString() == "cmdupdate")
     {
         int         rowindex = Convert.ToInt32(e.CommandArgument.ToString());
         GridViewRow row      = (GridViewRow)GridView1.Rows[rowindex];
         Label       l        = (Label)row.FindControl("Label1");
         Businessobjects.BusinessObjectsclass objbo = new Businessobjects.BusinessObjectsclass();
         objbo.Did = l.Text;
         Label l1 = (Label)row.FindControl("Label2");
         objbo.Dname      = l1.Text;
         Session["did"]   = l.Text;
         Session["dname"] = l1.Text;
         Response.Redirect("updateDpoints.aspx");
     }
 }
Example #2
0
        protected void Button1_Click(object sender, EventArgs e)
        {
            Businessobjects.BusinessObjectsclass objbo = new Businessobjects.BusinessObjectsclass();
            objbo.Serviceno        = txtsvno.Text;
            objbo.Fromplace        = txtfplace.Text;
            objbo.Toplace          = txttoplace.Text;
            objbo.Capacity         = txtcapacity.Text;
            objbo.Depaturetime     = txtdeptime.Text;
            objbo.Arrivaltime      = txtarrivaltime.Text;
            objbo.Travelagencyname = txtagencyname.Text;
            objbo.bustype          = ddlbustype.SelectedItem.Text;
            Businesslogiclayer.Businesslogiclayerclass objbll = new Businesslogiclayer.Businesslogiclayerclass();
            int i = objbll.Addbus(objbo);

            if (i == 1)
            {
                Response.Write("BUS IS ADDED");
                txtfplace.Text      = "";
                txttoplace.Text     = "";
                txtcapacity.Text    = "";
                txtdeptime.Text     = "";
                txtarrivaltime.Text = "";
                txtagencyname.Text  = "";
                txtsvno.Text        = objbll.AutogenerateSvno();
                txtsvno.Text        = objbll.AutogenerateSvno();
            }
            else
            {
                Response.Write("FAILED");
            }
        }
Example #3
0
        protected void GridView1_RowUpdating(object sender, GridViewUpdateEventArgs e)
        {
            Businessobjects.BusinessObjectsclass objbo = new Businessobjects.BusinessObjectsclass();
            GridViewRow row = (GridViewRow)GridView1.Rows[e.RowIndex];
            TextBox     t1  = (TextBox)row.FindControl("txtsvno");

            objbo.Serviceno = t1.Text;

            TextBox t2 = (TextBox)row.FindControl("txtfplace");

            objbo.Fromplace = t2.Text;

            TextBox t3 = (TextBox)row.FindControl("txttplace");

            objbo.Toplace = t3.Text;

            TextBox t4 = (TextBox)row.FindControl("txtcapacity");

            objbo.Capacity = t4.Text;

            TextBox t5 = (TextBox)row.FindControl("txtarrtime");

            objbo.Arrivaltime = t5.Text;

            TextBox t6 = (TextBox)row.FindControl("txtdeptime");

            objbo.Depaturetime = t6.Text;

            TextBox t7 = (TextBox)row.FindControl("txttravelagencyname");

            objbo.Travelagencyname = t7.Text;

            TextBox t8 = (TextBox)row.FindControl("txtbustype");

            objbo.bustype = t8.Text;

            Businesslogiclayer.Businesslogiclayerclass objbll = new Businesslogiclayer.Businesslogiclayerclass();
            int i = objbll.Editbus(objbo);

            if (i == 1)
            {
                Response.Write("ROW UPDATED SUCCESSFULLY");
            }
            else
            {
                Response.Write("ROW UPDATING FAILED");
            }
        }
        protected void Button1_Click(object sender, EventArgs e)
        {
            Businessobjects.BusinessObjectsclass objbo = new Businessobjects.BusinessObjectsclass();
            objbo.Did   = TextBox1.Text;
            objbo.Dname = TextBox2.Text;
            Businesslogiclayer.Businesslogiclayerclass objbll = new Businesslogiclayer.Businesslogiclayerclass();
            int i = objbll.UpdateDestination(objbo);

            if (i == 1)
            {
                Response.Write("Updated");
            }
            else
            {
                Response.Write("update failed");
            }
        }
        protected void GridView1_RowDeleting(object sender, GridViewDeleteEventArgs e)
        {
            Businessobjects.BusinessObjectsclass objbo = new Businessobjects.BusinessObjectsclass();
            objbo.pid = GridView1.DataKeys[e.RowIndex].Value.ToString();
            Businesslogiclayer.Businesslogiclayerclass objbll = new Businesslogiclayer.Businesslogiclayerclass();
            int i = objbll.Deletepickuppoint(objbo);

            if (i == 1)
            {
                Fillpickuppoints();
                Response.Write("PICKUPPOINT DELETED SUCCESSFULLY");
            }
            else
            {
                Response.Write("FAILED");
            }
        }
Example #6
0
        protected void GridView1_RowDeleting(object sender, GridViewDeleteEventArgs e)
        {
            string svno = GridView1.DataKeys[e.RowIndex].Value.ToString();

            Businessobjects.BusinessObjectsclass objbo = new Businessobjects.BusinessObjectsclass();
            objbo.Serviceno = svno;
            Businesslogiclayer.Businesslogiclayerclass objbll = new Businesslogiclayer.Businesslogiclayerclass();
            int i = objbll.DeleteBus(objbo);

            if (i == 1)
            {
                Response.Write("BUS DELETION SUCCESFULL");
            }
            else
            {
                Response.Write("FAILED");
            }
        }
Example #7
0
        protected void Login1_Authenticate(object sender, AuthenticateEventArgs e)
        {
            Businesslogiclayer.Businesslogiclayerclass objll = new Businesslogiclayer.Businesslogiclayerclass();
            Businessobjects.BusinessObjectsclass       objbo = new Businessobjects.BusinessObjectsclass();
            objbo.Username = Login1.UserName;
            objbo.Password = Login1.Password;
            int i = objll.Adminlogin(objbo);

            if (i == 1)
            {
                Response.Write("Valid User");
                Response.Redirect("Addbus.aspx");
            }
            else
            {
                Login1.FailureText = "Invalid User";
            }
        }
        protected void Button1_Click(object sender, EventArgs e)
        {
            Businessobjects.BusinessObjectsclass objbo = new Businessobjects.BusinessObjectsclass();
            objbo.pid = DropDownList2.SelectedValue.ToString();
            string s = DropDownList1.SelectedItem.ToString();

            string[] s1 = s.Split('/');
            objbo.Serviceno = s1[0].ToString();
            Businesslogiclayer.Businesslogiclayerclass objbll = new Businesslogiclayer.Businesslogiclayerclass();
            int i = objbll.Addbuspickuppoints(objbo);

            if (i == 1)
            {
                Response.Write("ADDED");
            }
            else
            {
                Response.Write("FAILED");
            }
        }