Esempio n. 1
0
    protected void btnBasicInfoSubmit_Click(object sender, EventArgs e)
    {
        DataModel.AdminDM     objDataModel     = new DataModel.AdminDM();
        BusinessLogic.AdminBL objBusinessLogic = new BusinessLogic.AdminBL();

        objDataModel._serviceNumber     = txtServiceNumber.Text.Trim();
        objDataModel._coachId           = ddlCoachType.SelectedValue.ToString();
        objDataModel._fromCityId        = ddlFromCity.SelectedValue.ToString();
        objDataModel._toCityId          = ddlToCity.SelectedValue.ToString();
        objDataModel._departureTime     = txtDepartureTime.Text;
        objDataModel._approxJourneyTime = txtApproxJourneyTime.Text;
        objDataModel._numberOfSeats     = Convert.ToInt16(txtNumberOfSeats.Text.Trim());
        objDataModel._fare = Convert.ToInt16(txtFare.Text.Trim());

        if (Convert.ToBoolean(objBusinessLogic.insertBasicServiceInfo(objDataModel)))
        {
            //inserted succesfully
            lblBasicInfoMessage.Text      = "Inserted Succesfully fill the Boarding Stop info below";
            lblBasicInfoMessage.ForeColor = System.Drawing.Color.Green;
        }
        else
        {
            lblBasicInfoMessage.Text      = "cannot Inserted try again";
            lblBasicInfoMessage.ForeColor = System.Drawing.Color.Red;
        }
    }
Esempio n. 2
0
    protected void btnBoardingStopsInsert_Click(object sender, EventArgs e)
    {
        DataModel.AdminDM objDataModel = new DataModel.AdminDM();
        BusinessLogic.AdminBL objBusinessLogic = new BusinessLogic.AdminBL();

        objDataModel._serviceNumber = txtServiceNumber.Text.Trim();
        objDataModel._fromCityId = ddlBorStop.SelectedValue.ToString();
        objDataModel._boardingStopName = txtBoardingStopName.Text.Trim();
        objDataModel._ArrivalTime = txtArrivalTime.Text.Trim();

        if (Convert.ToBoolean(objBusinessLogic.InsertBoardingStopsInfo(objDataModel)))
        {
            lblBordingMessage.Text = "Successful";
            lblBordingMessage.ForeColor = System.Drawing.Color.Green;
            dlBoardingStops.Visible = true;

            BindBordingStopsInfo();
            ClearBordingStopsTextboxes();

        }
        else
        {
            lblBordingMessage.Text = "Failed";
            lblBordingMessage.ForeColor = System.Drawing.Color.Red;
        }
    }
Esempio n. 3
0
    protected void dlCancellationDetails_UpdateCommand(object source, DataListCommandEventArgs e)
    {
        DataModel.AdminDM     objDataModel     = new DataModel.AdminDM();
        BusinessLogic.AdminBL objBusinessLogic = new BusinessLogic.AdminBL();


        TextBox txtCancel = (TextBox)e.Item.FindControl("txtCancellationPercentage");

        objDataModel._id = Convert.ToInt16(dlCancellationDetails.DataKeys[e.Item.ItemIndex]);
        objDataModel._cancellationPercent = Convert.ToInt16(txtCancel.Text.Trim());

        if (Convert.ToBoolean(objBusinessLogic.updateCancellationDetails(objDataModel)))
        {
            dlCancellationDetails.EditItemIndex = -1;
            dlCancellationDetails.DataBind();
            bindCancellationDetails();
            lblMessage.Text      = "Updated Succesfully";
            lblMessage.ForeColor = System.Drawing.Color.Green;
            lblMessage.Visible   = true;
        }
        else
        {
            lblMessage.Text      = "cannot update cancellation Percent";
            lblMessage.ForeColor = System.Drawing.Color.Red;
            lblMessage.Visible   = true;
        }
    }
Esempio n. 4
0
 protected void btnCheckAvaliblity_Click(object sender, EventArgs e)
 {
     BusinessLogic.AdminBL objBusinessLogic = new BusinessLogic.AdminBL();
     DataModel.AdminDM     objDataModel     = new DataModel.AdminDM();
     if (txtUserName.Text.Trim() != "")
     {
         objDataModel._userName = txtUserName.Text.Trim();
         if (Convert.ToBoolean(objBusinessLogic.CheckUserName(objDataModel)))
         {
             lblAvailable.Text      = "Congratulations UserName available";
             lblAvailable.ForeColor = System.Drawing.Color.Green;
             btnFinish.Visible      = true;
         }
         else
         {
             lblAvailable.Text      = "Sorry UserName not available please try another one";
             lblAvailable.ForeColor = System.Drawing.Color.Red;
         }
     }
     else
     {
         lblAvailable.Text      = "please enter a valid username";
         lblAvailable.ForeColor = System.Drawing.Color.Red;
     }
 }
