private void CheckRequestOnUnallowableOverTimeLoadState_RequestOnUnallowableOverTime()
        {
            string[] retMessage = new string[4];
            try
            {
                if (HttpContext.Current.Request.QueryString.AllKeys.Contains("RC") && HttpContext.Current.Request.QueryString.AllKeys.Contains("RLS"))
                {
                    RequestLoadState requestLoadState = (RequestLoadState)Enum.Parse(typeof(RequestLoadState), this.StringBuilder.CreateString(HttpContext.Current.Request.QueryString["RLS"]));
                    RequestCaller    requestCaller    = (RequestCaller)Enum.Parse(typeof(RequestCaller), this.StringBuilder.CreateString(HttpContext.Current.Request.QueryString["RC"]));

                    switch (requestLoadState)
                    {
                    case RequestLoadState.Personnel:
                        switch (requestCaller)
                        {
                        case RequestCaller.Grid:
                            this.RequestBusiness.CheckOverTimeRequestLoadAccess_onPersonnelLoadStateInGridSchema();
                            break;

                        case RequestCaller.GanttChart:
                            this.RequestBusiness.CheckOverTimeRequestLoadAccess_onPersonnelLoadStateInGanttChartSchema();
                            break;
                        }
                        break;

                    case RequestLoadState.Manager:
                        switch (requestCaller)
                        {
                        case RequestCaller.Grid:
                            this.RequestBusiness.CheckOverTimeRequestLoadAccess_onManagerLoadStateInGridSchema();
                            break;

                        case RequestCaller.GanttChart:
                            this.RequestBusiness.CheckOverTimeRequestLoadAccess_onManagerLoadStateInGanttChartSchema();
                            break;
                        }
                        break;

                    case RequestLoadState.Operator:
                        switch (requestCaller)
                        {
                        case RequestCaller.Grid:
                            this.RequestBusiness.CheckOverTimeRequestLoadAccess_onOperatorLoadStateInGridSchema();
                            break;

                        case RequestCaller.GanttChart:
                            this.RequestBusiness.CheckOverTimeRequestLoadAccess_onOperatorLoadStateInGanttChartSchema();
                            break;
                        }
                        break;
                    }
                }
            }
            catch (BaseException ex)
            {
                retMessage = this.exceptionHandler.HandleException(this.Page, ExceptionTypes.UIBaseException, ex, retMessage);
                Response.Redirect("WhitePage.aspx?" + typeof(IllegalServiceAccess).Name + "=" + retMessage[1]);
            }
        }
