コード例 #1
0
 public int UpdateCalendar(T_OA_CALENDAR obj)
 {
     using (CalendarManagementBll calendarBll = new CalendarManagementBll())
     {
         return(calendarBll.UpdateCalendarInfo(obj));
     }
 }
コード例 #2
0
 public int UpdateCalendar(T_OA_CALENDAR obj)
 {
     using (CalendarManagementBll calendarBll = new CalendarManagementBll())
     {            
         return calendarBll.UpdateCalendarInfo(obj);
     }
 }
コード例 #3
0
 public int DelCalendar(T_OA_CALENDAR obj)
 {
     using (CalendarManagementBll calendarBll = new CalendarManagementBll())
     {
         if (calendarBll.DeleteCalendarInfo(obj.CALENDARID))
         {
             return(1);
         }
         return(-1);
     }
 }
コード例 #4
0
 public int AddCalendar(T_OA_CALENDAR obj)
 {
     using (CalendarManagementBll calendarBll = new CalendarManagementBll())
     {
         bool sucess = calendarBll.AddCalendarInfo(obj);
         if (sucess == false)
         {
             return(-1);
         }
         return(1);
     }
 }
コード例 #5
0
 public int DelCalendar(T_OA_CALENDAR obj)
 {
     using (CalendarManagementBll calendarBll = new CalendarManagementBll())
     {
         
         if (calendarBll.DeleteCalendarInfo(obj.CALENDARID))
         {
             return 1;
         }
         return -1;
     }
 }
コード例 #6
0
 public int AddCalendar(T_OA_CALENDAR obj)
 {
     using (CalendarManagementBll calendarBll = new CalendarManagementBll())
     {                
         bool sucess = calendarBll.AddCalendarInfo(obj);
         if (sucess == false)
         {
             return -1;
         }
         return 1;
     }
 }
