Esempio n. 1
0
 protected void RadScheduler1_AppointmentCommand(object sender, AppointmentCommandEventArgs e)
 {
     if (e.CommandName == "Cancel")
     {
         RadScheduler1.Rebind();
     }
 }
    protected void RadScheduler1_AppointmentCommand(object sender, AppointmentCommandEventArgs e)
    {
        if (e.CommandName == "Unschedule")
        {
            int id = (int)e.Container.Appointment.ID;

            string subject = "testing";
            if (!string.IsNullOrEmpty(e.Container.Appointment.Attributes["Subject"]))
                subject = e.Container.Appointment.Attributes["Subject"];

            UnscheduleAppointment(id, subject);
            RadScheduler1.Rebind();
            RadGrid1.Rebind();

            RadAjaxManager1.AjaxSettings.AddAjaxSetting(RadScheduler1, RadGrid1);
        }
    }
 protected void RadScheduler1_AppointmentCommand(object sender, AppointmentCommandEventArgs e)
 {
     if (e.CommandName == "Insert" || e.CommandName == "Update")
     {
         Guid tournamentId = new Guid(Request.QueryString["TournamentId"].ToString());
         DropDownList ddlPlayerA = e.Container.FindControl("ddlPlayerA") as DropDownList;
         DropDownList ddlPlayerB = e.Container.FindControl("ddlPlayerB") as DropDownList;
         RadTimePicker startDate = e.Container.FindControl("RadTimePicker1") as RadTimePicker;
         DateTime startFullDate = e.Container.Appointment.Start;
         DateTime selectedTime = startDate.SelectedDate.Value;
         DateTime sd = new DateTime(startFullDate.Year, startFullDate.Month, startFullDate.Day, selectedTime.Hour, selectedTime.Minute, selectedTime.Second);
         DateTime ed = sd.AddMinutes(15);
         Guid ddlPlayerAGuid = new Guid(ddlPlayerA.SelectedValue);
         Guid ddlPlayerBGuid = new Guid(ddlPlayerB.SelectedValue);
         string subject = string.Format("{0} vs. {1}", ddlPlayerA.SelectedItem.Text, ddlPlayerB.SelectedItem.Text);
         //SchedulesBL.ScheduleInsert(tournamentId, ddlPlayerAGuid, ddlPlayerBGuid, sd, ed);
     }
 }
 protected void InstructionalPlanScheduler_AppointmentCommand(object sender, AppointmentCommandEventArgs e)
 {
     if (e.CommandName == "Export")
     {
         WriteCalendar(RadScheduler.ExportToICalendar(e.Container.Appointment));
     }
 }
Esempio n. 5
0
 protected void RadScheduler1_AppointmentCommand(object sender, AppointmentCommandEventArgs e)
 {
 }
        protected void tkrsVacations_AppointmentCommand(object sender, AppointmentCommandEventArgs e)
        {
            Page.Validate();

            if (Page.IsValid)
            {
                if (e.CommandName == "Insert" || e.CommandName == "Update")
                {
                    RadioButtonList rbtnPaymentType = (RadioButtonList)e.Container.FindControl("rbtnPaymentType");
                    e.Container.Appointment.Subject = rbtnPaymentType.SelectedValue;
                }
            }
        }