Esempio n. 5
0
    protected void btnBoardingStopsInsert_Click(object sender, EventArgs e)
    {
        DataModel.AdminDM     objDataModel     = new DataModel.AdminDM();
        BusinessLogic.AdminBL objBusinessLogic = new BusinessLogic.AdminBL();


        objDataModel._serviceNumber    = txtServiceNumber.Text.Trim();
        objDataModel._fromCityId       = ddlBorStop.SelectedValue.ToString();
        objDataModel._boardingStopName = txtBoardingStopName.Text.Trim();
        objDataModel._ArrivalTime      = txtArrivalTime.Text.Trim();


        if (Convert.ToBoolean(objBusinessLogic.InsertBoardingStopsInfo(objDataModel)))
        {
            lblBordingMessage.Text      = "Successful";
            lblBordingMessage.ForeColor = System.Drawing.Color.Green;
            dlBoardingStops.Visible     = true;

            BindBordingStopsInfo();
            ClearBordingStopsTextboxes();
        }
        else
        {
            lblBordingMessage.Text      = "Failed";
            lblBordingMessage.ForeColor = System.Drawing.Color.Red;
        }
    }
Esempio n. 6
0
 protected void btnCheckAvaliblity_Click(object sender, EventArgs e)
 {
     BusinessLogic.AdminBL objBusinessLogic = new BusinessLogic.AdminBL();
     DataModel.AdminDM objDataModel = new DataModel.AdminDM();
     if (txtUserName.Text.Trim() != "")
     {
         objDataModel._userName = txtUserName.Text.Trim();
         if (Convert.ToBoolean(objBusinessLogic.CheckUserName(objDataModel)))
         {
             lblAvailable.Text = "Congratulations UserName available";
             lblAvailable.ForeColor = System.Drawing.Color.Green;
             btnFinish.Visible = true;
         }
         else
         {
             lblAvailable.Text = "Sorry UserName not available please try another one";
             lblAvailable.ForeColor = System.Drawing.Color.Red;
         }
     }
     else
     {
         lblAvailable.Text = "please enter a valid username";
         lblAvailable.ForeColor = System.Drawing.Color.Red;
     }
 }
Esempio n. 7
0
    protected void btnBasicInfoSubmit_Click(object sender, EventArgs e)
    {
        DataModel.AdminDM objDataModel = new DataModel.AdminDM();
        BusinessLogic.AdminBL objBusinessLogic = new BusinessLogic.AdminBL();

        objDataModel._serviceNumber = txtServiceNumber.Text.Trim();
        objDataModel._coachId = ddlCoachType.SelectedValue.ToString();
        objDataModel._fromCityId = ddlFromCity.SelectedValue.ToString();
        objDataModel._toCityId = ddlToCity.SelectedValue.ToString();
        objDataModel._departureTime = txtDepartureTime.Text;
        objDataModel._approxJourneyTime = txtApproxJourneyTime.Text;
        objDataModel._numberOfSeats = Convert.ToInt16(txtNumberOfSeats.Text.Trim());
        objDataModel._fare = Convert.ToInt16(txtFare.Text.Trim());

        if (Convert.ToBoolean(objBusinessLogic.insertBasicServiceInfo(objDataModel)))
        {
            //inserted succesfully
            lblBasicInfoMessage.Text = "Inserted Succesfully fill the Boarding Stop info below";
            lblBasicInfoMessage.ForeColor = System.Drawing.Color.Green;

        }
        else
        {
            lblBasicInfoMessage.Text = "cannot Inserted try again";
            lblBasicInfoMessage.ForeColor = System.Drawing.Color.Red;
        }
    }
Esempio n. 8
0
    protected void btnServiceStopInsert_Click(object sender, EventArgs e)
    {
        DataModel.AdminDM     objDataModel     = new DataModel.AdminDM();
        BusinessLogic.AdminBL objBusinessLogic = new BusinessLogic.AdminBL();

        objDataModel._serviceNumber = txtServiceNumber.Text.Trim();
        objDataModel._fromCityId    = ddlAddServiceStop.SelectedValue.ToString();
        objDataModel._departureTime = txtServiceDep.Text.Trim();
        //objDataModel._AppJourneyTimehh = Convert.ToInt16(txtApproxServiceTimehh.Text.Trim());
        //objDataModel._AppJourneyTimemm =Convert.ToInt16(txtApproxServiceTimemm.Text.Trim());
        //objDataModel._fare = Convert.ToInt16(txtSerFare.Text.Trim());

        if (Convert.ToBoolean(objBusinessLogic.InsertServiceStopsInfo(objDataModel)))
        {
            ClearServiceStopsTextboxes();
            lblSerStopMessage.Text      = "Succesful";
            lblSerStopMessage.ForeColor = System.Drawing.Color.Red;
            BindServiceStopsInfo();

            dlServiceInfo.Visible = true;
        }
        else
        {
            lblSerStopMessage.Text      = "Failed";
            lblSerStopMessage.ForeColor = System.Drawing.Color.Red;
        }
    }
    protected void dlCancellationDetails_UpdateCommand(object source, DataListCommandEventArgs e)
    {
        DataModel.AdminDM objDataModel = new DataModel.AdminDM();
        BusinessLogic.AdminBL objBusinessLogic = new BusinessLogic.AdminBL();

        TextBox txtCancel = (TextBox)e.Item.FindControl("txtCancellationPercentage");

        objDataModel._id=Convert.ToInt16( dlCancellationDetails.DataKeys[e.Item.ItemIndex]);
        objDataModel._cancellationPercent =Convert.ToInt16( txtCancel.Text.Trim());

        if (Convert.ToBoolean(objBusinessLogic.updateCancellationDetails(objDataModel)))
        {
            dlCancellationDetails.EditItemIndex = -1;
            dlCancellationDetails.DataBind();
            bindCancellationDetails();
            lblMessage.Text = "Updated Succesfully";
            lblMessage.ForeColor = System.Drawing.Color.Green;
            lblMessage.Visible = true;
        }
        else
        {
            lblMessage.Text = "cannot update cancellation Percent";
            lblMessage.ForeColor = System.Drawing.Color.Red;
            lblMessage.Visible = true;
        }
    }