コード例 #7
0
ファイル: CFrmCalendarInfo.xaml.cs プロジェクト: JuRogn/OA
        private void AddInfo()
        {
            if (editStatues == "add")
                calendarInfo = new T_OA_CALENDAR();

            calendarInfo.CONTENT = txtNotes.Text;
            calendarInfo.TITLE = txtTitle.Text;

            DateTime planTime;
            switch (cmbStyle.SelectedIndex)
            {
                case 0:
                    calendarInfo.REPARTREMINDER = "NOTHING";
                    if (dpSelectDate.Visibility == Visibility.Visible)
                    {
                        if (dpSelectDate.Text.Trim() != "" && dpSelectDate.Text.Trim() != string.Empty)
                        {
                            calendarInfo.REMINDERRMODEL = dpSelectDate.Text + " " + tpTime.Value.Value.ToShortTimeString();
                            planTime = Convert.ToDateTime(dpSelectDate.Text + " " + tpTime.Value.Value.ToShortTimeString());
                            calendarInfo.PLANTIME = planTime;
                        }
                    }
                    else
                        return;
                    break;
                case 1://每天
                    calendarInfo.REPARTREMINDER = "DAY";
                    planTime = new DateTime(System.DateTime.Now.Year, System.DateTime.Now.Month, System.DateTime.Now.Day, tpTime.Value.Value.Hour, tpTime.Value.Value.Minute, 0);
                    calendarInfo.PLANTIME = planTime;
                    calendarInfo.REMINDERRMODEL = planTime.ToShortTimeString();
                    break;
                case 2://每周
                    calendarInfo.REPARTREMINDER = "WEEK";
                    switch (cmbSelectDate.SelectedIndex)
                    {
                        case 0:
                            calendarInfo.REMINDERRMODEL = DayOfWeek.Monday.ToString();
                            break;
                        case 1:
                            calendarInfo.REMINDERRMODEL = DayOfWeek.Tuesday.ToString();
                            break;
                        case 2:
                            calendarInfo.REMINDERRMODEL = DayOfWeek.Wednesday.ToString();
                            break;
                        case 3:
                            calendarInfo.REMINDERRMODEL = DayOfWeek.Thursday.ToString();
                            break;
                        case 4:
                            calendarInfo.REMINDERRMODEL = DayOfWeek.Friday.ToString();
                            break;
                        case 5:
                            calendarInfo.REMINDERRMODEL = DayOfWeek.Saturday.ToString();
                            break;
                        case 6:
                            calendarInfo.REMINDERRMODEL = DayOfWeek.Sunday.ToString();
                            break;
                    }
                    planTime = new DateTime(System.DateTime.Now.Year, System.DateTime.Now.Month, System.DateTime.Now.Day, tpTime.Value.Value.Hour, tpTime.Value.Value.Minute, 0);
                    calendarInfo.PLANTIME = planTime;
                    break;
                case 3://每月                    
                    calendarInfo.REPARTREMINDER = "MONTH";
                    if (cmbSelectDate.Visibility == Visibility.Visible)
                    {
                        //取当前日期 输入 时间
                        planTime = new DateTime(System.DateTime.Now.Year, System.DateTime.Now.Month, cmbSelectDate.SelectedIndex + 1, tpTime.Value.Value.Hour, tpTime.Value.Value.Minute, 0);
                        calendarInfo.PLANTIME = planTime;
                        calendarInfo.REMINDERRMODEL = planTime.Day.ToString();
                    }
                    break;
                case 4://每年
                    calendarInfo.REPARTREMINDER = "YEAR";
                    //calendarInfo.REMINDERRMODEL = cmbSelectDate.Items[0].ToString();
                    if (gdMonthDay.Visibility == Visibility.Visible)
                    {
                        planTime = new DateTime(System.DateTime.Now.Year, cmbSelectedMonth.SelectedIndex + 1, cmbSelectedDay.SelectedIndex + 1, tpTime.Value.Value.Hour, tpTime.Value.Value.Minute, 0);
                        calendarInfo.PLANTIME = planTime;
                        calendarInfo.REMINDERRMODEL = planTime.ToString();
                    }
                    break;
            }
            if (string.IsNullOrEmpty(this.dpSelectDate.Text))
            {
                Utility.ShowCustomMessage(MessageTypes.Error, Utility.GetResourceStr("ERROR"), Utility.GetResourceStr("PLANDATECANNOTBEEMPTY"));
                RefreshUI(RefreshedTypes.HideProgressBar);
                return;
            }
            if (this.tpTime.Value.Value == null)
            {
                Utility.ShowCustomMessage(MessageTypes.Error, Utility.GetResourceStr("ERROR"), Utility.GetResourceStr("PLANNINGTIMECANNOTBEEMPTY"));
                RefreshUI(RefreshedTypes.HideProgressBar);
                return;
            }
            if (editStatues == "add")
            {
                calendarInfo.CALENDARID = System.Guid.NewGuid().ToString();
                calendarInfo.CREATEDATE = System.DateTime.Now;
                calendarInfo.CREATEUSERID = Common.CurrentLoginUserInfo.EmployeeID;
                calendarInfo.CREATECOMPANYID = Common.CurrentLoginUserInfo.UserPosts[0].CompanyID;
                calendarInfo.CREATEDEPARTMENTID = Common.CurrentLoginUserInfo.UserPosts[0].DepartmentID;
                calendarInfo.CREATEPOSTID = Common.CurrentLoginUserInfo.UserPosts[0].PostID;
                calendarInfo.CREATEUSERNAME = Common.CurrentLoginUserInfo.EmployeeName;
                calendarInfo.OWNERID = Common.CurrentLoginUserInfo.EmployeeID;
                calendarInfo.OWNERCOMPANYID = Common.CurrentLoginUserInfo.UserPosts[0].CompanyID;
                calendarInfo.OWNERDEPARTMENTID = Common.CurrentLoginUserInfo.UserPosts[0].DepartmentID;
                calendarInfo.OWNERPOSTID = Common.CurrentLoginUserInfo.UserPosts[0].PostID;
                calendarInfo.OWNERNAME = Common.CurrentLoginUserInfo.EmployeeName;
                calendarInfo.UPDATEDATE = System.DateTime.Now;
                calendarInfo.UPDATEUSERID = Common.CurrentLoginUserInfo.EmployeeID;
                calendarInfo.UPDATEUSERNAME = Common.CurrentLoginUserInfo.EmployeeName;

                calendarManagement.AddCalendarAsync(calendarInfo);
            }
            else
            {
                calendarInfo.UPDATEDATE = System.DateTime.Now;
                calendarInfo.UPDATEUSERID = Common.CurrentLoginUserInfo.EmployeeID;
                calendarInfo.UPDATEUSERNAME = Common.CurrentLoginUserInfo.EmployeeName;

                calendarManagement.UpdateCalendarAsync(calendarInfo);
            }
        }
