예제 #1
0
    protected void radAppointment_FormCreated(object sender, SchedulerFormCreatedEventArgs e)
    {
        if (e.Container.Mode == SchedulerFormMode.AdvancedInsert)
        {
            //Redirecionar para a tela de tarefa já com data e horário setados e mandando o
            //id de ordem de serviço


            string url = "Task.aspx?StartDate=" + e.Appointment.Start + "&EndDate=" + e.Appointment.End + "&app=true";

            if (serviceOrderId.HasValue)
            {
                url = url + "&ServiceOrderId=" + Request["ServiceOrderId"];
            }

            Response.Redirect(url);
        }

        if (e.Container.Mode == SchedulerFormMode.AdvancedEdit)
        {
            var    taskManager = new TaskManager(this);
            string redirect    = "Task.aspx?TaskId=" + taskManager.GetTask((int)e.Appointment.ID).TaskId;

            Response.Redirect(redirect);
        }
    }
        protected void ScheduleList_FormCreated(object sender, SchedulerFormCreatedEventArgs e)
        {
            if (e.Container.Mode == SchedulerFormMode.Insert)
            {
                RadDropDownList tempActivityList = (RadDropDownList)e.Container.FindControl("ActivityList");
                tempActivityList.Items.Clear();

                var activitylist = GetActivityList();

                foreach (var item in activitylist)
                {
                    tempActivityList.Items.Add(new DropDownListItem {
                        Text = $"{item.VolunteerFullName} ({item.ActivityName})", Value = item.Id.ToString()
                    });
                }
            }

            if (e.Container.Mode == SchedulerFormMode.Edit)
            {
                RadDropDownList tempActivityList = (RadDropDownList)e.Container.FindControl("ActivityList");
                tempActivityList.Items.Clear();

                var activitylist = GetActivityList();

                foreach (var item in activitylist)
                {
                    tempActivityList.Items.Add(new DropDownListItem {
                        Text = $"{item.VolunteerFullName} ({item.ActivityName})", Value = item.Id.ToString()
                    });
                }

                var selectedAppointment = AppointmentList.Single(p => p.ID == e.Appointment.ID.ToString());

                if (selectedAppointment != null)
                {
                    var projectDetailActivity = selectedAppointment.Resources.SingleOrDefault(p => p.Key.ToString() == "ProjectDetailActivityId");

                    if (projectDetailActivity != null)
                    {
                        tempActivityList.SelectedValue = projectDetailActivity.Text;
                    }
                }

                RadTimePicker tempStartTime = (RadTimePicker)e.Container.FindControl("StartTime");
                tempStartTime.SelectedTime = new TimeSpan(e.Container.Appointment.Start.Hour, e.Container.Appointment.Start.Minute, e.Container.Appointment.Start.Second);

                RadTimePicker tempEndTime = (RadTimePicker)e.Container.FindControl("EndTime");
                tempEndTime.SelectedTime = new TimeSpan(e.Container.Appointment.End.Hour, e.Container.Appointment.End.Minute, e.Container.Appointment.End.Second);
            }
        }
