Esempio n. 1
0
    void btnOK_Click(object sender, EventArgs e)
    {
        Orchestrator.Entities.DriverType dt = null;
        if (this.VS_DriverType != null)
        {
            dt = this.VS_DriverType;
        }
        else
        {
            dt = new DriverType();
        }

        dt.Description = txtDescription.Text;
        dt.Monday      = chkMonday.Checked;
        dt.Tuesday     = chkTuesday.Checked;
        dt.Wednesday   = chkWednesday.Checked;
        dt.Thursday    = chkThursday.Checked;
        dt.Friday      = chkFriday.Checked;
        dt.Saturday    = chkSaturday.Checked;
        dt.Sunday      = chkSunday.Checked;
        dt.StartTime   = rtpStartTime.SelectedDate.Value;
        dt.FinishTime  = rtpFinishTime.SelectedDate.Value;

        Orchestrator.Facade.IDriver facDriver = new Orchestrator.Facade.Resource();
        int retVal = facDriver.UpdateDriverType(dt, this.Page.User.Identity.Name);

        if (retVal > 0)
        {
            InjectScript.Text = @"<script>RefreshParentPage();</script>";
            return;
        }

        lblError.Visible = true;
        lblError.Text    = "There was an error please try again.";
    }
Esempio n. 2
0
    private void LoadDriverType()
    {
        Orchestrator.Facade.IDriver      facDriver = new Orchestrator.Facade.Resource();
        Orchestrator.Entities.DriverType dt        = facDriver.GetDriverType(_driverTypeID);

        this.VS_DriverType         = dt;
        txtDescription.Text        = dt.Description;
        chkMonday.Checked          = dt.Monday;
        chkTuesday.Checked         = dt.Tuesday;
        chkWednesday.Checked       = dt.Wednesday;
        chkThursday.Checked        = dt.Thursday;
        chkFriday.Checked          = dt.Friday;
        chkSaturday.Checked        = dt.Saturday;
        chkSunday.Checked          = dt.Sunday;
        rtpStartTime.SelectedDate  = dt.StartTime == DateTime.MinValue ? DateTime.Now.Date : dt.StartTime;
        rtpFinishTime.SelectedDate = dt.FinishTime == DateTime.MinValue ? DateTime.Now.Date : dt.FinishTime;
    }