Esempio n. 10
0
    protected void dlCities_UpdateCommand(object source, DataListCommandEventArgs e)
    {
        BusinessLogic.AdminBL objBusinesslogic = new BusinessLogic.AdminBL();
        DataModel.AdminDM objDataModel = new DataModel.AdminDM();

        TextBox txtCityId = (TextBox)e.Item.FindControl("txtCityId");
        TextBox txtCityName = (TextBox)e.Item.FindControl("txtCityName");

        objDataModel._id =Convert.ToInt16( dlCities.DataKeys[e.Item.ItemIndex]);
        objDataModel._cityId = txtCityId.Text.Trim();
        objDataModel._cityName = txtCityName.Text.Trim();

        if (Convert.ToBoolean(objBusinesslogic.UpdateCity(objDataModel)))
        {
            dlCities.EditItemIndex = -1;
            lblErrorMessage.Text = "Updated Succesfully";
            lblErrorMessage.ForeColor = System.Drawing.Color.Green;
            Bindcities();
        }
        else
        {
            lblErrorMessage.Text = "cannot update city";
            lblErrorMessage.ForeColor = System.Drawing.Color.Green;
        }
    }
Esempio n. 11
0
    protected void dlCities_UpdateCommand(object source, DataListCommandEventArgs e)
    {
        BusinessLogic.AdminBL objBusinesslogic = new BusinessLogic.AdminBL();
        DataModel.AdminDM     objDataModel     = new DataModel.AdminDM();

        TextBox txtCityId   = (TextBox)e.Item.FindControl("txtCityId");
        TextBox txtCityName = (TextBox)e.Item.FindControl("txtCityName");

        objDataModel._id       = Convert.ToInt16(dlCities.DataKeys[e.Item.ItemIndex]);
        objDataModel._cityId   = txtCityId.Text.Trim();
        objDataModel._cityName = txtCityName.Text.Trim();

        if (Convert.ToBoolean(objBusinesslogic.UpdateCity(objDataModel)))
        {
            dlCities.EditItemIndex    = -1;
            lblErrorMessage.Text      = "Updated Succesfully";
            lblErrorMessage.ForeColor = System.Drawing.Color.Green;
            Bindcities();
        }
        else
        {
            lblErrorMessage.Text      = "cannot update city";
            lblErrorMessage.ForeColor = System.Drawing.Color.Green;
        }
    }
Esempio n. 12
0
    private void bindCancellationDetails()
    {
        DataModel.AdminDM     objDataModel     = new DataModel.AdminDM();
        BusinessLogic.AdminBL objBusinessLogic = new BusinessLogic.AdminBL();

        objDataModel._coachId = ddlCoaches.SelectedValue;

        DataSet ds = objBusinessLogic.getCoachDetails(objDataModel);

        dlCancellationDetails.DataSource = ds.Tables[0];
        dlCancellationDetails.DataBind();
    }
Esempio n. 13
0
    private void BindBordingStopsInfo()
    {
        DataModel.AdminDM     objDataModel     = new DataModel.AdminDM();
        BusinessLogic.AdminBL objBusinessLogic = new BusinessLogic.AdminBL();

        objDataModel._serviceNumber = txtServiceNumber.Text.Trim();


        DataSet ds = objBusinessLogic.getBordingStopInfo(objDataModel);

        dlBoardingStops.DataSource = ds.Tables[0];
        dlBoardingStops.DataBind();
    }
Esempio n. 14
0
    protected void btnFinish_Click(object sender, EventArgs e)
    {
        BusinessLogic.AdminBL objBusinessLogic = new BusinessLogic.AdminBL();
        DataModel.AdminDM     objDataModel     = new DataModel.AdminDM();
        string UserId1 = GenAgentId();

        objDataModel.userId    = UserId1;
        objDataModel._userName = txtUserName.Text.Trim();
        objDataModel._password = txtPassword.Text.Trim();
        objDataModel._name     = txtName.Text.Trim();
        objDataModel._eMailId  = txtEmail.Text.Trim();
        objDataModel._mobile   = long.Parse(txtMobileNo.Text.Trim());
        if (rbtnMale.Checked)
        {
            objDataModel._gender = rbtnMale.Text;
        }
        else
        {
            objDataModel._gender = rbtnFemale.Text;
        }
        objDataModel._officeName    = txtOfficeName.Text.Trim();
        objDataModel._officeAddress = txtAddress.Text.Trim();
        if (txtLandLine.Text.Trim() == string.Empty)
        {
            objDataModel._officeLandLine = 0;
        }
        else
        {
            objDataModel._officeLandLine = long.Parse(txtLandLine.Text.Trim());
        }
        objDataModel._city = txtCity.Text.Trim();
        if (txtOfficeMobile.Text.Trim() == string.Empty)
        {
            objDataModel._mobile = 0;
        }
        else
        {
            objDataModel._mobile = long.Parse(txtOfficeMobile.Text.Trim());
        }
        objDataModel._state = ddlState.SelectedItem.ToString();
        if (Convert.ToBoolean(objBusinessLogic.insertAgent(objDataModel)))
        {
            lblMessage.Text      = "Registration succesful";
            lblMessage.ForeColor = System.Drawing.Color.Green;
        }
        else
        {
            lblMessage.Text      = "Registration unsuccesful";
            lblMessage.ForeColor = System.Drawing.Color.Red;
        }
    }