Ejemplo n.º 2
0
        public string[] UpdateRequest_RequestOnTrafficPage(string requestCaller, string requestLoadState, string state, string SelectedRequestID, string PreCardID, string RequestDate, string RequestFromTime, string RequestToTime, string IsRequestToTimeInNextDay, string RequestDescription)
        {
            this.InitializeCulture();

            string[] retMessage = new string[6];
            try
            {
                decimal RequestID         = 0;
                decimal selectedRequestID = decimal.Parse(this.StringBuilder.CreateString(SelectedRequestID));
                Request request           = new Request();
                request.ID = selectedRequestID;
                UIActionType     uam = (UIActionType)Enum.Parse(typeof(UIActionType), this.StringBuilder.CreateString(state).ToUpper());
                RequestCaller    RC  = (RequestCaller)Enum.Parse(typeof(RequestCaller), this.StringBuilder.CreateString(requestCaller));
                RequestLoadState RLS = (RequestLoadState)Enum.Parse(typeof(RequestLoadState), this.StringBuilder.CreateString(requestLoadState));

                switch (uam)
                {
                case UIActionType.ADD:

                    decimal preCardID = decimal.Parse(this.StringBuilder.CreateString(PreCardID));
                    RequestFromTime = this.StringBuilder.CreateString(RequestFromTime);
                    RequestToTime   = this.StringBuilder.CreateString(RequestToTime);
                    bool isRequestToTimeInNextDay = bool.Parse(this.StringBuilder.CreateString(IsRequestToTimeInNextDay));
                    RequestDescription = this.StringBuilder.CreateString(RequestDescription);

                    request.TheFromDate = request.TheToDate = this.StringBuilder.CreateString(RequestDate);
                    Precard precard = new Precard();
                    precard.ID      = preCardID;
                    request.Precard = precard;
                    if (RequestFromTime != string.Empty)
                    {
                        request.TheFromTime = RequestFromTime;
                    }
                    if (RequestToTime != string.Empty)
                    {
                        request.TheToTime = RequestToTime;
                    }
                    request.ContinueOnTomorrow = isRequestToTimeInNextDay;
                    request.Description        = RequestDescription;

                    switch (RC)
                    {
                    case RequestCaller.Grid:
                        switch (RLS)
                        {
                        case RequestLoadState.Personnel:
                            request = this.RequestBusiness.InsertTrafficRequest_onPersonnelLoadStateInGridSchema(request);
                            break;

                        case RequestLoadState.Manager:
                            request = this.RequestBusiness.InsertTrafficRequest_onManagerLoadStateInGridSchema(request);
                            break;
                        }
                        break;

                    case RequestCaller.GanttChart:
                        switch (RLS)
                        {
                        case RequestLoadState.Personnel:
                            request = this.RequestBusiness.InsertTrafficRequest_onPersonnelLoadStateInGanttChartSchema(request);
                            break;

                        case RequestLoadState.Manager:
                            request = this.RequestBusiness.InsertTrafficRequest_onManagerLoadStateInGanttChartSchema(request);
                            break;
                        }
                        break;
                    }
                    RequestID = request.ID;
                    break;

                case UIActionType.DELETE:
                    if (selectedRequestID == 0)
                    {
                        retMessage = this.exceptionHandler.HandleException(this.Page, ExceptionTypes.Exception, new Exception(GetLocalResourceObject("NoRequestSelectedforDelete").ToString()), retMessage);
                        return(retMessage);
                    }
                    switch (RC)
                    {
                    case RequestCaller.Grid:
                        switch (RLS)
                        {
                        case RequestLoadState.Personnel:
                            this.RequestBusiness.DeleteTrafficRequest_onPersonnelLoadStateInGridSchema(request);
                            break;

                        case RequestLoadState.Manager:
                            this.RequestBusiness.DeleteTrafficRequest_onManagerLoadStateInGridSchema(request);
                            break;
                        }
                        break;

                    case RequestCaller.GanttChart:
                        switch (RLS)
                        {
                        case RequestLoadState.Personnel:
                            this.RequestBusiness.DeleteTrafficRequest_onPersonnelLoadStateInGanttChartSchema(request);
                            break;

                        case RequestLoadState.Manager:
                            this.RequestBusiness.DeleteTrafficRequest_onManagerLoadStateInGanttChartSchema(request);
                            break;
                        }
                        break;
                    }
                    break;
                }

                retMessage[0] = GetLocalResourceObject("RetSuccessType").ToString();
                string SuccessMessageBody = string.Empty;
                switch (uam)
                {
                case Business.UIActionType.ADD:
                    SuccessMessageBody = GetLocalResourceObject("AddComplete").ToString();
                    break;

                case Business.UIActionType.DELETE:
                    SuccessMessageBody = GetLocalResourceObject("DeleteComplete").ToString();
                    break;

                default:
                    break;
                }
                retMessage[1] = SuccessMessageBody;
                retMessage[2] = "success";
                retMessage[3] = RequestID.ToString();
                retMessage[4] = ((int)request.Status).ToString();
                retMessage[5] = request.RegistrationDate;
                return(retMessage);
            }
            catch (UIValidationExceptions ex)
            {
                retMessage = this.exceptionHandler.HandleException(this.Page, ExceptionTypes.UIValidationExceptions, ex, retMessage);
                return(retMessage);
            }
            catch (UIBaseException ex)
            {
                retMessage = this.exceptionHandler.HandleException(this.Page, ExceptionTypes.UIBaseException, ex, retMessage);
                return(retMessage);
            }
            catch (Exception ex)
            {
                retMessage = this.exceptionHandler.HandleException(this.Page, ExceptionTypes.Exception, ex, retMessage);
                return(retMessage);
            }
        }
        private void CheckNextDayTimesLoadAccess_RequestOnUnallowableOverTime()
        {
            if (HttpContext.Current.Request.QueryString.AllKeys.Contains("RC") && HttpContext.Current.Request.QueryString.AllKeys.Contains("RLS"))
            {
                RequestLoadState requestLoadState = (RequestLoadState)Enum.Parse(typeof(RequestLoadState), this.StringBuilder.CreateString(HttpContext.Current.Request.QueryString["RLS"]));
                RequestCaller    requestCaller    = (RequestCaller)Enum.Parse(typeof(RequestCaller), this.StringBuilder.CreateString(HttpContext.Current.Request.QueryString["RC"]));

                switch (requestLoadState)
                {
                case RequestLoadState.Personnel:
                    switch (requestCaller)
                    {
                    case RequestCaller.Grid:
                        try
                        {
                            this.RequestBusiness.CheckNextDayOvertimeRequestLoadAccess_onPersonnelLoadStateInGridSchema();
                        }
                        catch (Exception)
                        {
                            this.tblToHourInNextDay_RequestOnUnallowableOverTime.Visible = false;
                        }
                        try
                        {
                            this.RequestBusiness.CheckAllNextDayOvertimeRequestLoadAccess_onPersonnelLoadStateInGridSchema();
                        }
                        catch (Exception)
                        {
                            this.tblFromAndToHourInNextDay_RequestOnUnallowableOverTime.Visible = false;
                        }
                        break;

                    case RequestCaller.GanttChart:
                        try
                        {
                            this.RequestBusiness.CheckNextDayOvertimeRequestLoadAccess_onPersonnelLoadStateInGanttChartSchema();
                        }
                        catch (Exception)
                        {
                            this.tblToHourInNextDay_RequestOnUnallowableOverTime.Visible = false;
                        }
                        try
                        {
                            this.RequestBusiness.CheckAllNextDayOvertimeRequestLoadAccess_onPersonnelLoadStateInGanttChartSchema();
                        }
                        catch (Exception)
                        {
                            this.tblFromAndToHourInNextDay_RequestOnUnallowableOverTime.Visible = false;
                        }
                        break;
                    }
                    break;

                case RequestLoadState.Manager:
                    switch (requestCaller)
                    {
                    case RequestCaller.Grid:
                        try
                        {
                            this.RequestBusiness.CheckNextDayOvertimeRequestLoadAccess_onManagerLoadStateInGridSchema();
                        }
                        catch (Exception)
                        {
                            this.tblToHourInNextDay_RequestOnUnallowableOverTime.Visible = false;
                        }
                        try
                        {
                            this.RequestBusiness.CheckAllNextDayOvertimeRequestLoadAccess_onManagerLoadStateInGridSchema();
                        }
                        catch (Exception)
                        {
                            this.tblToHourInNextDay_RequestOnUnallowableOverTime.Visible = false;
                        }
                        break;

                    case RequestCaller.GanttChart:
                        try
                        {
                            this.RequestBusiness.CheckNextDayOvertimeRequestLoadAccess_onManagerLoadStateInGanttChartSchema();
                        }
                        catch (Exception)
                        {
                            this.tblToHourInNextDay_RequestOnUnallowableOverTime.Visible = false;
                        }
                        try
                        {
                            this.RequestBusiness.CheckAllNextDayOvertimeRequestLoadAccess_onManagerLoadStateInGanttChartSchema();
                        }
                        catch (Exception)
                        {
                            this.tblFromAndToHourInNextDay_RequestOnUnallowableOverTime.Visible = false;
                        }
                        break;
                    }
                    break;

                case RequestLoadState.Operator:
                    switch (requestCaller)
                    {
                    case RequestCaller.Grid:
                        try
                        {
                            this.RequestBusiness.CheckNextDayOvertimeRequestLoadAccess_onOperatorLoadStateInGridSchema();
                        }
                        catch (Exception)
                        {
                            this.tblToHourInNextDay_RequestOnUnallowableOverTime.Visible = false;
                        }
                        try
                        {
                            this.RequestBusiness.CheckAllNextDayOvertimeRequestLoadAccess_onOperatorLoadStateInGridSchema();
                        }
                        catch (Exception)
                        {
                            this.tblFromAndToHourInNextDay_RequestOnUnallowableOverTime.Visible = false;
                        }
                        break;

                    case RequestCaller.GanttChart:
                        try
                        {
                            this.RequestBusiness.CheckNextDayOvertimeRequestLoadAccess_onOperatorLoadStateInGanttChartSchema();
                        }
                        catch (Exception)
                        {
                            this.tblToHourInNextDay_RequestOnUnallowableOverTime.Visible = false;
                        }
                        try
                        {
                            this.RequestBusiness.CheckAllNextDayOvertimeRequestLoadAccess_onOperatorLoadStateInGanttChartSchema();
                        }
                        catch (Exception)
                        {
                            this.tblFromAndToHourInNextDay_RequestOnUnallowableOverTime.Visible = false;
                        }
                        break;
                    }
                    break;
                }
            }
        }
        public string[] UpdateRequest_DailyRequestOnAbsencePage(string requestCaller, string requestLoadState, string state, string SelectedRequestID, string RequestType, string PreCardID, string RequestDate, string RequestFromDate, string RequestToDate, string RequestDescription, string IsSeakLeave, string PhysicianID, string IllnessID, string MissionLocationID, string RequestAttachmentFile)
        {
            this.InitializeCulture();

            string[] retMessage = new string[7];

            try
            {
                decimal RequestID         = 0;
                decimal selectedRequestID = decimal.Parse(this.StringBuilder.CreateString(SelectedRequestID));
                Request request           = new Request();
                request.ID = selectedRequestID;
                UIActionType     uam = (UIActionType)Enum.Parse(typeof(UIActionType), this.StringBuilder.CreateString(state).ToUpper());
                RequestCaller    RC  = (RequestCaller)Enum.Parse(typeof(RequestCaller), this.StringBuilder.CreateString(requestCaller));
                RequestLoadState RLS = (RequestLoadState)Enum.Parse(typeof(RequestLoadState), this.StringBuilder.CreateString(requestLoadState));

                switch (uam)
                {
                case UIActionType.ADD:
                    RequestTypes requestType = (RequestTypes)Enum.Parse(typeof(RequestTypes), this.StringBuilder.CreateString(RequestType));
                    decimal      preCardID   = decimal.Parse(this.StringBuilder.CreateString(PreCardID));
                    RequestFromDate    = this.StringBuilder.CreateString(RequestFromDate);
                    RequestToDate      = this.StringBuilder.CreateString(RequestToDate);
                    RequestDescription = this.StringBuilder.CreateString(RequestDescription);
                    bool    isSeakLeave       = bool.Parse(this.StringBuilder.CreateString(IsSeakLeave));
                    decimal physicianID       = decimal.Parse(this.StringBuilder.CreateString(PhysicianID));
                    decimal illnessID         = decimal.Parse(this.StringBuilder.CreateString(IllnessID));
                    decimal missionLocationID = decimal.Parse(this.StringBuilder.CreateString(MissionLocationID));
                    RequestAttachmentFile = this.StringBuilder.CreateString(RequestAttachmentFile);

                    request.RegisterDate = Utility.ToMildiDateTime(this.StringBuilder.CreateString(RequestDate));
                    Precard precard = new Precard();
                    precard.ID              = preCardID;
                    request.Precard         = precard;
                    request.TheFromDate     = RequestFromDate;
                    request.TheToDate       = RequestToDate;
                    request.IsDateSetByUser = true;
                    request.Description     = RequestDescription;
                    request.AttachmentFile  = RequestAttachmentFile;
                    switch (requestType)
                    {
                    case RequestTypes.Leave:
                        if (isSeakLeave)
                        {
                            if (physicianID != -1)
                            {
                                request.DoctorID = physicianID;
                            }
                            if (illnessID != -1)
                            {
                                request.IllnessID = illnessID;
                            }
                        }
                        break;

                    case RequestTypes.Mission:
                        if (missionLocationID != -1)
                        {
                            request.DutyPositionID = missionLocationID;
                        }
                        break;

                    default:
                        break;
                    }

                    switch (RC)
                    {
                    case RequestCaller.Grid:
                        switch (RLS)
                        {
                        case RequestLoadState.Personnel:
                            request = this.RequestBusiness.InsertDailyRequest_onPersonnelLoadStateInGridSchema(request);
                            break;

                        case RequestLoadState.Manager:
                            request = this.RequestBusiness.InsertDailyRequest_onManagerLoadStateInGridSchema(request);
                            break;
                        }
                        break;

                    case RequestCaller.GanttChart:
                        switch (RLS)
                        {
                        case RequestLoadState.Personnel:
                            request = this.RequestBusiness.InsertDailyRequest_onPersonnelLoadStateInGanttChartSchema(request);
                            break;

                        case RequestLoadState.Manager:
                            request = this.RequestBusiness.InsertDailyRequest_onManagerLoadStateInGanttChartSchema(request);
                            break;
                        }
                        break;
                    }
                    RequestID = request.ID;
                    break;

                case UIActionType.DELETE:
                    if (selectedRequestID == 0)
                    {
                        retMessage = this.exceptionHandler.HandleException(this.Page, ExceptionTypes.Exception, new Exception(GetLocalResourceObject("NoRequestSelectedforDelete").ToString()), retMessage);
                        return(retMessage);
                    }
                    switch (RC)
                    {
                    case RequestCaller.Grid:
                        switch (RLS)
                        {
                        case RequestLoadState.Personnel:
                            request = this.MasterRequestBusiness.GetRequestByID(request.ID);
                            this.RequestBusiness.DeleteDailyRequest_onPersonnelLoadStateInGridSchema(request);
                            this.MasterRequestBusiness.DeleteRequestAttachment(WebConfigurationManager.AppSettings["RequestAttachmentsPath"] + "\\" + request.AttachmentFile);
                            break;

                        case RequestLoadState.Manager:
                            this.RequestBusiness.DeleteDailyRequest_onManagerLoadStateInGridSchema(request);
                            break;
                        }
                        break;

                    case RequestCaller.GanttChart:
                        switch (RLS)
                        {
                        case RequestLoadState.Personnel:
                            request = this.MasterRequestBusiness.GetRequestByID(request.ID);
                            this.RequestBusiness.DeleteDailyRequest_onPersonnelLoadStateInGanttChartSchema(request);
                            this.MasterRequestBusiness.DeleteRequestAttachment(WebConfigurationManager.AppSettings["RequestAttachmentsPath"] + "\\" + request.AttachmentFile);
                            break;

                        case RequestLoadState.Manager:
                            this.RequestBusiness.DeleteDailyRequest_onManagerLoadStateInGanttChartSchema(request);
                            break;
                        }
                        break;
                    }
                    break;
                }

                retMessage[0] = GetLocalResourceObject("RetSuccessType").ToString();
                string SuccessMessageBody = string.Empty;
                switch (uam)
                {
                case Business.UIActionType.ADD:
                    SuccessMessageBody = GetLocalResourceObject("AddComplete").ToString();
                    break;

                case Business.UIActionType.DELETE:
                    SuccessMessageBody = GetLocalResourceObject("DeleteComplete").ToString();
                    break;

                default:
                    break;
                }
                retMessage[1] = SuccessMessageBody;
                retMessage[2] = "success";
                retMessage[3] = RequestID.ToString();
                retMessage[4] = ((int)request.Status).ToString();
                retMessage[5] = request.RegistrationDate;
                retMessage[6] = request.AddClientSide.ToString().ToLower();
                return(retMessage);
            }
            catch (UIValidationExceptions ex)
            {
                retMessage = this.exceptionHandler.HandleException(this.Page, ExceptionTypes.UIValidationExceptions, ex, retMessage);
                return(retMessage);
            }
            catch (UIBaseException ex)
            {
                retMessage = this.exceptionHandler.HandleException(this.Page, ExceptionTypes.UIBaseException, ex, retMessage);
                return(retMessage);
            }
            catch (Exception ex)
            {
                retMessage = this.exceptionHandler.HandleException(this.Page, ExceptionTypes.Exception, ex, retMessage);
                return(retMessage);
            }
        }
        public string[] UpdateRequest_OvertimeJustificationRequestPage(string requestCaller, string requestLoadState, string state, string SelectedRequestID, string PreCardID, string RequestDate, string RequestFromDate, string RequestToDate, string RequestFromTime, string RequestToTime, string IsRequestToTimeInNextDay, string IsRequestFromAndToTimeInNextDay, string RequestDuration, string RequestDescription, string PersonnelID, string IsWarning)
        {
            this.InitializeCulture();

            string[] retMessage = new string[7];

            try
            {
                AttackDefender.CSRFDefender(this.Page);
                decimal RequestID         = 0;
                decimal selectedRequestID = decimal.Parse(this.StringBuilder.CreateString(SelectedRequestID), CultureInfo.InvariantCulture);
                Request request           = new Request();
                request.ID = selectedRequestID;
                UIActionType     uam         = (UIActionType)Enum.Parse(typeof(UIActionType), this.StringBuilder.CreateString(state).ToUpper());
                RequestCaller    RC          = (RequestCaller)Enum.Parse(typeof(RequestCaller), this.StringBuilder.CreateString(requestCaller));
                RequestLoadState RLS         = (RequestLoadState)Enum.Parse(typeof(RequestLoadState), this.StringBuilder.CreateString(requestLoadState));
                decimal          personnelID = decimal.Parse(this.StringBuilder.CreateString(PersonnelID), CultureInfo.InvariantCulture);
                bool             isWarning   = bool.Parse(this.StringBuilder.CreateString(IsWarning));

                switch (uam)
                {
                case UIActionType.ADD:
                    decimal preCardID = decimal.Parse(this.StringBuilder.CreateString(PreCardID), CultureInfo.InvariantCulture);
                    RequestFromDate = this.StringBuilder.CreateString(RequestFromDate);
                    RequestToDate   = this.StringBuilder.CreateString(RequestToDate);
                    RequestFromTime = this.StringBuilder.CreateString(RequestFromTime);
                    RequestToTime   = this.StringBuilder.CreateString(RequestToTime);
                    RequestDuration = this.StringBuilder.CreateString(RequestDuration);
                    bool isRequestToTimeInNextDay        = bool.Parse(this.StringBuilder.CreateString(IsRequestToTimeInNextDay));
                    bool isRequestFromAndToTimeInNextDay = bool.Parse(this.StringBuilder.CreateString(IsRequestFromAndToTimeInNextDay));
                    RequestDescription = this.StringBuilder.CreateString(RequestDescription);

                    Precard precard = new Precard();
                    precard.ID                 = preCardID;
                    request.Precard            = precard;
                    request.TheFromDate        = RequestFromDate;
                    request.TheToDate          = RequestToDate;
                    request.IsDateSetByUser    = true;
                    request.TheFromTime        = RequestFromTime;
                    request.TheToTime          = RequestToTime;
                    request.TheTimeDuration    = !isRequestToTimeInNextDay ? RequestDuration : string.Empty;
                    request.ContinueOnTomorrow = isRequestToTimeInNextDay;
                    if (!isRequestToTimeInNextDay)
                    {
                        request.AllOnTomorrow = isRequestFromAndToTimeInNextDay;
                    }
                    request.Description = RequestDescription;
                    request.IsExecuteWarningUIValidation = isWarning;

                    switch (RC)
                    {
                    case RequestCaller.Grid:
                        switch (RLS)
                        {
                        case RequestLoadState.Personnel:
                            request = this.RequestBusiness.InsertOverTimeRequest_onPersonnelLoadStateInGridSchema(request);
                            break;

                        case RequestLoadState.Manager:
                            request = this.RequestBusiness.InsertOverTimeRequest_onManagerLoadStateInGridSchema(request);
                            break;

                        case RequestLoadState.Operator:
                            request.Person = new Model.Person()
                            {
                                ID = personnelID
                            };
                            request = this.RequestBusiness.InsertOverTimeRequest_onOperatorLoadStateInGridSchema(request);
                            break;
                        }
                        break;

                    case RequestCaller.GanttChart:
                        switch (RLS)
                        {
                        case RequestLoadState.Personnel:
                            request = this.RequestBusiness.InsertOverTimeRequest_onPersonnelLoadStateInGanttChartSchema(request);
                            break;

                        case RequestLoadState.Manager:
                            request = this.RequestBusiness.InsertOverTimeRequest_onManagerLoadStateInGanttChartSchema(request);
                            break;

                        case RequestLoadState.Operator:
                            request.Person = new Model.Person()
                            {
                                ID = personnelID
                            };
                            request = this.RequestBusiness.InsertOverTimeRequest_onOperatorLoadStateInGanttChartSchema(request);
                            break;
                        }
                        break;
                    }
                    RequestID = request.ID;
                    break;

                case UIActionType.DELETE:
                    if (selectedRequestID == 0)
                    {
                        retMessage = this.exceptionHandler.HandleException(this.Page, ExceptionTypes.UIValidationExceptions, new Exception(GetLocalResourceObject("NoRequestSelectedforDelete").ToString()), retMessage);
                        return(retMessage);
                    }
                    switch (RC)
                    {
                    case RequestCaller.Grid:
                        switch (RLS)
                        {
                        case RequestLoadState.Personnel:
                            this.RequestBusiness.DeleteOverTimeRequest_onPersonnelLoadStateInGridSchema(request);
                            break;

                        case RequestLoadState.Manager:
                            this.RequestBusiness.DeleteOverTimeRequest_onManagerLoadStateInGridSchema(request);
                            break;

                        case RequestLoadState.Operator:
                            this.RequestBusiness.DeleteOverTimeRequest_onOperatorLoadStateInGridSchema(request);
                            break;
                        }
                        break;

                    case RequestCaller.GanttChart:
                        switch (RLS)
                        {
                        case RequestLoadState.Personnel:
                            this.RequestBusiness.DeleteOverTimeRequest_onPersonnelLoadStateInGanttChartSchema(request);
                            break;

                        case RequestLoadState.Manager:
                            this.RequestBusiness.DeleteOverTimeRequest_onManagerLoadStateInGanttChartSchema(request);
                            break;

                        case RequestLoadState.Operator:
                            this.RequestBusiness.DeleteOverTimeRequest_onOperatorLoadStateInGanttChartSchema(request);
                            break;
                        }
                        break;
                    }
                    break;
                }

                retMessage[0] = GetLocalResourceObject("RetSuccessType").ToString();
                string SuccessMessageBody = string.Empty;
                switch (uam)
                {
                case Business.UIActionType.ADD:
                    SuccessMessageBody = GetLocalResourceObject("AddComplete").ToString();
                    break;

                case Business.UIActionType.DELETE:
                    SuccessMessageBody = GetLocalResourceObject("DeleteComplete").ToString();
                    break;

                default:
                    break;
                }
                retMessage[1] = SuccessMessageBody;
                retMessage[2] = "success";
                retMessage[3] = RequestID.ToString();
                retMessage[4] = ((int)request.Status).ToString();
                retMessage[5] = request.RegistrationDate;
                return(retMessage);
            }
            catch (UIValidationExceptions ex)
            {
                retMessage = this.exceptionHandler.HandleException(this.Page, ExceptionTypes.UIValidationExceptions, ex, retMessage);
                return(retMessage);
            }
            catch (UIBaseException ex)
            {
                retMessage = this.exceptionHandler.HandleException(this.Page, ExceptionTypes.UIBaseException, ex, retMessage);
                return(retMessage);
            }
            catch (Exception ex)
            {
                retMessage = this.exceptionHandler.HandleException(this.Page, ExceptionTypes.Exception, ex, retMessage);
                return(retMessage);
            }
        }