Esempio n. 7
0
        protected void RadScheduler1_AppointmentCommand(object sender, AppointmentCommandEventArgs e)
        {
            string UserName = Global.UserInfo.UserName;

            if (e.CommandName == "Update")
            {
                string            CalendarID   = ((HiddenField)e.Container.FindControl("hdfID")).Value;
                string            Name         = ((TextBox)e.Container.FindControl("SubjectTextBox")).Text;
                string            Description  = ((TextBox)e.Container.FindControl("txtDescription")).Text;
                RadDateTimePicker RadStartDate = (RadDateTimePicker)e.Container.FindControl("StartInput");
                DateTime          StartDate    = DateTime.Parse(RadStartDate.DateInput.SelectedDate.ToString());
                RadDateTimePicker RadEndDate   = (RadDateTimePicker)e.Container.FindControl("EndInput");
                DateTime          EndDate      = DateTime.Parse(RadStartDate.DateInput.SelectedDate.ToString());
                string            Address      = ((TextBox)e.Container.FindControl("txtAddress")).Text;
                //Kiểm tra quyền tạo lịch
                BUser  ctl      = new BUser();
                string UserJoin = "";

                if (ctl.HasPermission(Global.UserInfo.UserID, PermissionCode.CalendarCreate.ToString()) || Global.IsAdmin())
                {
                    if (Request.Form["ckxUser"] != "")
                    {
                        UserJoin = "," + Request.Form["ckxUser"] + ",";
                    }
                }
                else
                {
                    UserJoin = "";
                }
                BCalendar BobjCalendar = new BCalendar();
                BobjCalendar.Update(int.Parse(CalendarID), Name, Description, StartDate, EndDate, UserJoin, Address);
                RadScheduler_Load();
            }
            if (e.CommandName == "Insert")
            {
                if (Status == "Insert")
                {
                    //CultureInfo culture = new CultureInfo("fr-FR", true);
                    RadTextBox txtName = (RadTextBox)e.Container.FindControl("txtName");

                    BCalendar BobjCalendar = new BCalendar();
                    OCalendar objCalendar  = new OCalendar();
                    objCalendar.Name       = txtName.Text;
                    objCalendar.StartDate  = DateTime.Parse(hdf.Value);
                    objCalendar.EndDate    = DateTime.Parse(hdf.Value);
                    objCalendar.Address    = string.Empty;
                    objCalendar.Content    = string.Empty;
                    objCalendar.UserJoin   = string.Empty;
                    objCalendar.UserCreate = UserName;
                    BobjCalendar.Add(objCalendar);
                    RadScheduler_Load();
                }
                if (Status == "AdvancedInsert")
                {
                    string Name = ((TextBox)e.Container.FindControl("SubjectTextBox")).Text;

                    string Description = ((TextBox)e.Container.FindControl("txtDescription")).Text;

                    RadDateTimePicker RadStartDate = (RadDateTimePicker)e.Container.FindControl("StartInput");
                    DateTime          StartDate    = DateTime.Parse(RadStartDate.DateInput.SelectedDate.ToString());

                    RadDateTimePicker RadEndDate = (RadDateTimePicker)e.Container.FindControl("EndInput");
                    DateTime          EndDate    = DateTime.Parse(RadStartDate.DateInput.SelectedDate.ToString());

                    string Address = ((TextBox)e.Container.FindControl("txtAddress")).Text;

                    //Kiểm tra quyền tạo lịch
                    BUser  ctl      = new BUser();
                    string UserJoin = "";

                    if (ctl.HasPermission(Global.UserInfo.UserID, PermissionCode.CalendarCreate.ToString()) || Global.IsAdmin())
                    {
                        if (Request.Form["ckxUser"] != "")
                        {
                            UserJoin = "," + Request.Form["ckxUser"] + ",";
                        }
                    }
                    else
                    {
                        UserJoin = "";
                    }

                    BCalendar BobjCalendar = new BCalendar();
                    OCalendar objCalendar  = new OCalendar();

                    objCalendar.Name       = Name;
                    objCalendar.Content    = Description;
                    objCalendar.StartDate  = StartDate;
                    objCalendar.EndDate    = EndDate;
                    objCalendar.Address    = Address;
                    objCalendar.UserJoin   = UserJoin;
                    objCalendar.UserCreate = UserName;
                    BobjCalendar.Add(objCalendar);
                    RadScheduler_Load();
                }
            }
        }
        protected void ScheduleList_AppointmentCommand(object sender, AppointmentCommandEventArgs e)
        {
            if (e.CommandName == "Insert")
            {
                RadDropDownList activityDropDownList = (RadDropDownList)e.Container.FindControl("ActivityList");

                RadTimePicker startTime = (RadTimePicker)e.Container.FindControl("StartTime");
                RadTimePicker endTime   = (RadTimePicker)e.Container.FindControl("EndTime");

                var selectedDate = e.Container.Appointment.Start;

                DateTime startDateTime = new DateTime(selectedDate.Year, selectedDate.Month, selectedDate.Day, startTime.SelectedTime.Value.Hours, startTime.SelectedTime.Value.Minutes, startTime.SelectedTime.Value.Seconds);
                DateTime endDateTime   = new DateTime(selectedDate.Year, selectedDate.Month, selectedDate.Day, endTime.SelectedTime.Value.Hours, endTime.SelectedTime.Value.Minutes, endTime.SelectedTime.Value.Seconds);

                var newProjectDetailActivitySchedule = new UpdateProjectDetailActivityScheduleDTO();
                newProjectDetailActivitySchedule.ProjectDetailId         = Convert.ToInt64(ProjectDetailName.SelectedValue);
                newProjectDetailActivitySchedule.ProjectDetailActivityId = Convert.ToInt64(activityDropDownList.SelectedValue);
                newProjectDetailActivitySchedule.StartDate       = startDateTime;
                newProjectDetailActivitySchedule.EndDate         = endDateTime;
                newProjectDetailActivitySchedule.OperationTypeId = (int)EnumProjectDetailActivityScheduleOperationType.Insert;

                try
                {
                    ServiceResult <bool> serviceResult = new ServiceResult <bool>();
                    var queryString = new Dictionary <string, string>();
                    var response    = ApiHelper.CallSendApiMethod(ApiKeys.ProjectApiUrl, "UpdateProjectDetailActivitySchedule", queryString, newProjectDetailActivitySchedule);
                    if (!response.IsSuccessStatusCode)
                    {
                        throw new Exception("Hata oluştu!");
                    }
                    var data = response.Content.ReadAsStringAsync().Result;
                    serviceResult = JsonConvert.DeserializeObject <ServiceResult <bool> >(data);

                    if (serviceResult.ServiceResultType != EnumServiceResultType.Success)
                    {
                        throw new Exception(serviceResult.ErrorMessage);
                    }
                }
                catch (Exception ex)
                {
                }
            }

            if (e.CommandName == "Update")
            {
                RadDropDownList activityDropDownList = (RadDropDownList)e.Container.FindControl("ActivityList");

                RadTimePicker startTime = (RadTimePicker)e.Container.FindControl("StartTime");
                RadTimePicker endTime   = (RadTimePicker)e.Container.FindControl("EndTime");

                var selectedDate = e.Container.Appointment.Start;

                DateTime startDateTime = new DateTime(selectedDate.Year, selectedDate.Month, selectedDate.Day, startTime.SelectedTime.Value.Hours, startTime.SelectedTime.Value.Minutes, startTime.SelectedTime.Value.Seconds);
                DateTime endDateTime   = new DateTime(selectedDate.Year, selectedDate.Month, selectedDate.Day, endTime.SelectedTime.Value.Hours, endTime.SelectedTime.Value.Minutes, endTime.SelectedTime.Value.Seconds);

                var existingProjectDetailActivitySchedule = new UpdateProjectDetailActivityScheduleDTO();
                existingProjectDetailActivitySchedule.ProjectDetailActivityScheduleId = Convert.ToInt64(e.Container.Appointment.ID.ToString());
                existingProjectDetailActivitySchedule.ProjectDetailId         = Convert.ToInt64(ProjectDetailName.SelectedValue);
                existingProjectDetailActivitySchedule.ProjectDetailActivityId = Convert.ToInt64(activityDropDownList.SelectedValue);
                existingProjectDetailActivitySchedule.StartDate       = startDateTime;
                existingProjectDetailActivitySchedule.EndDate         = endDateTime;
                existingProjectDetailActivitySchedule.OperationTypeId = (int)EnumProjectDetailActivityScheduleOperationType.Update;

                try
                {
                    ServiceResult <bool> serviceResult = new ServiceResult <bool>();
                    var queryString = new Dictionary <string, string>();
                    var response    = ApiHelper.CallSendApiMethod(ApiKeys.ProjectApiUrl, "UpdateProjectDetailActivitySchedule", queryString, existingProjectDetailActivitySchedule);
                    if (!response.IsSuccessStatusCode)
                    {
                        throw new Exception("Hata oluştu!");
                    }
                    var data = response.Content.ReadAsStringAsync().Result;
                    serviceResult = JsonConvert.DeserializeObject <ServiceResult <bool> >(data);

                    if (serviceResult.ServiceResultType != EnumServiceResultType.Success)
                    {
                        throw new Exception(serviceResult.ErrorMessage);
                    }
                }
                catch (Exception ex)
                {
                }
            }

            InitializeAppointments();
        }