Esempio n. 15
0
    protected void dlBoardingStops_ItemCommand(object source, DataListCommandEventArgs e)
    {
        if (e.CommandName.Equals("lbtnUpdateBording_click"))
        {
            int id = Convert.ToInt16(dlBoardingStops.DataKeys[e.Item.ItemIndex]);

            DropDownList ddlBorStopEdit  = (DropDownList)e.Item.FindControl("ddlBorStopEdit");
            TextBox      txtBoardingStop = (TextBox)e.Item.FindControl("txtBoardingStopNameEdit");
            TextBox      txtArrival      = (TextBox)e.Item.FindControl("txtArrivalTimeEdit");



            DataModel.AdminDM     objDataModel     = new DataModel.AdminDM();
            BusinessLogic.AdminBL objBusinessLogic = new BusinessLogic.AdminBL();

            objDataModel._id               = id;
            objDataModel._fromCityId       = ddlBorStopEdit.SelectedValue.ToString();
            objDataModel._boardingStopName = txtBoardingStop.Text.Trim();
            objDataModel._ArrivalTime      = txtArrival.Text.Trim();


            if (Convert.ToBoolean(objBusinessLogic.UpdateBoardingStopsInfo(objDataModel)))
            {
                dlBoardingStops.EditItemIndex = -1;
                BindBordingStopsInfo();
            }
        }
        if (e.CommandName.Equals("lbtnDeleteBording_click"))
        {
            int id = Convert.ToInt16(dlBoardingStops.DataKeys[e.Item.ItemIndex]);
            DataModel.AdminDM     objDataModel     = new DataModel.AdminDM();
            BusinessLogic.AdminBL objBusinessLogic = new BusinessLogic.AdminBL();

            objDataModel._id = id;
            if (Convert.ToBoolean(objBusinessLogic.DeleteBoardingStopsInfo(objDataModel)))
            {
                dlBoardingStops.EditItemIndex = -1;
                BindBordingStopsInfo();
            }
        }

        if (e.CommandName.Equals("lbtnCancel_click"))
        {
            dlBoardingStops.EditItemIndex = -1;
            BindBordingStopsInfo();
        }
    }
Esempio n. 16
0
    protected void dlCoaches_UpdateCommand(object source, DataListCommandEventArgs e)
    {
        TextBox txtCoachId      = (TextBox)e.Item.FindControl("txtCoachId");
        TextBox txtCoachName    = (TextBox)e.Item.FindControl("txtCoachName");
        TextBox txtPerAgent     = (TextBox)e.Item.FindControl("txtPerAgent");
        TextBox txtTotalCoaches = (TextBox)e.Item.FindControl("txtTotalNoOnCoaches");

        DataModel.AdminDM     objDataModel     = new DataModel.AdminDM();
        BusinessLogic.AdminBL objBusinessLogic = new BusinessLogic.AdminBL();

        objDataModel._id        = Convert.ToInt16(dlCoaches.DataKeys[e.Item.ItemIndex]);
        objDataModel._coachId   = txtCoachId.Text;
        objDataModel._coachName = txtCoachName.Text;
        if (txtPerAgent.Text == "")
        {
            objDataModel._perAgent = 0;
        }
        else
        {
            objDataModel._perAgent = Convert.ToInt16(txtPerAgent.Text);
        }
        if (txtPerAgent.Text == "")
        {
            objDataModel._totalCoaches = 0;
        }
        else
        {
            objDataModel._totalCoaches = Convert.ToInt16(txtTotalCoaches.Text);
        }

        if (Convert.ToBoolean(objBusinessLogic.UpdateCoach(objDataModel)))
        {
            dlCoaches.EditItemIndex   = -1;
            lblErrorMessage.Text      = "Updated Succesfully";
            lblErrorMessage.ForeColor = System.Drawing.Color.Green;
            lblErrorMessage.Visible   = true;
            BindCoaches();
        }
        else
        {
            lblErrorMessage.Text      = "Cannot Update Coaches";
            lblErrorMessage.ForeColor = System.Drawing.Color.Red;
            lblErrorMessage.Visible   = true;
        }
    }