コード例 #8
0
ファイル: CFrmCalendarInfo.xaml.cs プロジェクト: JuRogn/OA
        public CFrmCalendarInfo(T_OA_CALENDAR selCalendarInfo, string editSatue)
        {
            InitializeComponent();
            editStatues = editSatue;
            calendarManagement.AddCalendarCompleted += new EventHandler<AddCalendarCompletedEventArgs>(calendarManagement_AddCalendarCompleted);
            calendarManagement.UpdateCalendarCompleted += new EventHandler<UpdateCalendarCompletedEventArgs>(calendarManagement_UpdateCalendarCompleted);
            calendarInfo = selCalendarInfo;
            txtNotes.Text = selCalendarInfo.CONTENT;
            txtTitle.Text = selCalendarInfo.TITLE;
            //txtSelectedHour.Text = selCalendarInfo.PLANTIME.Hour.ToString();
            //txtSelectedMin.Text = selCalendarInfo.PLANTIME.Minute.ToString();
            if (calendarInfo != null && editStatues == "update" || editStatues == "view")
            {
                txtCreateUserName.Text = calendarInfo.CREATEUSERNAME;
            }
            tpTime.Value = selCalendarInfo.PLANTIME;
            switch (selCalendarInfo.REPARTREMINDER)
            {
                case "NOTHING":
                    cmbStyle.SelectedIndex = 0;
                    cmbSelectDate.Items.Add(Convert.ToDateTime(selCalendarInfo.REMINDERRMODEL).ToShortDateString());
                    cmbSelectDate.SelectedIndex = 0;
                    dpSelectDate.Text = selCalendarInfo.PLANTIME.ToShortDateString();
                    break;
                case "DAY"://每天
                    cmbStyle.SelectedIndex = 1;
                    break;
                case "WEEK"://每周
                    cmbStyle.SelectedIndex = 2;
                    switch (selCalendarInfo.REMINDERRMODEL)
                    {
                        case "Monday":
                            cmbSelectDate.SelectedIndex = 0;
                            break;
                        case "Tuesday":
                            cmbSelectDate.SelectedIndex = 1;
                            break;
                        case "Wednesday":
                            cmbSelectDate.SelectedIndex = 2;
                            break;
                        case "Thursday":
                            cmbSelectDate.SelectedIndex = 3;
                            break;
                        case "Friday":
                            cmbSelectDate.SelectedIndex = 4;
                            break;
                        case "Saturday":
                            cmbSelectDate.SelectedIndex = 5;
                            break;
                        case "Sunday":
                            cmbSelectDate.SelectedIndex = 6;
                            break;
                    }
                    break;
                case "MONTH"://每月
                    cmbStyle.SelectedIndex = 3;
                    cmbSelectDate.SelectedIndex = Convert.ToInt32(selCalendarInfo.REMINDERRMODEL) - 1;
                    break;
                case "YEAR"://每年
                    cmbStyle.SelectedIndex = 4;
                    if (gdMonthDay.Visibility == Visibility.Visible)
                    {
                        cmbSelectedMonth.SelectedIndex = Convert.ToDateTime(selCalendarInfo.PLANTIME).Month - 1;
                        cmbSelectedDay.SelectedIndex = Convert.ToDateTime(selCalendarInfo.PLANTIME).Day - 1;
                    }

                    break;
            }
            editStatues = editSatue;
            if (editSatue == "view")
            {
                this.IsEnabled = false;
            }
        }