예제 #3
0
        protected void RadScheduler1_FormCreated(object sender, SchedulerFormCreatedEventArgs e)
        {
            string UserID = (string)Session["UserID"].ToString();
            //string UserID = "27276";
            string CongTy = "LTY";

            if (UserID == null)
            {
                Response.Redirect("http://portal.footgear.com.vn/");
            }
            else
            {
                if (e.Container.Mode == SchedulerFormMode.Insert)
                {
                    Status = "Insert";
                }
                if (e.Container.Mode == SchedulerFormMode.AdvancedInsert)
                {
                    Status = "AdvancedInsert";
                    RadDateTimePicker startInput = (RadDateTimePicker)e.Container.FindControl("StartInput");
                    RadDateTimePicker endInput   = (RadDateTimePicker)e.Container.FindControl("EndInput");
                    startInput.SelectedDate = e.Appointment.Start;
                    endInput.SelectedDate   = e.Appointment.End;
                }

                if (e.Container.Mode == SchedulerFormMode.AdvancedEdit)
                {
                    HiddenField hdffID = ((HiddenField)e.Container.FindControl("hdfID"));
                    hdffID.Value = e.Appointment.ID.ToString();
                    DataTable dt         = dal.LayDanhSachTheoNguoiTaoTheoID(UserID, int.Parse(hdffID.Value));
                    TextBox   subjectBox = (TextBox)e.Container.FindControl("SubjectTextBox");
                    subjectBox.Text = e.Appointment.Subject;
                    RadDateTimePicker startInput = (RadDateTimePicker)e.Container.FindControl("StartInput");
                    startInput.SelectedDate = RadScheduler1.DisplayToUtc(e.Appointment.Start);
                    RadDateTimePicker endInput = (RadDateTimePicker)e.Container.FindControl("EndInput");
                    endInput.SelectedDate = RadScheduler1.DisplayToUtc(e.Appointment.End);

                    RadTextBox txtDescription = (RadTextBox)e.Container.FindControl("txtDescription");
                    txtDescription.Text = e.Appointment.Description;
                    RadTextBox        txtLink     = (RadTextBox)e.Container.FindControl("txtLink");
                    RadNumericTextBox txtPhanTram = (RadNumericTextBox)e.Container.FindControl("txtPhanTram");
                    OCanlendar        objec       = new OCanlendar();
                    txtLink.Text     = dt.Rows[0]["wklink"].ToString();
                    txtPhanTram.Text = dt.Rows[0]["jobpercent"].ToString();
                }
            }
        }
예제 #4
0
 protected void RadScheduler1_FormCreated(object sender, SchedulerFormCreatedEventArgs e)
 {
     // Disable the LastModified textbox in the advanced form
     if (e.Container.Mode == SchedulerFormMode.AdvancedEdit || e.Container.Mode == SchedulerFormMode.AdvancedInsert)
     {
         RadTextBox txtModifiedTimeStamp = e.Container.FindControl("AttrLastModified") as RadTextBox;
         if (txtModifiedTimeStamp != null)
         {
             txtModifiedTimeStamp.Enabled = false;
         }
     }
     // Disable the Annotations textbox in the advanced form
     if (e.Container.Mode == SchedulerFormMode.AdvancedEdit || e.Container.Mode == SchedulerFormMode.AdvancedInsert)
     {
         RadTextBox txtAnnotations = e.Container.FindControl("AttrAnnotations") as RadTextBox;
         if (txtAnnotations != null)
         {
             txtAnnotations.Enabled = false;
         }
     }
 }
    protected void radAppointment_FormCreated(object sender, SchedulerFormCreatedEventArgs e)
    {
        if (e.Container.Mode == SchedulerFormMode.AdvancedInsert)
        {
            //Redirecionar para a tela de tarefa já com data e horário setados e mandando o 
            //id de ordem de serviço


            string url = "Task.aspx?StartDate=" + e.Appointment.Start + "&EndDate=" + e.Appointment.End + "&app=true";

            if (serviceOrderId.HasValue)
                url = url + "&ServiceOrderId=" + Request["ServiceOrderId"];

            Response.Redirect(url);
        }

        if (e.Container.Mode == SchedulerFormMode.AdvancedEdit)
        {
            var taskManager = new TaskManager(this);
            string redirect = "Task.aspx?TaskId=" + taskManager.GetTask((int)e.Appointment.ID).TaskId;

            Response.Redirect(redirect);
        }
    }
        protected void tkrsVacations_FormCreated(object sender, SchedulerFormCreatedEventArgs e)
        {
            if (e.Container.Mode == SchedulerFormMode.Edit)
            {
                int vacationId = Convert.ToInt32(e.Appointment.ID);

                vacationsInformationTDS = (VacationsInformationTDS)Session["vacationsInformationTDS"];
                vacationDaysInformation = (VacationsInformationTDS.DaysInformationDataTable)Session["vacationDaysInformation"];

                VacationsInformationDaysInformationGateway vacationsInformationDaysInformationGateway = new VacationsInformationDaysInformationGateway(vacationsInformationTDS);
                string paymentType = vacationsInformationDaysInformationGateway.GetPaymentType(vacationId);

                RadioButtonList rbtnPaymentType = (RadioButtonList)e.Container.FindControl("rbtnPaymentType");
                rbtnPaymentType.SelectedValue = paymentType;
            }
        }