Esempio n. 17
0
    private void BindServiceStopsInfo()
    {
        DataModel.AdminDM     objDataModel     = new DataModel.AdminDM();
        BusinessLogic.AdminBL objBusinessLogic = new BusinessLogic.AdminBL();

        objDataModel._serviceNumber = txtServiceNumber.Text.Trim();


        DataSet ds = objBusinessLogic.getServiceStopInfo(objDataModel);

        //DataTable dt = new DataTable();

        //dt = ds.Tables[0];
        //pds.DataSource = dt.DefaultView;
        //ds.PageSize = 15;
        dlServiceInfo.DataSource = ds.Tables[0];
        dlServiceInfo.DataBind();
    }
Esempio n. 18
0
    protected void btnCheck_Click(object sender, EventArgs e)
    {
        DataModel.AdminDM     objDataModel     = new DataModel.AdminDM();
        BusinessLogic.AdminBL objBusinessLogic = new BusinessLogic.AdminBL();

        objDataModel._serviceNumber = txtServiceNumber.Text.Trim();

        if (Convert.ToInt16(objBusinessLogic.CheckServiceNumber(objDataModel)) == 1)
        {
            lblSvcNoMessage.Text      = "available";
            lblSvcNoMessage.ForeColor = System.Drawing.Color.Green;
        }
        else
        {
            lblSvcNoMessage.Text      = "This Service number is in use";
            lblSvcNoMessage.ForeColor = System.Drawing.Color.Red;
        }
    }
Esempio n. 19
0
    protected void btnCheck_Click(object sender, EventArgs e)
    {
        DataModel.AdminDM objDataModel = new DataModel.AdminDM();
        BusinessLogic.AdminBL objBusinessLogic = new BusinessLogic.AdminBL();

        objDataModel._serviceNumber = txtServiceNumber.Text.Trim();

        if (Convert.ToInt16(objBusinessLogic.CheckServiceNumber(objDataModel))==1)
        {
            lblSvcNoMessage.Text = "available";
            lblSvcNoMessage.ForeColor = System.Drawing.Color.Green;
        }
        else
        {
            lblSvcNoMessage.Text = "This Service number is in use";
            lblSvcNoMessage.ForeColor = System.Drawing.Color.Red;
        }
    }
Esempio n. 20
0
    protected void btnFinish_Click(object sender, EventArgs e)
    {
        BusinessLogic.AdminBL objBusinessLogic = new BusinessLogic.AdminBL();
        DataModel.AdminDM objDataModel = new DataModel.AdminDM();
        string UserId1=GenAgentId();
        objDataModel.userId = UserId1;
        objDataModel._userName = txtUserName.Text.Trim();
        objDataModel._password = txtPassword.Text.Trim();
        objDataModel._name = txtName.Text.Trim();
        objDataModel._eMailId = txtEmail.Text.Trim();
        objDataModel._mobile = long.Parse(txtMobileNo.Text.Trim());
        if (rbtnMale.Checked)
        {
            objDataModel._gender = rbtnMale.Text;
        }
        else
        {
            objDataModel._gender = rbtnFemale.Text;
        }
        objDataModel._officeName = txtOfficeName.Text.Trim();
        objDataModel._officeAddress = txtAddress.Text.Trim();
        if (txtLandLine.Text.Trim() == string.Empty)
            objDataModel._officeLandLine = 0;
        else
        objDataModel._officeLandLine =long.Parse( txtLandLine.Text.Trim());
        objDataModel._city=txtCity.Text.Trim();
        if (txtOfficeMobile.Text.Trim() == string.Empty)
            objDataModel._mobile = 0;
        else
            objDataModel._mobile = long.Parse(txtOfficeMobile.Text.Trim());
        objDataModel._state = ddlState.SelectedItem.ToString();
        if (Convert.ToBoolean(objBusinessLogic.insertAgent(objDataModel)))
        {
            lblMessage.Text = "Registration succesful";
            lblMessage.ForeColor = System.Drawing.Color.Green;

        }
        else
        {

            lblMessage.Text = "Registration unsuccesful";
            lblMessage.ForeColor = System.Drawing.Color.Red;
        }
    }
Esempio n. 21
0
    protected void dlServiceInfo_ItemCommand(object source, DataListCommandEventArgs e)
    {
        if (e.CommandName.Equals("lbtnUpdateService_click"))
        {
            DropDownList ddlAddServiceStop = (DropDownList)e.Item.FindControl("ddlAddServiceStopEdit");
            TextBox      txtServiceDep     = (TextBox)e.Item.FindControl("txtServiceDepEdit");

            DataModel.AdminDM     objDataModel     = new DataModel.AdminDM();
            BusinessLogic.AdminBL objBusinessLogic = new BusinessLogic.AdminBL();

            objDataModel._id            = Convert.ToInt16(Convert.ToInt16(dlServiceInfo.DataKeys[e.Item.ItemIndex]));
            objDataModel._departureTime = txtServiceDep.Text.ToString();
            objDataModel._fromCityId    = ddlAddServiceStop.SelectedValue.ToString();

            if (Convert.ToBoolean(objBusinessLogic.UpdateServiceStopsInfo(objDataModel)))
            {
                dlServiceInfo.EditItemIndex = -1;
                dlServiceInfo.DataBind();
                BindServiceStopsInfo();
            }
        }
        if (e.CommandName.Equals("lbtnDeleteService_click"))
        {
            int id = Convert.ToInt16(dlServiceInfo.DataKeys[e.Item.ItemIndex]);
            DataModel.AdminDM     objDataModel     = new DataModel.AdminDM();
            BusinessLogic.AdminBL objBusinessLogic = new BusinessLogic.AdminBL();

            objDataModel._id = id;
            if (Convert.ToBoolean(objBusinessLogic.DeleteServiceStopsInfo(objDataModel)))
            {
                dlServiceInfo.EditItemIndex = -1;
                dlServiceInfo.DataBind();
                BindServiceStopsInfo();
            }
        }
        if (e.CommandName.Equals("lbtnCancelService_click"))
        {
            dlServiceInfo.EditItemIndex = -1;
            dlServiceInfo.DataBind();
            BindServiceStopsInfo();
        }
    }