コード例 #9
0
ファイル: CFrmCalendarInfo.xaml.cs プロジェクト: jjg0519/OA
        private void AddInfo()
        {
            if (editStatues == "add")
            {
                calendarInfo = new T_OA_CALENDAR();
            }

            calendarInfo.CONTENT = txtNotes.Text;
            calendarInfo.TITLE   = txtTitle.Text;

            DateTime planTime;

            switch (cmbStyle.SelectedIndex)
            {
            case 0:
                calendarInfo.REPARTREMINDER = "NOTHING";
                if (dpSelectDate.Visibility == Visibility.Visible)
                {
                    if (dpSelectDate.Text.Trim() != "" && dpSelectDate.Text.Trim() != string.Empty)
                    {
                        calendarInfo.REMINDERRMODEL = dpSelectDate.Text + " " + tpTime.Value.Value.ToShortTimeString();
                        planTime = Convert.ToDateTime(dpSelectDate.Text + " " + tpTime.Value.Value.ToShortTimeString());
                        calendarInfo.PLANTIME = planTime;
                    }
                }
                else
                {
                    return;
                }
                break;

            case 1:    //每天
                calendarInfo.REPARTREMINDER = "DAY";
                planTime = new DateTime(System.DateTime.Now.Year, System.DateTime.Now.Month, System.DateTime.Now.Day, tpTime.Value.Value.Hour, tpTime.Value.Value.Minute, 0);
                calendarInfo.PLANTIME       = planTime;
                calendarInfo.REMINDERRMODEL = planTime.ToShortTimeString();
                break;

            case 2:    //每周
                calendarInfo.REPARTREMINDER = "WEEK";
                switch (cmbSelectDate.SelectedIndex)
                {
                case 0:
                    calendarInfo.REMINDERRMODEL = DayOfWeek.Monday.ToString();
                    break;

                case 1:
                    calendarInfo.REMINDERRMODEL = DayOfWeek.Tuesday.ToString();
                    break;

                case 2:
                    calendarInfo.REMINDERRMODEL = DayOfWeek.Wednesday.ToString();
                    break;

                case 3:
                    calendarInfo.REMINDERRMODEL = DayOfWeek.Thursday.ToString();
                    break;

                case 4:
                    calendarInfo.REMINDERRMODEL = DayOfWeek.Friday.ToString();
                    break;

                case 5:
                    calendarInfo.REMINDERRMODEL = DayOfWeek.Saturday.ToString();
                    break;

                case 6:
                    calendarInfo.REMINDERRMODEL = DayOfWeek.Sunday.ToString();
                    break;
                }
                planTime = new DateTime(System.DateTime.Now.Year, System.DateTime.Now.Month, System.DateTime.Now.Day, tpTime.Value.Value.Hour, tpTime.Value.Value.Minute, 0);
                calendarInfo.PLANTIME = planTime;
                break;

            case 3:    //每月
                calendarInfo.REPARTREMINDER = "MONTH";
                if (cmbSelectDate.Visibility == Visibility.Visible)
                {
                    //取当前日期 输入 时间
                    planTime = new DateTime(System.DateTime.Now.Year, System.DateTime.Now.Month, cmbSelectDate.SelectedIndex + 1, tpTime.Value.Value.Hour, tpTime.Value.Value.Minute, 0);
                    calendarInfo.PLANTIME       = planTime;
                    calendarInfo.REMINDERRMODEL = planTime.Day.ToString();
                }
                break;

            case 4:    //每年
                calendarInfo.REPARTREMINDER = "YEAR";
                //calendarInfo.REMINDERRMODEL = cmbSelectDate.Items[0].ToString();
                if (gdMonthDay.Visibility == Visibility.Visible)
                {
                    planTime = new DateTime(System.DateTime.Now.Year, cmbSelectedMonth.SelectedIndex + 1, cmbSelectedDay.SelectedIndex + 1, tpTime.Value.Value.Hour, tpTime.Value.Value.Minute, 0);
                    calendarInfo.PLANTIME       = planTime;
                    calendarInfo.REMINDERRMODEL = planTime.ToString();
                }
                break;
            }
            if (string.IsNullOrEmpty(this.dpSelectDate.Text))
            {
                Utility.ShowCustomMessage(MessageTypes.Error, Utility.GetResourceStr("ERROR"), Utility.GetResourceStr("PLANDATECANNOTBEEMPTY"));
                RefreshUI(RefreshedTypes.HideProgressBar);
                return;
            }
            if (this.tpTime.Value.Value == null)
            {
                Utility.ShowCustomMessage(MessageTypes.Error, Utility.GetResourceStr("ERROR"), Utility.GetResourceStr("PLANNINGTIMECANNOTBEEMPTY"));
                RefreshUI(RefreshedTypes.HideProgressBar);
                return;
            }
            if (editStatues == "add")
            {
                calendarInfo.CALENDARID         = System.Guid.NewGuid().ToString();
                calendarInfo.CREATEDATE         = System.DateTime.Now;
                calendarInfo.CREATEUSERID       = Common.CurrentLoginUserInfo.EmployeeID;
                calendarInfo.CREATECOMPANYID    = Common.CurrentLoginUserInfo.UserPosts[0].CompanyID;
                calendarInfo.CREATEDEPARTMENTID = Common.CurrentLoginUserInfo.UserPosts[0].DepartmentID;
                calendarInfo.CREATEPOSTID       = Common.CurrentLoginUserInfo.UserPosts[0].PostID;
                calendarInfo.CREATEUSERNAME     = Common.CurrentLoginUserInfo.EmployeeName;
                calendarInfo.OWNERID            = Common.CurrentLoginUserInfo.EmployeeID;
                calendarInfo.OWNERCOMPANYID     = Common.CurrentLoginUserInfo.UserPosts[0].CompanyID;
                calendarInfo.OWNERDEPARTMENTID  = Common.CurrentLoginUserInfo.UserPosts[0].DepartmentID;
                calendarInfo.OWNERPOSTID        = Common.CurrentLoginUserInfo.UserPosts[0].PostID;
                calendarInfo.OWNERNAME          = Common.CurrentLoginUserInfo.EmployeeName;
                calendarInfo.UPDATEDATE         = System.DateTime.Now;
                calendarInfo.UPDATEUSERID       = Common.CurrentLoginUserInfo.EmployeeID;
                calendarInfo.UPDATEUSERNAME     = Common.CurrentLoginUserInfo.EmployeeName;

                calendarManagement.AddCalendarAsync(calendarInfo);
            }
            else
            {
                calendarInfo.UPDATEDATE     = System.DateTime.Now;
                calendarInfo.UPDATEUSERID   = Common.CurrentLoginUserInfo.EmployeeID;
                calendarInfo.UPDATEUSERNAME = Common.CurrentLoginUserInfo.EmployeeName;

                calendarManagement.UpdateCalendarAsync(calendarInfo);
            }
        }
