Ejemplo n.º 1
0
        async void ApproveTimeSheet(int dailytimesheetstatus)
        {
            try
            {
                Login.MasterPage.Loading(true, this);
                Lib.ServiceModel.ProjectModel project = new Lib.ServiceModel.ProjectModel();

                _approve.IsActive = 0;
                _approve.StatusID = dailytimesheetstatus;
                _approve.DTOStatus = (int)WinAppLibrary.Utilities.RowStatus.Update;

                await project.SaveSigmacue(new List<RevealProjectSvc.SigmacueDTO>() { _approve }, _approve.DataID, WinAppLibrary.Utilities.SigmaCueTaskType.Timesheet);
                Initiate(dailytimesheetstatus == WinAppLibrary.Utilities.DailyTimesheetStatus.GF_Rejected ? "Reject was sent" : "Approve was successful!", "Success");
                _status = 0;
                if (Completed != null)
                    Completed(WinAppLibrary.Utilities.TrackTimeSheetStatus.Approve, dailytimesheetstatus);
            }
            catch (Exception ee)
            {
                string msg = dailytimesheetstatus == WinAppLibrary.Utilities.DailyTimesheetStatus.GF_Rejected ? "rejecting" : "approving";

                (new WinAppLibrary.Utilities.Helper()).ExceptionHandler(ee, "TimeSheetTotal ApproveTimeSheet",
                    "There was an error on " + msg + " timesheet. Please contact administrator", "Error!");
            }

            Login.MasterPage.Loading(false, this);
        }
Ejemplo n.º 2
0
        /// <summary>
        /// bind list from service for Quality Management
        /// </summary>
        private async void bindListfromService()
        {
            List<QaqcformtemplateDTO> dto = new List<QaqcformtemplateDTO>();

            Lib.ServiceModel.ProjectModel project = new Lib.ServiceModel.ProjectModel();
            try
            {
                _oservices = await project.GetQaqcformByQcManager(_projectid, _moduleid, Convert.ToInt16(_loginid));
                if (_oservices.Count < 0)
                {
                    WinAppLibrary.Utilities.Helper.SimpleMessage("Not Found Data", "Not Found Data!");
                    return;
                }

                List<FiwpqaqcDTO> itrs = await project.GetITRListByFiwp(Login.UserAccount.FIWPID);
                foreach (QaqcformDTO item in _oservices)
                {
                    QaqcformtemplateDTO data = new QaqcformtemplateDTO();

                    data.QAQCFormTemplateID = item.QAQCFormID;
                    data.QAQCTypeLUID = item.QAQCFormTemplateID;
                    data.QAQCFormRev = item.FIWPName;
                    data.Description = DateTime.Now.ToString();
                    data.QAQCFormCode = "Ready to Approval";  // 4 : Ready to Approval"

                    foreach (FiwpqaqcDTO ditem in itrs)
                    {
                        if (item.QAQCFormTemplateID == ditem.QAQCFormTemplateID)
                        {
                            data.QAQCFormTemplateName = ditem.QAQCFormTemplateName;
                            break;
                        }
                    }

                    dto.Add(data);
                }

                // Bind
                gvDocument.ItemsSource = dto.OrderBy(x => x.QAQCFormTemplateName).ThenBy(y => y.Description).ThenBy(z => z.QAQCFormCode);
            }
            catch
            {
                WinAppLibrary.Utilities.Helper.SimpleMessage("Bind Error", "Error!");
            }

        }
Ejemplo n.º 3
0
        async void ReSubmitTimeSheet()
        {
            try
            {
                Login.MasterPage.Loading(true, this);
                Lib.ServiceModel.ProjectModel project = new Lib.ServiceModel.ProjectModel();
                await project.SaveDailyTimehseet(_departstructure, _updatedBy, _workdate, _projectId, _moduleId);
                Initiate("Submit was successful!", "Success");
            }
            catch (Exception ee)
            {
                (new WinAppLibrary.Utilities.Helper()).ExceptionHandler(ee, "TimeSheetTotal SubmitTimeSheet",
                    "There was an error on submitting timesheet. Please contact administrator", "Error!");
            }

            Login.MasterPage.Loading(false, this);
        }
Ejemplo n.º 4
0
        async void SubmitTimeSheet()
        {
            try
            {
                Login.MasterPage.Loading(true, this);
                Lib.ServiceModel.ProjectModel project = new Lib.ServiceModel.ProjectModel();
                await project.SaveDailyTimehseet(_departstructure, Login.UserAccount.UserName, selectedDateTime,
                    Login.UserAccount.CurProjectID, Login.UserAccount.CurModuleID);
            }
            catch (Exception e)
            {
                (new WinAppLibrary.Utilities.Helper()).ExceptionHandler(e, "TimeSheetTotal SubmitTimeSheet",
                    "There was an error on submitting timesheet. Please contact administrator", "Error!");
            }

            Login.MasterPage.Loading(false, this);
        }