Esempio n. 22
0
    public string GenAgentId()
    {
        string userid;

        Random ran = new Random();
        int num = ran.Next(100000);

        userid = "agn" + num.ToString();

        BusinessLogic.AdminBL objBusinessLogic = new BusinessLogic.AdminBL();
        DataModel.AdminDM objDataModel = new DataModel.AdminDM();
        objDataModel._userId = userid;

        if (objBusinessLogic.CheckUserId(objDataModel) == 0)
        {
            GenAgentId();
        }

        return userid;
    }
Esempio n. 23
0
    public string GenAgentId()
    {
        string userid;

        Random ran = new Random();
        int    num = ran.Next(100000);

        userid = "agn" + num.ToString();

        BusinessLogic.AdminBL objBusinessLogic = new BusinessLogic.AdminBL();
        DataModel.AdminDM     objDataModel     = new DataModel.AdminDM();
        objDataModel._userId = userid;

        if (objBusinessLogic.CheckUserId(objDataModel) == 0)
        {
            GenAgentId();
        }

        return(userid);
    }
Esempio n. 24
0
    protected void btnAdd_Click(object sender, EventArgs e)
    {
        DataModel.AdminDM objDataModel = new DataModel.AdminDM();
        BusinessLogic.AdminBL objBusinessLogic = new BusinessLogic.AdminBL();

            objDataModel._coachId = txtCoachIDFooter.Text.Trim();
            objDataModel._coachName = txtCoachName.Text.Trim();
            objDataModel._perAgent = Convert.ToInt16(txtperAgentFooter.Text.Trim());
            objDataModel._totalCoaches = Convert.ToInt16(txtTotalCoachesFooter.Text.Trim());
            if (Convert.ToBoolean(objBusinessLogic.insertCoach(objDataModel)))
            {
                lblErrorMessage.Visible = true;
                lblErrorMessage.Text = "Inserted Succesfully";

                txtCoachIDFooter.Text = "" ;
                txtCoachName.Text="";
                txtperAgentFooter.Text = "";
                txtTotalCoachesFooter.Text = "";
                BindCoaches();

            }
    }
Esempio n. 25
0
    protected void dlCoaches_UpdateCommand(object source, DataListCommandEventArgs e)
    {
        TextBox txtCoachId = (TextBox)e.Item.FindControl("txtCoachId");
        TextBox txtCoachName = (TextBox)e.Item.FindControl("txtCoachName");
        TextBox txtPerAgent = (TextBox)e.Item.FindControl("txtPerAgent");
        TextBox txtTotalCoaches= (TextBox)e.Item.FindControl("txtTotalNoOnCoaches");

        DataModel.AdminDM objDataModel = new DataModel.AdminDM();
        BusinessLogic.AdminBL objBusinessLogic = new BusinessLogic.AdminBL();

        objDataModel._id =Convert.ToInt16( dlCoaches.DataKeys[e.Item.ItemIndex]);
        objDataModel._coachId = txtCoachId.Text;
        objDataModel._coachName = txtCoachName.Text;
        if (txtPerAgent.Text == "")
            objDataModel._perAgent = 0;
        else
        objDataModel._perAgent = Convert.ToInt16(txtPerAgent.Text);
        if (txtPerAgent.Text == "")
            objDataModel._totalCoaches = 0;
        else
        objDataModel._totalCoaches = Convert.ToInt16(txtTotalCoaches.Text);

        if (Convert.ToBoolean(objBusinessLogic.UpdateCoach(objDataModel)))
        {
            dlCoaches.EditItemIndex = -1;
            lblErrorMessage.Text = "Updated Succesfully";
            lblErrorMessage.ForeColor = System.Drawing.Color.Green;
            lblErrorMessage.Visible = true;
            BindCoaches();

        }
        else
        {
            lblErrorMessage.Text = "Cannot Update Coaches";
            lblErrorMessage.ForeColor = System.Drawing.Color.Red;
            lblErrorMessage.Visible = true;
        }
    }