Ejemplo n.º 6
0
    public string[] UpdatePhysician_DefinePhysiciansPage(string state, string requestCaller, string requestLoadState, string PhysiciansID, string FirstName, string LastName, string Proficiency, string MedicalAssociation, string Description, string Caller, string Target, string UserCaller)
    {
        this.InitializeCulture();

        string[] retMessage = new string[4];

        try
        {
            AttackDefender.CSRFDefender(this.Page);
            decimal PhysicianID         = 0;
            decimal selectedPhysicianID = decimal.Parse(this.StringBuilder.CreateString(PhysiciansID), CultureInfo.InvariantCulture);
            FirstName          = this.StringBuilder.CreateString(FirstName);
            LastName           = this.StringBuilder.CreateString(LastName);
            Proficiency        = this.StringBuilder.CreateString(Proficiency);
            MedicalAssociation = this.StringBuilder.CreateString(MedicalAssociation);
            Description        = this.StringBuilder.CreateString(Description);
            UIActionType     uam        = (UIActionType)Enum.Parse(typeof(UIActionType), this.StringBuilder.CreateString(state).ToUpper());
            RequestCaller    RC         = (RequestCaller)Enum.Parse(typeof(RequestCaller), this.StringBuilder.CreateString(requestCaller));
            RequestLoadState RLS        = (RequestLoadState)Enum.Parse(typeof(RequestLoadState), this.StringBuilder.CreateString(requestLoadState));
            RequestTarget    target     = (RequestTarget)Enum.Parse(typeof(RequestTarget), this.StringBuilder.CreateString(Target));
            PageCaller       caller     = (PageCaller)Enum.Parse(typeof(PageCaller), this.StringBuilder.CreateString(Caller));
            UserCallerEnum   userCaller = (UserCallerEnum)Enum.Parse(typeof(UserCallerEnum), this.StringBuilder.CreateString(UserCaller));
            Doctor           physician  = new Doctor();
            physician.ID = selectedPhysicianID;
            if (uam != UIActionType.DELETE)
            {
                physician.FirstName      = FirstName;
                physician.LastName       = LastName;
                physician.Takhasos       = Proficiency;
                physician.Nezampezaeshki = MedicalAssociation;
                physician.Description    = Description;
            }

            switch (uam)
            {
            case UIActionType.ADD:
                switch (target)
                {
                case RequestTarget.Hourly:
                    switch (caller)
                    {
                    case PageCaller.RequestRegister:
                        switch (userCaller)
                        {
                        case UserCallerEnum.NormalUser:
                            PhysicianID = this.PhysiciansBusiness.InsertPhysician_onRequestHourly_onRequestRegister(physician, uam);
                            break;

                        case UserCallerEnum.Operator:
                            PhysicianID = this.PhysiciansBusiness.InsertPhysician_onRequestHourly_onRequestRegisterByOperator(physician, uam);
                            break;

                        case UserCallerEnum.OperatorPermit:
                            PhysicianID = this.PhysiciansBusiness.InsertPhysician_onRequestHourly_onRequestRegisterByOperatorPermit(physician, uam);
                            break;
                        }
                        break;

                    case PageCaller.DailyRequestOnAbsence:
                        break;

                    case PageCaller.HourlyRequestOnAbsence:
                        switch (RC)
                        {
                        case RequestCaller.Grid:
                            switch (RLS)
                            {
                            case RequestLoadState.Personnel:
                                PhysicianID = this.PhysiciansBusiness.InsertPhysician_onHourlyRequest_onPersonnel_onGridSchema(physician, uam);
                                break;

                            case RequestLoadState.Manager:
                                PhysicianID = this.PhysiciansBusiness.InsertPhysician_onHourlyRequest_onManager_onGridSchema(physician, uam);
                                break;

                            case RequestLoadState.Operator:
                                PhysicianID = this.PhysiciansBusiness.InsertPhysician_onHourlyRequest_onOperator_onGridSchema(physician, uam);
                                break;

                            case RequestLoadState.Integral:
                                break;

                            default:
                                break;
                            }
                            break;

                        case RequestCaller.GanttChart:
                            switch (RLS)
                            {
                            case RequestLoadState.Personnel:
                                PhysicianID = this.PhysiciansBusiness.InsertPhysician_onHourlyRequest_onPersonnel_onGanttChartSchema(physician, uam);
                                break;

                            case RequestLoadState.Manager:
                                PhysicianID = this.PhysiciansBusiness.InsertPhysician_onHourlyRequest_onManager_onGanttChartSchema(physician, uam);
                                break;

                            case RequestLoadState.Operator:
                                PhysicianID = this.PhysiciansBusiness.InsertPhysician_onHourlyRequest_onOperator_onGanttChartSchema(physician, uam);
                                break;

                            case RequestLoadState.Integral:
                                break;

                            default:
                                break;
                            }
                            break;

                        case RequestCaller.RequestRegister:
                            break;

                        default:
                            break;
                        }
                        break;
                    }
                    break;

                case RequestTarget.Daily:
                    switch (caller)
                    {
                    case PageCaller.RequestRegister:
                        switch (userCaller)
                        {
                        case UserCallerEnum.NormalUser:
                            PhysicianID = this.PhysiciansBusiness.InsertPhysician_onRequestDaily_onRequestRegister(physician, uam);
                            break;

                        case UserCallerEnum.Operator:
                            PhysicianID = this.PhysiciansBusiness.InsertPhysician_onRequestDaily_onRequestRegisterByOperator(physician, uam);
                            break;

                        case UserCallerEnum.OperatorPermit:
                            PhysicianID = this.PhysiciansBusiness.InsertPhysician_onRequestDaily_onRequestRegisterByOperatorPermit(physician, uam);
                            break;
                        }
                        break;

                    case PageCaller.HourlyRequestOnAbsence:
                        break;

                    case PageCaller.DailyRequestOnAbsence:
                        switch (RC)
                        {
                        case RequestCaller.Grid:
                            switch (RLS)
                            {
                            case RequestLoadState.Personnel:
                                PhysicianID = this.PhysiciansBusiness.InsertPhysician_onDailyRequest_onPersonnel_onGridSchema(physician, uam);
                                break;

                            case RequestLoadState.Manager:
                                PhysicianID = this.PhysiciansBusiness.InsertPhysician_onDailyRequest_onManager_onGridSchema(physician, uam);
                                break;

                            case RequestLoadState.Operator:
                                PhysicianID = this.PhysiciansBusiness.InsertPhysician_onDailyRequest_onOperator_onGridSchema(physician, uam);
                                break;

                            case RequestLoadState.Integral:
                                break;

                            default:
                                break;
                            }
                            break;

                        case RequestCaller.GanttChart:
                            switch (RLS)
                            {
                            case RequestLoadState.Personnel:
                                PhysicianID = this.PhysiciansBusiness.InsertPhysician_onDailyRequest_onPersonnel_onGanttChartSchema(physician, uam);
                                break;

                            case RequestLoadState.Manager:
                                PhysicianID = this.PhysiciansBusiness.InsertPhysician_onDailyRequest_onManager_onGanttChartSchema(physician, uam);
                                break;

                            case RequestLoadState.Operator:
                                PhysicianID = this.PhysiciansBusiness.InsertPhysician_onDailyRequest_onOperator_onGanttChartSchema(physician, uam);
                                break;

                            case RequestLoadState.Integral:
                                break;

                            default:
                                break;
                            }
                            break;

                        case RequestCaller.RequestRegister:
                            break;

                        default:
                            break;
                        }
                        break;
                    }
                    break;

                case RequestTarget.OverTime:
                    break;

                case RequestTarget.Imperative:
                    break;
                }
                break;

            case UIActionType.EDIT:
                break;

            case UIActionType.DELETE:
                break;
            }

            retMessage[0] = GetLocalResourceObject("RetSuccessType").ToString();
            string SuccessMessageBody = string.Empty;
            switch (uam)
            {
            case UIActionType.ADD:
                SuccessMessageBody = GetLocalResourceObject("AddComplete").ToString();
                break;

            case UIActionType.EDIT:
                SuccessMessageBody = GetLocalResourceObject("EditComplete").ToString();
                break;

            case UIActionType.DELETE:
                SuccessMessageBody = GetLocalResourceObject("DeleteComplete").ToString();
                break;

            default:
                break;
            }
            retMessage[1] = SuccessMessageBody;
            retMessage[2] = "success";
            retMessage[3] = PhysicianID.ToString();
            return(retMessage);
        }
        catch (UIValidationExceptions ex)
        {
            retMessage = this.exceptionHandler.HandleException(this.Page, ExceptionTypes.UIValidationExceptions, ex, retMessage);
            return(retMessage);
        }
        catch (UIBaseException ex)
        {
            retMessage = this.exceptionHandler.HandleException(this.Page, ExceptionTypes.UIBaseException, ex, retMessage);
            return(retMessage);
        }
        catch (Exception ex)
        {
            retMessage = this.exceptionHandler.HandleException(this.Page, ExceptionTypes.Exception, ex, retMessage);
            return(retMessage);
        }
    }