コード例 #10
0
ファイル: CFrmCalendarInfo.xaml.cs プロジェクト: jjg0519/OA
        public CFrmCalendarInfo(T_OA_CALENDAR selCalendarInfo, string editSatue)
        {
            InitializeComponent();
            editStatues = editSatue;
            calendarManagement.AddCalendarCompleted    += new EventHandler <AddCalendarCompletedEventArgs>(calendarManagement_AddCalendarCompleted);
            calendarManagement.UpdateCalendarCompleted += new EventHandler <UpdateCalendarCompletedEventArgs>(calendarManagement_UpdateCalendarCompleted);
            calendarInfo  = selCalendarInfo;
            txtNotes.Text = selCalendarInfo.CONTENT;
            txtTitle.Text = selCalendarInfo.TITLE;
            //txtSelectedHour.Text = selCalendarInfo.PLANTIME.Hour.ToString();
            //txtSelectedMin.Text = selCalendarInfo.PLANTIME.Minute.ToString();
            if (calendarInfo != null && editStatues == "update" || editStatues == "view")
            {
                txtCreateUserName.Text = calendarInfo.CREATEUSERNAME;
            }
            tpTime.Value = selCalendarInfo.PLANTIME;
            switch (selCalendarInfo.REPARTREMINDER)
            {
            case "NOTHING":
                cmbStyle.SelectedIndex = 0;
                cmbSelectDate.Items.Add(Convert.ToDateTime(selCalendarInfo.REMINDERRMODEL).ToShortDateString());
                cmbSelectDate.SelectedIndex = 0;
                dpSelectDate.Text           = selCalendarInfo.PLANTIME.ToShortDateString();
                break;

            case "DAY":    //每天
                cmbStyle.SelectedIndex = 1;
                break;

            case "WEEK":    //每周
                cmbStyle.SelectedIndex = 2;
                switch (selCalendarInfo.REMINDERRMODEL)
                {
                case "Monday":
                    cmbSelectDate.SelectedIndex = 0;
                    break;

                case "Tuesday":
                    cmbSelectDate.SelectedIndex = 1;
                    break;

                case "Wednesday":
                    cmbSelectDate.SelectedIndex = 2;
                    break;

                case "Thursday":
                    cmbSelectDate.SelectedIndex = 3;
                    break;

                case "Friday":
                    cmbSelectDate.SelectedIndex = 4;
                    break;

                case "Saturday":
                    cmbSelectDate.SelectedIndex = 5;
                    break;

                case "Sunday":
                    cmbSelectDate.SelectedIndex = 6;
                    break;
                }
                break;

            case "MONTH":    //每月
                cmbStyle.SelectedIndex      = 3;
                cmbSelectDate.SelectedIndex = Convert.ToInt32(selCalendarInfo.REMINDERRMODEL) - 1;
                break;

            case "YEAR":    //每年
                cmbStyle.SelectedIndex = 4;
                if (gdMonthDay.Visibility == Visibility.Visible)
                {
                    cmbSelectedMonth.SelectedIndex = Convert.ToDateTime(selCalendarInfo.PLANTIME).Month - 1;
                    cmbSelectedDay.SelectedIndex   = Convert.ToDateTime(selCalendarInfo.PLANTIME).Day - 1;
                }

                break;
            }
            editStatues = editSatue;
            if (editSatue == "view")
            {
                this.IsEnabled = false;
            }
        }