Example #1
0
        public async Task<DataLibrary.ProjectscheduleDTO> GetSignleProjscheduleByID(int projectScheduleId)
        {
            DataLibrary.ProjectscheduleDTO retValue = new DataLibrary.ProjectscheduleDTO();

            List<dynamic> param = new List<dynamic>();
            param.Add(projectScheduleId);
            var result = await JsonHelper.GetDataAsync<DataLibrary.ProjectscheduleDTO>("JsonGetSignleProjscheduleByID", param, JsonHelper.ProjectService);

            retValue = result;

            return retValue;
        }
        private async void ChangeDateResult(SelectionChangedEventArgs e)
        {
            try
            {
                if (pagecount > 0)
                {
                    DataLibrary.ProjectscheduleDTO dto = new DataLibrary.ProjectscheduleDTO();
                    dto = sc.ScheduleJson[0];

                    DateTime _startdate = Convert.ToDateTime(StartDate.Text);
                    DateTime _finishdate = Convert.ToDateTime(FinishDate.Text);

                    TimeSpan ts = _finishdate - _startdate;
                    int diffDay = ts.Days;


                    DateTime _schedultStartdate = Convert.ToDateTime(sc.ScheduleJson[0].ExternalStartDate);
                    DateTime _schedultFisishtdate = Convert.ToDateTime(sc.ScheduleJson[0].ExternalFinishDate);
                    TimeSpan tsschedulestart = _startdate - _schedultStartdate;
                    TimeSpan tsscheduleend = _finishdate - _schedultFisishtdate;

                    if (diffDay < 0)//종료일이 시작일보다 빠르면 경고 문
                    {
                        pagecount = 0;
                        if(e !=null && e.RemovedItems.Count>0)
                            FinishDate.Text = Convert.ToDateTime(e.RemovedItems[0]).ToString("MM/dd/yyyy");
                        WinAppLibrary.Utilities.Helper.SimpleMessage("End date can not be exceed start date", "Warning!");                        
                    }
                    else if (tsschedulestart.Days < 0 || tsscheduleend.Days > 0) //P6 ㅇ
                    {
                        if (e != null && e.RemovedItems.Count > 0)
                        {
                            pagecount = 0;
                            FinishDate.Text = Convert.ToDateTime(e.RemovedItems[0]).ToString("MM/dd/yyyy");
                        }
                        WinAppLibrary.Utilities.Helper.SimpleMessage("Schedule start date and end date can not be exceed the P6 date on top", "Warning!");
                    }                    
                    else
                    {
                        dto.StartDate = _startdate;
                        dto.FinishDate = _finishdate;
                        dto.DTOStatus = (int)DataLibrary.Utilities.RowStatus.Update;
                        dto.UpdatedBy = Login.UserAccount.UserName;
                        dto.P6CalendarID = sc.ScheduleJson[0].P6CalendarID;

                        var result = await _commonsource.UpdateProjectSchedulePeriod(dto, tbAssignManhours.Text.Replace("Total Man Hours : ", "").Trim().Length > 0 ? tbAssignManhours.Text.Replace("Total Man Hours : ", "").Trim() : "0");

                        if (result != null)
                        {
                            sc.SetSchduleInfo(result);
                            tbNoCrew.Text = result.CrewMembersAssigned.ToString();
                        }
                    }
                }
                else
                    pagecount++;

            }
            catch (Exception ex)
            {
            }
        }        
Example #3
0
 public async Task<DataLibrary.ProjectscheduleDTO> UpdateProjectSchedulePeriod(DataLibrary.ProjectscheduleDTO psc, string totalManhours)
 {
     DataLibrary.ProjectscheduleDTO dto = new DataLibrary.ProjectscheduleDTO();
     dto = await (new Lib.ServiceModel.ProjectModel()).UpdateProjectSchedulePeriod(psc, totalManhours);
     return dto;
 }