Esempio n. 26
0
    protected void btnAdd_Click(object sender, EventArgs e)
    {
        DataModel.AdminDM     objDataModel     = new DataModel.AdminDM();
        BusinessLogic.AdminBL objBusinessLogic = new BusinessLogic.AdminBL();



        objDataModel._coachId      = txtCoachIDFooter.Text.Trim();
        objDataModel._coachName    = txtCoachName.Text.Trim();
        objDataModel._perAgent     = Convert.ToInt16(txtperAgentFooter.Text.Trim());
        objDataModel._totalCoaches = Convert.ToInt16(txtTotalCoachesFooter.Text.Trim());
        if (Convert.ToBoolean(objBusinessLogic.insertCoach(objDataModel)))
        {
            lblErrorMessage.Visible = true;
            lblErrorMessage.Text    = "Inserted Succesfully";

            txtCoachIDFooter.Text      = "";
            txtCoachName.Text          = "";
            txtperAgentFooter.Text     = "";
            txtTotalCoachesFooter.Text = "";
            BindCoaches();
        }
    }
Esempio n. 27
0
    protected void btnInsert_Click(object sender, EventArgs e)
    {
        BusinessLogic.AdminBL objBusinessLogic = new BusinessLogic.AdminBL();
        DataModel.AdminDM objDataModel = new DataModel.AdminDM();

        objDataModel._cityId = txtCityId.Text.Trim();
        objDataModel._cityName = txtCityName.Text.Trim();

        if (Convert.ToBoolean(objBusinessLogic.insertCity(objDataModel)))
        {
            Bindcities();
            lblErrorMessage.Text = "Inserted Succesfully";
            lblErrorMessage.ForeColor = System.Drawing.Color.Green;
            lblErrorMessage.Visible = true;
            txtCityId.Text = "";
            txtCityName.Text = "";
        }
        else
        {
            lblErrorMessage.Text = "Cannot Insert";
            lblErrorMessage.ForeColor = System.Drawing.Color.Red;
            lblErrorMessage.Visible = true;
        }
    }
Esempio n. 28
0
    protected void btnInsert_Click(object sender, EventArgs e)
    {
        BusinessLogic.AdminBL objBusinessLogic = new BusinessLogic.AdminBL();
        DataModel.AdminDM     objDataModel     = new DataModel.AdminDM();

        objDataModel._cityId   = txtCityId.Text.Trim();
        objDataModel._cityName = txtCityName.Text.Trim();

        if (Convert.ToBoolean(objBusinessLogic.insertCity(objDataModel)))
        {
            Bindcities();
            lblErrorMessage.Text      = "Inserted Succesfully";
            lblErrorMessage.ForeColor = System.Drawing.Color.Green;
            lblErrorMessage.Visible   = true;
            txtCityId.Text            = "";
            txtCityName.Text          = "";
        }
        else
        {
            lblErrorMessage.Text      = "Cannot Insert";
            lblErrorMessage.ForeColor = System.Drawing.Color.Red;
            lblErrorMessage.Visible   = true;
        }
    }
    private void bindCancellationDetails()
    {
        DataModel.AdminDM objDataModel = new DataModel.AdminDM();
        BusinessLogic.AdminBL objBusinessLogic = new BusinessLogic.AdminBL();

        objDataModel._coachId = ddlCoaches.SelectedValue;

        DataSet ds = objBusinessLogic.getCoachDetails(objDataModel);

        dlCancellationDetails.DataSource = ds.Tables[0];
        dlCancellationDetails.DataBind();
    }
Esempio n. 30
0
 public DataSet cityDataSet()
 {
     DataModel.AdminDM     objDataModel     = new DataModel.AdminDM();
     BusinessLogic.AdminBL objBusinessLogic = new BusinessLogic.AdminBL();
     return(objBusinessLogic.ddlCityList());
 }
Esempio n. 31
0
    protected void btnServiceStopInsert_Click(object sender, EventArgs e)
    {
        DataModel.AdminDM objDataModel = new DataModel.AdminDM();
        BusinessLogic.AdminBL objBusinessLogic = new BusinessLogic.AdminBL();

        objDataModel._serviceNumber = txtServiceNumber.Text.Trim();
        objDataModel._fromCityId = ddlAddServiceStop.SelectedValue.ToString();
        objDataModel._departureTime = txtServiceDep.Text.Trim();
        //objDataModel._AppJourneyTimehh = Convert.ToInt16(txtApproxServiceTimehh.Text.Trim());
        //objDataModel._AppJourneyTimemm =Convert.ToInt16(txtApproxServiceTimemm.Text.Trim());
        //objDataModel._fare = Convert.ToInt16(txtSerFare.Text.Trim());

        if (Convert.ToBoolean(objBusinessLogic.InsertServiceStopsInfo(objDataModel)))
        {
            ClearServiceStopsTextboxes();
            lblSerStopMessage.Text = "Succesful";
            lblSerStopMessage.ForeColor = System.Drawing.Color.Red;
            BindServiceStopsInfo();

            dlServiceInfo.Visible = true;

        }
        else
        {
            lblSerStopMessage.Text = "Failed";
            lblSerStopMessage.ForeColor = System.Drawing.Color.Red;
        }
    }