Esempio n. 9
0
 protected void RadScheduler1_AppointmentCommand(object sender, AppointmentCommandEventArgs e)
 {
     if (e.CommandName == "Cancel")
         RadScheduler1.Rebind();
 }
Esempio n. 10
0
        protected void RadScheduler1_AppointmentCommand(object sender, AppointmentCommandEventArgs 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.CommandName == "Update")
                {
                    decimal  JobPercent;
                    DateTime date        = DateTime.Today;
                    string   IDD         = ((HiddenField)e.Container.FindControl("hdfID")).Value;
                    int      ID          = int.Parse(IDD.ToString());
                    string   Name        = ((TextBox)e.Container.FindControl("SubjectTextBox")).Text;
                    string   Description = ((RadTextBox)e.Container.FindControl("txtDescription")).Text;
                    string   Link        = ((RadTextBox)e.Container.FindControl("txtLink")).Text;
                    string   phantram    = ((RadNumericTextBox)e.Container.FindControl("txtPhanTram")).Text;
                    if (phantram == "")
                    {
                        JobPercent = 0;
                    }
                    else
                    {
                        JobPercent = decimal.Parse(phantram.ToString());
                    }

                    RadDateTimePicker radStartDate = (RadDateTimePicker)e.Container.FindControl("StartInput");
                    DateTime          StartDate    = DateTime.Parse(radStartDate.DateInput.SelectedDate.ToString());
                    RadDateTimePicker radEndDate   = (RadDateTimePicker)e.Container.FindControl("EndInput");
                    DateTime          EndDate      = DateTime.Parse(radEndDate.DateInput.SelectedDate.ToString());
                    dal.SuaLich(ID, CongTy, UserID, StartDate, EndDate, Description, Link, JobPercent, date, Name);
                    RaScheduler_Load1();
                }
                if (e.CommandName == "Insert")
                {
                    if (Status == "Insert")
                    {
                        RadTextBox txtName = (RadTextBox)e.Container.FindControl("txtName");
                        //DateTime radStartDate =e.Container.Appointment.Start;
                        DateTime StartDate = e.Container.Appointment.Start;
                        // RadDateTimePicker radEndDate = (RadDateTimePicker)e.Container.Appointment.End;
                        DateTime EndDate = e.Container.Appointment.End;
                        string   jobid   = "A";
                        dal.ThemLichRutGon(CongTy, UserID, StartDate, EndDate, txtName.Text, jobid);

                        RaScheduler_Load1();
                    }
                    if (Status == "AdvancedInsert")
                    {
                        decimal           Percent;
                        RadDateTimePicker RadStartDate = (RadDateTimePicker)e.Container.FindControl("StartInput");
                        DateTime          StartDate    = DateTime.Parse(RadStartDate.DateInput.SelectedDate.ToString());

                        RadDateTimePicker RadEndDate  = (RadDateTimePicker)e.Container.FindControl("EndInput");
                        DateTime          EndDate     = DateTime.Parse(RadStartDate.DateInput.SelectedDate.ToString());
                        string            Name        = ((TextBox)e.Container.FindControl("SubjectTextBox")).Text;
                        string            Description = ((RadTextBox)e.Container.FindControl("txtDescription")).Text;
                        string            Link        = ((RadTextBox)e.Container.FindControl("txtLink")).Text;
                        string            phantram    = ((RadNumericTextBox)e.Container.FindControl("txtPhanTram")).Text;
                        if (phantram == "")
                        {
                            Percent = 0;
                        }
                        else
                        {
                            Percent = decimal.Parse(phantram.ToString());
                        }
                        dal.ThemLich(CongTy, UserID, StartDate, EndDate, Description, Link, Percent, UserID, Name);
                        RaScheduler_Load1();
                    }
                }
            }
        }