Ejemplo n.º 7
0
    public string[] UpdateIllness_DefineIllnessPage(string state, string requestCaller, string requestLoadState, string IllnessID, string NameIllness, string Description, string Caller, string Target, string UserCaller)
    {
        this.InitializeCulture();

        string[] retMessage = new string[4];

        try
        {
            AttackDefender.CSRFDefender(this.Page);
            decimal illnessID         = 0;
            decimal selectedIllnessID = decimal.Parse(this.StringBuilder.CreateString(IllnessID), CultureInfo.InvariantCulture);
            NameIllness = this.StringBuilder.CreateString(NameIllness);

            Description = this.StringBuilder.CreateString(Description);
            UIActionType     uam        = (UIActionType)Enum.Parse(typeof(UIActionType), this.StringBuilder.CreateString(state).ToUpper());
            RequestTarget    target     = (RequestTarget)Enum.Parse(typeof(RequestTarget), this.StringBuilder.CreateString(Target));
            PageCaller       caller     = (PageCaller)Enum.Parse(typeof(PageCaller), this.StringBuilder.CreateString(Caller));
            UserCallerEnum   userCaller = (UserCallerEnum)Enum.Parse(typeof(UserCallerEnum), this.StringBuilder.CreateString(UserCaller));
            RequestCaller    RC         = (RequestCaller)Enum.Parse(typeof(RequestCaller), this.StringBuilder.CreateString(requestCaller));
            RequestLoadState RLS        = (RequestLoadState)Enum.Parse(typeof(RequestLoadState), this.StringBuilder.CreateString(requestLoadState));
            Illness          illness    = new Illness();
            illness.ID = selectedIllnessID;
            if (uam != UIActionType.DELETE)
            {
                illness.Name        = NameIllness;
                illness.Description = Description;
            }
            switch (uam)
            {
            case UIActionType.ADD:
                switch (target)
                {
                case RequestTarget.Hourly:
                    switch (caller)
                    {
                    case PageCaller.RequestRegister:
                        switch (userCaller)
                        {
                        case UserCallerEnum.NormalUser:
                            illnessID = this.IllnessBusiness.InsertIllness_onRequestHourly_onRequestRegister(illness, uam);
                            break;

                        case UserCallerEnum.Operator:
                            illnessID = this.IllnessBusiness.InsertIllness_onRequestHourly_onRequestRegisterByOperator(illness, uam);
                            break;

                        case UserCallerEnum.OperatorPermit:
                            illnessID = this.IllnessBusiness.InsertIllness_onRequestHourly_onRequestRegisterByOperatorPermit(illness, uam);
                            break;
                        }
                        break;

                    case PageCaller.DailyRequestOnAbsence:
                        break;

                    case PageCaller.HourlyRequestOnAbsence:
                        switch (RC)
                        {
                        case RequestCaller.Grid:
                            switch (RLS)
                            {
                            case RequestLoadState.Personnel:
                                this.IllnessBusiness.InsertIllness_onHourlyRequest_onPersonnel_onGridSchema(illness, uam);
                                break;

                            case RequestLoadState.Manager:
                                this.IllnessBusiness.InsertIllness_onHourlyRequest_onManager_onGridSchema(illness, uam);
                                break;

                            case RequestLoadState.Operator:
                                this.IllnessBusiness.InsertIllness_onHourlyRequest_onOperator_onGridSchema(illness, uam);
                                break;

                            case RequestLoadState.Integral:
                                break;

                            default:
                                break;
                            }
                            break;

                        case RequestCaller.GanttChart:
                            switch (RLS)
                            {
                            case RequestLoadState.Personnel:
                                this.IllnessBusiness.InsertIllness_onHourlyRequest_onPersonnel_onGanttChartSchema(illness, uam);
                                break;

                            case RequestLoadState.Manager:
                                this.IllnessBusiness.InsertIllness_onHourlyRequest_onManager_onGanttChartSchema(illness, uam);
                                break;

                            case RequestLoadState.Operator:
                                this.IllnessBusiness.InsertIllness_onHourlyRequest_onOperator_onGanttChartSchema(illness, uam);
                                break;

                            case RequestLoadState.Integral:
                                break;

                            default:
                                break;
                            }
                            break;

                        case RequestCaller.RequestRegister:
                            break;

                        default:
                            break;
                        }
                        break;
                    }
                    break;

                case RequestTarget.Daily:
                    switch (caller)
                    {
                    case PageCaller.RequestRegister:
                        switch (userCaller)
                        {
                        case UserCallerEnum.NormalUser:
                            illnessID = this.IllnessBusiness.InsertIllness_onRequestDaily_onRequestRegister(illness, uam);
                            break;

                        case UserCallerEnum.Operator:
                            illnessID = this.IllnessBusiness.InsertIllness_onRequestDaily_onRequestRegisterByOperator(illness, uam);
                            break;

                        case UserCallerEnum.OperatorPermit:
                            illnessID = this.IllnessBusiness.InsertIllness_onRequestDaily_onRequestRegisterByOperatorPermit(illness, uam);
                            break;
                        }
                        break;

                    case PageCaller.DailyRequestOnAbsence:
                        switch (RC)
                        {
                        case RequestCaller.Grid:
                            switch (RLS)
                            {
                            case RequestLoadState.Personnel:
                                this.IllnessBusiness.InsertIllness_onDailyRequest_onPersonnel_onGridSchema(illness, uam);
                                break;

                            case RequestLoadState.Manager:
                                this.IllnessBusiness.InsertIllness_onDailyRequest_onManager_onGridSchema(illness, uam);
                                break;

                            case RequestLoadState.Operator:
                                this.IllnessBusiness.InsertIllness_onDailyRequest_onOperator_onGridSchema(illness, uam);
                                break;

                            case RequestLoadState.Integral:
                                break;

                            default:
                                break;
                            }
                            break;

                        case RequestCaller.GanttChart:
                            switch (RLS)
                            {
                            case RequestLoadState.Personnel:
                                this.IllnessBusiness.InsertIllness_onDailyRequest_onPersonnel_onGanttChartSchema(illness, uam);
                                break;

                            case RequestLoadState.Manager:
                                this.IllnessBusiness.InsertIllness_onDailyRequest_onManager_onGanttChartSchema(illness, uam);
                                break;

                            case RequestLoadState.Operator:
                                this.IllnessBusiness.InsertIllness_onDailyRequest_onOperator_onGanttChartSchema(illness, uam);
                                break;

                            case RequestLoadState.Integral:
                                break;

                            default:
                                break;
                            }
                            break;

                        case RequestCaller.RequestRegister:
                            break;

                        default:
                            break;
                        }
                        break;

                    case PageCaller.HourlyRequestOnAbsence:
                        break;
                    }
                    break;

                case RequestTarget.OverTime:
                    break;

                case RequestTarget.Imperative:
                    break;
                }
                break;

            case UIActionType.EDIT:
                //if (selectedPhysicianID == 0)
                //{
                //    retMessage = this.exceptionHandler.HandleException(this.Page, ExceptionTypes.UIValidationExceptions, new Exception(GetLocalResourceObject("NoPhysicianSelectedforEdit").ToString()), retMessage);
                //    return retMessage;
                //}
                //PhysicianID = this.PhysiciansBusiness.Updatephysician(physician, uam);
                break;

            case UIActionType.DELETE:
                //if (selectedPhysicianID == 0)
                //{
                //    retMessage = this.exceptionHandler.HandleException(this.Page, ExceptionTypes.UIValidationExceptions, new Exception(GetLocalResourceObject("NoPhysicianSelectedforDelete").ToString()), retMessage);
                //    return retMessage;
                //}
                //PhysicianID = this.PhysiciansBusiness.Deletephysician(physician, uam);
                break;
            }

            retMessage[0] = GetLocalResourceObject("RetSuccessType").ToString();
            string SuccessMessageBody = string.Empty;
            switch (uam)
            {
            case UIActionType.ADD:
                SuccessMessageBody = GetLocalResourceObject("AddComplete").ToString();
                break;

            case UIActionType.EDIT:
                SuccessMessageBody = GetLocalResourceObject("EditComplete").ToString();
                break;

            case UIActionType.DELETE:
                SuccessMessageBody = GetLocalResourceObject("DeleteComplete").ToString();
                break;

            default:
                break;
            }
            retMessage[1] = SuccessMessageBody;
            retMessage[2] = "success";
            retMessage[3] = illnessID.ToString();
            return(retMessage);
        }
        catch (UIValidationExceptions ex)
        {
            retMessage = this.exceptionHandler.HandleException(this.Page, ExceptionTypes.UIValidationExceptions, ex, retMessage);
            return(retMessage);
        }
        catch (UIBaseException ex)
        {
            retMessage = this.exceptionHandler.HandleException(this.Page, ExceptionTypes.UIBaseException, ex, retMessage);
            return(retMessage);
        }
        catch (Exception ex)
        {
            retMessage = this.exceptionHandler.HandleException(this.Page, ExceptionTypes.Exception, ex, retMessage);
            return(retMessage);
        }
    }