Esempio n. 32
0
    protected void dlBoardingStops_ItemCommand(object source, DataListCommandEventArgs e)
    {
        if(e.CommandName.Equals("lbtnUpdateBording_click"))
        {
            int id =Convert.ToInt16(dlBoardingStops.DataKeys[e.Item.ItemIndex]);

            DropDownList ddlBorStopEdit = (DropDownList)e.Item.FindControl("ddlBorStopEdit");
            TextBox txtBoardingStop = (TextBox)e.Item.FindControl("txtBoardingStopNameEdit");
            TextBox txtArrival = (TextBox)e.Item.FindControl("txtArrivalTimeEdit");

            DataModel.AdminDM objDataModel = new DataModel.AdminDM();
            BusinessLogic.AdminBL objBusinessLogic = new BusinessLogic.AdminBL();

            objDataModel._id = id;
            objDataModel._fromCityId = ddlBorStopEdit.SelectedValue.ToString();
            objDataModel._boardingStopName = txtBoardingStop.Text.Trim();
            objDataModel._ArrivalTime = txtArrival.Text.Trim();

            if (Convert.ToBoolean(objBusinessLogic.UpdateBoardingStopsInfo(objDataModel)))
            {
                dlBoardingStops.EditItemIndex = -1;
                BindBordingStopsInfo();

            }

        }
        if (e.CommandName.Equals("lbtnDeleteBording_click"))
        {
            int id = Convert.ToInt16(dlBoardingStops.DataKeys[e.Item.ItemIndex]);
            DataModel.AdminDM objDataModel = new DataModel.AdminDM();
            BusinessLogic.AdminBL objBusinessLogic = new BusinessLogic.AdminBL();

            objDataModel._id = id;
            if (Convert.ToBoolean(objBusinessLogic.DeleteBoardingStopsInfo(objDataModel)))
            {
                dlBoardingStops.EditItemIndex = -1;
                BindBordingStopsInfo();

            }

        }

        if (e.CommandName.Equals("lbtnCancel_click"))
        {
            dlBoardingStops.EditItemIndex = -1;
            BindBordingStopsInfo();
        }
    }
Esempio n. 33
0
    private void BindServiceStopsInfo()
    {
        DataModel.AdminDM objDataModel = new DataModel.AdminDM();
        BusinessLogic.AdminBL objBusinessLogic = new BusinessLogic.AdminBL();

        objDataModel._serviceNumber = txtServiceNumber.Text.Trim();

        DataSet ds = objBusinessLogic.getServiceStopInfo(objDataModel);
        //DataTable dt = new DataTable();

        //dt = ds.Tables[0];
        //pds.DataSource = dt.DefaultView;
        //ds.PageSize = 15;
        dlServiceInfo.DataSource = ds.Tables[0];
        dlServiceInfo.DataBind();
    }
Esempio n. 34
0
    private void BindBordingStopsInfo()
    {
        DataModel.AdminDM objDataModel = new DataModel.AdminDM();
        BusinessLogic.AdminBL objBusinessLogic = new BusinessLogic.AdminBL();

        objDataModel._serviceNumber = txtServiceNumber.Text.Trim();

        DataSet ds = objBusinessLogic.getBordingStopInfo(objDataModel);

        dlBoardingStops.DataSource = ds.Tables[0];
        dlBoardingStops.DataBind();
    }
Esempio n. 35
0
 public DataSet cityDataSet()
 {
     DataModel.AdminDM objDataModel = new DataModel.AdminDM();
     BusinessLogic.AdminBL objBusinessLogic = new BusinessLogic.AdminBL();
     return (objBusinessLogic.ddlCityList());
 }
Esempio n. 36
0
    protected void dlServiceInfo_ItemCommand(object source, DataListCommandEventArgs e)
    {
        if (e.CommandName.Equals("lbtnUpdateService_click"))
        {

            DropDownList ddlAddServiceStop = (DropDownList)e.Item.FindControl("ddlAddServiceStopEdit");
            TextBox txtServiceDep = (TextBox)e.Item.FindControl("txtServiceDepEdit");

            DataModel.AdminDM objDataModel = new DataModel.AdminDM();
            BusinessLogic.AdminBL objBusinessLogic = new BusinessLogic.AdminBL();

            objDataModel._id =Convert.ToInt16(Convert.ToInt16(dlServiceInfo.DataKeys[e.Item.ItemIndex]));
            objDataModel._departureTime = txtServiceDep.Text.ToString();
            objDataModel._fromCityId = ddlAddServiceStop.SelectedValue.ToString();

            if (Convert.ToBoolean(objBusinessLogic.UpdateServiceStopsInfo(objDataModel)))
            {
                dlServiceInfo.EditItemIndex = -1;
                dlServiceInfo.DataBind();
                BindServiceStopsInfo();

            }

        }
        if (e.CommandName.Equals("lbtnDeleteService_click"))
        {
            int id =Convert.ToInt16(dlServiceInfo.DataKeys[e.Item.ItemIndex]);
            DataModel.AdminDM objDataModel = new DataModel.AdminDM();
            BusinessLogic.AdminBL objBusinessLogic = new BusinessLogic.AdminBL();

            objDataModel._id = id;
            if (Convert.ToBoolean(objBusinessLogic.DeleteServiceStopsInfo(objDataModel)))
            {
                dlServiceInfo.EditItemIndex = -1;
                dlServiceInfo.DataBind();
                BindServiceStopsInfo();
            }

        }
        if (e.CommandName.Equals("lbtnCancelService_click"))
        {
            dlServiceInfo.EditItemIndex = -1;
            dlServiceInfo.DataBind();
            BindServiceStopsInfo();
        }
    }