Esempio n. 1
0
        protected void ADDNewJI(object sender, DirectEventArgs e)
        {
            //Reset all values of the relative object
            EditJobInfoTab.Reset();
            this.EditJobInfoWindow.Title = Resources.Common.AddNewRecord;
            FillDivision();
            FillDepartment();
            FillBranch();
            FillPosition();
            date.SelectedDate = DateTime.Today;
            RecordRequest request = new RecordRequest();

            request.RecordID = CurrentEmployee.Text;
            RecordResponse <Employee> qv = _employeeService.Get <Employee>(request);

            departmentId.Select(qv.result.departmentId);
            branchId.Select(qv.result.branchId);
            divisionId.Select(qv.result.divisionId);
            positionId.Select(qv.result.positionId);
            reportToId.Select(qv.result.reportToId);
            if (!string.IsNullOrEmpty(TotalJIRecords.Text))
            {
                if (TotalJIRecords.Text == "0")
                {
                    if (qv.result.hireDate != null)
                    {
                        date.SelectedDate = (DateTime)qv.result.hireDate;
                    }
                }
            }
            this.EditJobInfoWindow.Show();
        }
Esempio n. 2
0
        protected void PoPuP(object sender, DirectEventArgs e)
        {
            int    id   = Convert.ToInt32(e.ExtraParams["id"]);
            string type = e.ExtraParams["type"];

            switch (type)
            {
            case "imgEdit":
                //Step 1 : get the object from the Web Service
                RecordRequest r = new RecordRequest();
                r.RecordID = id.ToString();
                RecordResponse <TransactionLog> log = _systemService.ChildGetRecord <TransactionLog>(r);
                string x = "";
                try
                {
                    JObject json      = JObject.Parse(log.result.data);
                    string  formatted = json.ToString();
                    x = formatted;
                }
                catch
                {
                    x = log.result.data;
                }
                log.result.data = x;
                logBodyForm.SetValues(log.result);
                logBodyScreen.Show();
                break;

            default:

                break;
            }
        }
Esempio n. 3
0
        protected void ADDNewRecord(object sender, DirectEventArgs e)
        {
            BasicInfoTab.Reset();


            //Reset all values of the relative object

            this.EditRecordWindow.Title    = Resources.Common.AddNewRecord;
            date.SelectedDate              = effectiveDate.SelectedDate = DateTime.Now;
            panelRecordDetails.ActiveIndex = 0;
            SetTabPanelEnable(false);
            FillLoanType();
            //FillBranchField();
            FillCurrency();

            RecordRequest req1 = new RecordRequest();

            req1.RecordID = _systemService.SessionHelper.GetEmployeeId();
            RecordResponse <MyInfo> r = _selfServiceService.ChildGetRecord <MyInfo>(req1);

            if (!r.Success)//it maybe be another condition
            {
                //Show an error saving...
                X.MessageBox.ButtonText.Ok = Resources.Common.Ok;
                Common.errorMessage(r);
                return;
            }

            branchId.Select(r.result.branchId);
            effectiveDate.ReadOnly = false;
            this.EditRecordWindow.Show();
        }
Esempio n. 4
0
        protected void ShowEmployeePreview(object sender, DirectEventArgs e)
        {
            string languageId = e.ExtraParams["languageId"];
            string teId       = e.ExtraParams["teId"];
            string empId      = e.ExtraParams["empId"];

            EmployeeTemplatePreviewRecordRequest req = new EmployeeTemplatePreviewRecordRequest();

            req.EmployeeId = Convert.ToInt32(empId);
            req.LanguageId = Convert.ToInt32(languageId);
            req.TemplateId = Convert.ToInt32(teId);

            RecordResponse <EmployeeTemplatePreview> r = _administrationService.ChildGetRecord <EmployeeTemplatePreview>(req);

            if (!r.Success)//it maybe another check
            {
                X.MessageBox.ButtonText.Ok = Resources.Common.Ok;
                Common.errorMessage(r);;
                return;
            }
            selectEmpWindow.Hide();

            templatePreviewWindow.Show();
            Panel1.Html = r.result.textBody;
        }
        public async Task <IActionResult> Create([FromBody] CreateRecordRequest request)
        {
            var record = new Record
            {
                Id          = Guid.NewGuid(),
                Teacher     = request.Teacher,
                Room        = request.Room,
                Note        = request.Note,
                ClassNumber = request.ClassNumber,
                ClassLetter = request.ClassLetter,
                Lessons     = request.Lessons,
                Date        = request.Date
            };

            var created = await _recordService.CreateRecord(record);

            if (created == false)
            {
                return(BadRequest());
            }

            var baseUrl     = $"{HttpContext.Request.Scheme}://{HttpContext.Request.Host.ToUriComponent()}";
            var locationUri = baseUrl + "/" + ApiRoutes.AdminRecords.Get.Replace("{recordId}", record.Id.ToString());

            var response = new RecordResponse {
                Id = record.Id
            };

            return(Created(locationUri, response));
        }
Esempio n. 6
0
        private void FillJobInfo()
        {
            try
            {
                if (_systemService.SessionHelper.GetEmployeeId() != null)
                {
                    RecordRequest req = new RecordRequest();
                    req.RecordID = _systemService.SessionHelper.GetEmployeeId();
                    RecordResponse <Employee> response = _employeeService.Get <Employee>(req);
                    if (!response.Success)
                    {
                        Common.errorMessage(response);
                    }

                    if (response.result != null)
                    {
                        defaultDepartmentId = response.result.departmentId.ToString();
                        defaultBranchId     = response.result.branchId.ToString();
                        defaultDivisiontId  = response.result.divisionId.ToString();
                    }
                }
                FillDepartment();
                FillPosition();
                FillBranch();
                FillDivision();
            }
            catch (Exception exp)
            {
                X.MessageBox.Alert(GetGlobalResourceObject("Common", "Error").ToString(), exp.Message);
            }
        }
Esempio n. 7
0
        protected void PoPuPPE(object sender, DirectEventArgs e)
        {
            string salaryType = e.ExtraParams["salaryType"];
            string periodId   = e.ExtraParams["periodId"];

            FiscalPeriodRecordRequest request = new FiscalPeriodRecordRequest();

            request.year       = CurrentYear.Text;
            request.salaryType = salaryType;
            request.periodId   = periodId;
            RecordResponse <FiscalPeriod> response = _payrollService.ChildGetRecord <FiscalPeriod>(request);

            if (!response.Success)
            {
                X.MessageBox.ButtonText.Ok = Resources.Common.Ok;
                Common.errorMessage(response);
                return;
            }
            //PE_startDate.MinDate = PE_endDate.MinDate = response.result.startDate;
            //PE_startDate.MaxDate = PE_endDate.MaxDate = response.result.endDate;

            //Step 2 : call setvalues with the retrieved object

            this.fiscalPeriodForm.SetValues(response.result);
            this.fiscalPeriodWindow.Show();
        }
Esempio n. 8
0
        public void OpenDayConfig(string day)
        {
            scId.Clear();
            dayTypeId.Clear();

            dayId.Text = CurrentYear.Text + day;

            CalendarDayRecordRequest request = new CalendarDayRecordRequest();

            request.CaId  = CurrentCalendar.Text;
            request.DayId = dayId.Text;
            request.year  = CurrentYear.Text;
            RecordResponse <Model.Attendance.CalendarDay> dayObj = _branchService.ChildGetRecord <Model.Attendance.CalendarDay>(request);

            dayConfigWindow.Show();
            schedulesStore.DataSource = LoadSchedules();
            schedulesStore.DataBind();
            dayTypesStore.DataSource = LoadDayTypes();
            dayTypesStore.DataBind();

            if (dayObj.result != null)
            {
                scId.Select(dayObj.result.scId.ToString());
                dayTypeId.Select(dayObj.result.dayTypeId.ToString());
            }
        }
Esempio n. 9
0
        protected void FillDates(object sender, DirectEventArgs e)
        {
            try
            {
                string payId = e.ExtraParams["payId"];
                if (string.IsNullOrEmpty(payId))
                {
                    return;
                }

                MonthlyLatenessPeriodListRequest rr = new MonthlyLatenessPeriodListRequest();
                rr.PayID = payId;
                RecordResponse <MonthlyLatenessPeriod> response = _timeAttendanceService.ChildGetRecord <MonthlyLatenessPeriod>(rr);
                if (!response.Success)
                {
                    X.MessageBox.ButtonText.Ok = Resources.Common.Ok;
                    Common.errorMessage(response);
                    return;
                }

                //colStartDate.Text = response.Items[0].startDate;
                //colEndDate.Text = response.Items[0].endDate;

                ColStartDate.Text = response.result.startDate.ToString("dd/MM/yyyy");
                ColEndDate.Text   = response.result.endDate.ToString("dd/MM/yyyy");
            }
            catch (Exception exp)
            {
                X.MessageBox.Alert(GetGlobalResourceObject("Common", "Error").ToString(), exp.Message);
            }
        }
Esempio n. 10
0
        public void RejectRecord(string index)
        {
            try
            {
                //Step 1 Code to delete the object from the database
                RecordRequest req = new RecordRequest();
                req.RecordID = index;


                RecordResponse <DashBoardTimeVariation> r = _timeAttendanceService.ChildGetRecord <DashBoardTimeVariation>(req);                    //Step 1 Selecting the object or building up the object for update purpose

                if (!r.Success)
                {
                    Common.errorMessage(r);
                    return;
                }
                else
                {
                    RejectTimeVariationc rejectObject = new RejectTimeVariationc();
                    rejectObject.clockDuration = r.result.clockDuration;
                    rejectObject.damageLevel   = r.result.damageLevel;
                    rejectObject.date          = r.result.date;
                    rejectObject.dayId         = r.result.dayId;
                    rejectObject.dtFrom        = r.result.dtFrom;
                    rejectObject.dtTo          = r.result.dtTo;
                    rejectObject.duration      = r.result.duration;
                    rejectObject.employeeId    = r.result.employeeId;
                    rejectObject.recordId      = r.result.recordId;
                    rejectObject.shiftId       = r.result.shiftId;
                    rejectObject.timeCode      = r.result.timeCode;
                    rejectObject.justification = r.result.justification;
                    rejectObject.apId          = r.result.apId;



                    PostRequest <RejectTimeVariationc> rejReq = new PostRequest <RejectTimeVariationc>();
                    rejReq.entity = rejectObject;


                    rejReq.entity.apStatus = -1;
                    PostResponse <RejectTimeVariationc> rejResp = _timeAttendanceService.ChildAddOrUpdate <RejectTimeVariationc>(rejReq);

                    Notification.Show(new NotificationConfig
                    {
                        Title = Resources.Common.Notification,
                        Icon  = Icon.Information,
                        Html  = Resources.Common.RecordUpdatedSucc
                    });
                }
                Store1.Reload();
            }
            catch (Exception ex)
            {
                //In case of error, showing a message box to the user
                X.MessageBox.ButtonText.Ok = Resources.Common.Ok;
                X.Msg.Alert(Resources.Common.Error, Resources.Common.ErrorDeletingRecord).Show();
            }
        }
Esempio n. 11
0
        protected void PoPuP(object sender, DirectEventArgs e)
        {
            int    id   = Convert.ToInt32(e.ExtraParams["id"]);
            string type = e.ExtraParams["type"];

            switch (type)
            {
            case "ColName":
                //Step 1 : get the object from the Web Service
                panelRecordDetails.ActiveIndex = 0;
                RecordRequest r = new RecordRequest();
                r.RecordID = id.ToString();
                RecordResponse <VacationSchedule> response = _branchService.ChildGetRecord <VacationSchedule>(r);
                if (!response.Success)
                {
                    X.MessageBox.ButtonText.Ok = Resources.Common.Ok;
                    X.Msg.Alert(Resources.Common.Error, response.Summary).Show();
                    return;
                }
                //Step 2 : call setvalues with the retrieved object
                this.BasicInfoTab.SetValues(response.result);

                VacationPeriodsListRequest req = new VacationPeriodsListRequest();
                req.VacationScheduleId = r.RecordID;
                ListResponse <VacationSchedulePeriod> periods = _branchService.ChildGetAll <VacationSchedulePeriod>(req);
                periodsGrid.Store[0].DataSource = periods.Items;
                periodsGrid.Store[0].DataBind();
                periodsGrid.DataBind();
                // InitCombos(response.result);
                this.EditRecordWindow.Title = Resources.Common.EditWindowsTitle;
                this.EditRecordWindow.Show();
                break;

            case "colDelete":
                X.Msg.Confirm(Resources.Common.Confirmation, Resources.Common.DeleteOneRecord, new MessageBoxButtonsConfig
                {
                    Yes = new MessageBoxButtonConfig
                    {
                        //We are call a direct request metho for deleting a record
                        Handler = String.Format("App.direct.DeleteRecord({0})", id),
                        Text    = Resources.Common.Yes
                    },
                    No = new MessageBoxButtonConfig
                    {
                        Text = Resources.Common.No
                    }
                }).Show();
                break;

            case "colAttach":

                //Here will show up a winow relatice to attachement depending on the case we are working on
                break;

            default:
                break;
            }
        }
Esempio n. 12
0
        private DayType GetDayType(string id)
        {
            RecordRequest req = new RecordRequest();

            req.RecordID = id;
            RecordResponse <DayType> day = _branchService.ChildGetRecord <DayType>(req);

            return(day.result);
        }
Esempio n. 13
0
        protected void PoPuP(object sender, DirectEventArgs e)
        {
            panelRecordDetails.ActiveIndex = 0;
            conditionsGrid.Disabled        = false;
            messagesGrid.Disabled          = false;
            string id   = e.ExtraParams["id"];
            string type = e.ExtraParams["type"];

            switch (type)
            {
            case "imgEdit":
                //Step 1 : get the object from the Web Service
                RecordRequest r = new RecordRequest();
                r.RecordID = id;

                RecordResponse <Model.Company.Structure.Rule> response = _companyStructureService.ChildGetRecord <Model.Company.Structure.Rule>(r);
                if (!response.Success)
                {
                    X.MessageBox.ButtonText.Ok = Resources.Common.Ok;
                    Common.errorMessage(response);
                    return;
                }
                //Step 2 : call setvalues with the retrieved object
                this.BasicInfoTab.SetValues(response.result);
                expressionCombo1.setExpression(response.result.expressionId);
                currentRuId.Text = id;
                FillConditionStore();
                FillMessageStore();
                this.EditRecordWindow.Title = Resources.Common.EditWindowsTitle;
                this.EditRecordWindow.Show();
                break;

            case "imgDelete":
                X.Msg.Confirm(Resources.Common.Confirmation, Resources.Common.DeleteOneRecord, new MessageBoxButtonsConfig
                {
                    Yes = new MessageBoxButtonConfig
                    {
                        //We are call a direct request metho for deleting a record
                        Handler = String.Format("App.direct.DeleteRecord({0})", id),
                        Text    = Resources.Common.Yes
                    },
                    No = new MessageBoxButtonConfig
                    {
                        Text = Resources.Common.No
                    }
                }).Show();
                break;

            case "imgAttach":

                //Here will show up a winow relatice to attachement depending on the case we are working on
                break;

            default:
                break;
            }
        }
Esempio n. 14
0
        private bool HandleExternalUrl()
        {
            string decrypted = EncryptionHelper.decrypt(Request.QueryString["param"], null);
            var    parsed    = HttpUtility.ParseQueryString(decrypted);

            if (string.IsNullOrEmpty(parsed["_a"]) || string.IsNullOrEmpty(parsed["_e"]) || string.IsNullOrEmpty(parsed["_p"]) || string.IsNullOrEmpty(parsed["_c"]))
            {
                return(false);
            }


            UrlKeyRequest reqkey = new UrlKeyRequest();

            reqkey.keyId = Server.UrlEncode(Request.QueryString["param"]);
            _systemService.SessionHelper.Set("AccountId", parsed["_a"]);



            AuthenticateRequest req = new AuthenticateRequest();

            req.UserName = parsed["_e"];
            req.Password = parsed["_p"];
            _systemService.SessionHelper.Set("AccountId", parsed["_a"]);
            AuthenticateResponse resp = _systemService.Authenticate(req);

            if (!resp.Success)
            {
                return(false);
            }
            if (resp.User.languageId == 2)
            {
                _systemService.SessionHelper.SetLanguage("ar");
            }
            else
            {
                _systemService.SessionHelper.SetLanguage("en");
            }
            RecordResponse <KeyId> keyresp = _systemService.ChildGetRecord <KeyId>(reqkey);

            if (!keyresp.Success)
            {
                return(false);
            }
            _systemService.SessionHelper.Set("CompanyName", " ");

            _systemService.SessionHelper.SetUserType(resp.User.userType);
            _systemService.SessionHelper.SetEmployeeId(resp.User.employeeId);
            _systemService.SessionHelper.Set("CurrentUserName", parsed["_e"]);

            _systemService.SessionHelper.Set("IsAdmin", resp.User.isAdmin);
            StoreSystemDefaults();
            string url = PageLookup.GetPageUrlByClassId(Convert.ToInt32(parsed["_c"])) + "?" + parsed["_k"].Replace('#', '&');

            X.Call("openNewTab", parsed["_c"], url, GetGlobalResourceObject("Classes", "Class" + parsed["_c"]), "icon-Employees");
            //Response.Redirect("Default.aspx");
            return(true);
        }
Esempio n. 15
0
        protected void PoPuPReceiver(object sender, DirectEventArgs e)
        {
            string taskIdParamter = e.ExtraParams["taskId"];
            int    seqNoParameter = Convert.ToInt32(e.ExtraParams["seqNo"]);
            string type           = e.ExtraParams["type"];

            switch (type)
            {
            case "imgEdit":
                //Step 1 : get the object from the Web Service
                TaskReceiverListRequest r = new TaskReceiverListRequest();
                r.taskId = taskIdParamter;
                r.seqNo  = seqNoParameter.ToString();


                RecordResponse <Receiver> response = _taskScheduleService.ChildGetRecord <Receiver>(r);
                if (!response.Success)
                {
                    X.MessageBox.ButtonText.Ok = Resources.Common.Ok;
                    Common.errorMessage(response);
                    return;
                }
                //Step 2 : call setvalues with the retrieved object
                this.receiversForm.SetValues(response.result);
                sgId.SetValue(response.result.sgId);
                receiverType.SetValue(response.result.receiverType);


                this.receiversWindow.Title = Resources.Common.EditWindowsTitle;
                this.receiversWindow.Show();
                break;

            case "imgDelete":
                X.Msg.Confirm(Resources.Common.Confirmation, Resources.Common.DeleteOneRecord, new MessageBoxButtonsConfig
                {
                    Yes = new MessageBoxButtonConfig
                    {
                        //We are call a direct request metho for deleting a record
                        Handler = String.Format("App.direct.DeleteReceiverRecord({0},{1})", taskIdParamter, seqNoParameter),
                        Text    = Resources.Common.Yes
                    },
                    No = new MessageBoxButtonConfig
                    {
                        Text = Resources.Common.No
                    }
                }).Show();
                break;

            case "imgAttach":

                //Here will show up a winow relatice to attachement depending on the case we are working on
                break;

            default:
                break;
            }
        }
Esempio n. 16
0
        protected void PoPuP(object sender, DirectEventArgs e)
        {
            string id   = e.ExtraParams["id"];
            string type = e.ExtraParams["type"];

            CurrentFunctionId.Text = id;

            switch (type)
            {
            case "imgEdit":
                //Step 1 : get the object from the Web Service
                RecordRequest r = new RecordRequest();
                r.RecordID = id;

                RecordResponse <PayrollFunction> response = _payrollService.ChildGetRecord <PayrollFunction>(r);
                if (!response.Success)
                {
                    X.MessageBox.ButtonText.Ok = Resources.Common.Ok;
                    Common.errorMessage(response);
                    return;
                }
                //Step 2 : call setvalues with the retrieved object
                this.BasicInfoTab.SetValues(response.result);

                FillFUNConstStore(e.ExtraParams["id"]);

                FunConstGridPanel.Enable();

                this.EditRecordWindow.Title = Resources.Common.EditWindowsTitle;
                this.EditRecordWindow.Show();
                break;

            case "imgDelete":
                X.Msg.Confirm(Resources.Common.Confirmation, Resources.Common.DeleteOneRecord, new MessageBoxButtonsConfig
                {
                    Yes = new MessageBoxButtonConfig
                    {
                        //We are call a direct request metho for deleting a record
                        Handler = String.Format("App.direct.DeleteRecord({0})", id),
                        Text    = Resources.Common.Yes
                    },
                    No = new MessageBoxButtonConfig
                    {
                        Text = Resources.Common.No
                    }
                }).Show();
                break;

            case "imgAttach":

                //Here will show up a winow relatice to attachement depending on the case we are working on
                break;

            default:
                break;
            }
        }
Esempio n. 17
0
        protected void PoPuPBC(object sender, DirectEventArgs e)
        {
            int    id   = Convert.ToInt32(e.ExtraParams["id"]);
            string type = e.ExtraParams["type"];
            string path = e.ExtraParams["path"];

            switch (type)
            {
            case "imgEdit":
                RecordRequest r2 = new RecordRequest();
                r2.RecordID = id.ToString();
                RecordResponse <EmployeeBackgroundCheck> response2 = _employeeService.ChildGetRecord <EmployeeBackgroundCheck>(r2);
                if (!response2.Success)
                {
                    X.MessageBox.ButtonText.Ok = Resources.Common.Ok;
                    X.Msg.Alert(Resources.Common.Error, response2.Summary).Show();
                    return;
                }
                //Step 2 : call setvalues with the retrieved object
                this.EditBCTab.SetValues(response2.result);
                FillBCCheckType();
                ctId.Select(response2.result.ctId.ToString());
                this.EditBCWindow.Title = Resources.Common.EditWindowsTitle;
                this.EditBCWindow.Show();
                break;

            case "imgDelete":
                X.Msg.Confirm(Resources.Common.Confirmation, Resources.Common.DeleteOneRecord, new MessageBoxButtonsConfig
                {
                    Yes = new MessageBoxButtonConfig
                    {
                        //We are call a direct request metho for deleting a record
                        Handler = String.Format("App.direct.DeleteBC({0},'{1}')", id, path),
                        Text    = Resources.Common.Yes
                    },
                    No = new MessageBoxButtonConfig
                    {
                        Text = Resources.Common.No
                    }
                }).Show();
                break;

            case "imgAttach":
                DownloadFile(path);
                break;

            case "imgDeleteAttach":
                DeleteFile(path, id);
                BCStore.Reload();
                //Here will show up a winow relatice to attachement depending on the case we are working on
                break;

            default:
                break;
            }
        }
Esempio n. 18
0
        protected void PoPuP(object sender, DirectEventArgs e)
        {
            int    id   = Convert.ToInt32(e.ExtraParams["id"]);
            string type = e.ExtraParams["type"];

            switch (type)
            {
            case "ColName":
                //Step 1 : get the object from the Web Service
                RecordRequest r = new RecordRequest();
                r.RecordID = id.ToString();
                RecordResponse <Employee> response = _employeeService.Get <Employee>(r);
                BasicInfoTab.Reset();
                picturePath.Clear();
                if (!response.Success)
                {
                    X.MessageBox.ButtonText.Ok = Resources.Common.Ok;
                    X.Msg.Alert(Resources.Common.Error, response.Summary).Show();
                    return;
                }
                //Step 2 : call setvalues with the retrieved object
                this.BasicInfoTab.SetValues(response.result);
                FillNameFields(response.result.name);
                InitCombos();
                SelectCombos(response.result);

                //timeZoneCombo.Select(response.result.timeZone.ToString());
                this.EditRecordWindow.Title = Resources.Common.EditWindowsTitle;
                this.EditRecordWindow.Show();
                break;

            case "colDelete":
                X.Msg.Confirm(Resources.Common.Confirmation, Resources.Common.DeleteOneRecord, new MessageBoxButtonsConfig
                {
                    Yes = new MessageBoxButtonConfig
                    {
                        //We are call a direct request metho for deleting a record
                        Handler = String.Format("App.direct.DeleteRecord({0})", id),
                        Text    = Resources.Common.Yes
                    },
                    No = new MessageBoxButtonConfig
                    {
                        Text = Resources.Common.No
                    }
                }).Show();
                break;

            case "colAttach":

                //Here will show up a winow relatice to attachement depending on the case we are working on
                break;

            default:
                break;
            }
        }
Esempio n. 19
0
        protected void PoPuPReports(object sender, DirectEventArgs e)
        {
            string id       = e.ExtraParams["id"];
            string reportId = e.ExtraParams["reportId"];
            string type     = e.ExtraParams["type"];

            switch (type)
            {
            case "imgEdit":
                //Step 1 : get the object from the Web Service
                TaskReportListRequest r = new TaskReportListRequest();
                r.reportId = reportId;
                r.taskId   = id;

                RecordResponse <Report> response = _taskScheduleService.ChildGetRecord <Report>(r);
                if (!response.Success)
                {
                    X.MessageBox.ButtonText.Ok = Resources.Common.Ok;
                    Common.errorMessage(response);
                    return;
                }
                //Step 2 : call setvalues with the retrieved object

                this.reportsForm.SetValues(response.result);
                classId.SetValue(response.result.reportId);
                classId.Disabled = true;

                this.reportsWindow.Title = Resources.Common.EditWindowsTitle;
                this.reportsWindow.Show();
                break;

            case "imgDelete":
                X.Msg.Confirm(Resources.Common.Confirmation, Resources.Common.DeleteOneRecord, new MessageBoxButtonsConfig
                {
                    Yes = new MessageBoxButtonConfig
                    {
                        //We are call a direct request metho for deleting a record
                        Handler = String.Format("App.direct.DeleteReportRecord({0},{1})", id, reportId),
                        Text    = Resources.Common.Yes
                    },
                    No = new MessageBoxButtonConfig
                    {
                        Text = Resources.Common.No
                    }
                }).Show();
                break;

            case "imgAttach":

                //Here will show up a winow relatice to attachement depending on the case we are working on
                break;

            default:
                break;
            }
        }
Esempio n. 20
0
        protected void PoPuP(object sender, DirectEventArgs e)
        {
            PropertiesGrid.Disabled = false;
            int    id   = Convert.ToInt32(e.ExtraParams["id"]);
            string type = e.ExtraParams["type"];

            currentCategory.Text = id.ToString();
            PropertiesStore.Reload();
            panelRecordDetails.ActiveIndex = 0;
            switch (type)
            {
            case "imgEdit":
                //Step 1 : get the object from the Web Service
                RecordRequest r = new RecordRequest();
                r.RecordID = id.ToString();
                RecordResponse <AssetManagementCategory> response = _assetManagementService.ChildGetRecord <AssetManagementCategory>(r);
                if (!response.Success)
                {
                    X.MessageBox.ButtonText.Ok = Resources.Common.Ok;
                    Common.errorMessage(response);
                    return;
                }
                //Step 2 : call setvalues with the retrieved object
                FillParent();
                //ApprovalStore.Reload();
                this.BasicInfoTab.SetValues(response.result);

                this.EditRecordWindow.Title = Resources.Common.EditWindowsTitle;
                this.EditRecordWindow.Show();
                break;

            case "imgDelete":
                X.Msg.Confirm(Resources.Common.Confirmation, Resources.Common.DeleteOneRecord, new MessageBoxButtonsConfig
                {
                    Yes = new MessageBoxButtonConfig
                    {
                        //We are call a direct request metho for deleting a record
                        Handler = String.Format("App.direct.DeleteRecord({0})", id),
                        Text    = Resources.Common.Yes
                    },
                    No = new MessageBoxButtonConfig
                    {
                        Text = Resources.Common.No
                    }
                }).Show();
                break;

            case "imgAttach":

                //Here will show up a winow relatice to attachement depending on the case we are working on
                break;

            default:
                break;
            }
        }
Esempio n. 21
0
        protected void PoPuP(object sender, DirectEventArgs e)
        {
            string id   = e.ExtraParams["id"];
            string type = e.ExtraParams["type"];

            X.Call("clearMap");
            switch (type)
            {
            case "imgEdit":
                //Step 1 : get the object from the Web Service
                RecordRequest r = new RecordRequest();
                r.RecordID = id;
                FillBranch();

                RecordResponse <Geofence> response = _timeAttendanceService.ChildGetRecord <Geofence>(r);
                if (!response.Success)
                {
                    X.MessageBox.ButtonText.Ok = Resources.Common.Ok;
                    Common.errorMessage(response);
                    return;
                }
                FillGeofenceOnMap(response.result);
                //Step 2 : call setvalues with the retrieved object
                this.BasicInfoTab.SetValues(response.result);
                //recordId.Text = id;

                branchId.Select(response.result.branchId.ToString());
                this.EditRecordWindow.Title = Resources.Common.EditWindowsTitle;
                this.EditRecordWindow.Show();
                break;

            case "imgDelete":
                X.Msg.Confirm(Resources.Common.Confirmation, Resources.Common.DeleteOneRecord, new MessageBoxButtonsConfig
                {
                    Yes = new MessageBoxButtonConfig
                    {
                        //We are call a direct request metho for deleting a record
                        Handler = String.Format("App.direct.DeleteRecord('{0}')", id),
                        Text    = Resources.Common.Yes
                    },
                    No = new MessageBoxButtonConfig
                    {
                        Text = Resources.Common.No
                    }
                }).Show();
                break;

            case "colAttach":

                //Here will show up a winow relatice to attachement depending on the case we are working on
                break;

            default:
                break;
            }
        }
Esempio n. 22
0
        protected void PoPuPSocialSetup(object sender, DirectEventArgs e)
        {
            string ssId  = e.ExtraParams["id"];
            string seqNo = e.ExtraParams["seqNo"];

            string type = e.ExtraParams["type"];

            switch (type)
            {
            case "imgEdit":
                //Step 1 : get the object from the Web Service
                SocialSecurityScheduleSetupRequest r = new SocialSecurityScheduleSetupRequest();
                r.ssId  = Convert.ToInt32(ssId);
                r.seqNo = Convert.ToInt32(seqNo);

                RecordResponse <SocialSecurityScheduleSetup> response = _PayrollService.ChildGetRecord <SocialSecurityScheduleSetup>(r);
                if (!response.Success)
                {
                    X.MessageBox.ButtonText.Ok = Resources.Common.Ok;
                    Common.errorMessage(response);
                    return;
                }
                //Step 2 : call setvalues with the retrieved object
                this.socialSetupForm.SetValues(response.result);

                //  recordId.Text = ssId;
                this.socialSetupForm.Title = Resources.Common.EditWindowsTitle;

                this.EditSocialSecuritySetupWindow.Show();
                break;

            case "imgDelete":
                X.Msg.Confirm(Resources.Common.Confirmation, Resources.Common.DeleteOneRecord, new MessageBoxButtonsConfig
                {
                    Yes = new MessageBoxButtonConfig
                    {
                        //We are call a direct request metho for deleting a record
                        Handler = String.Format("App.direct.DeleteSocialRecord({0},{1})", ssId, seqNo),
                        Text    = Resources.Common.Yes
                    },
                    No = new MessageBoxButtonConfig
                    {
                        Text = Resources.Common.No
                    }
                }).Show();
                break;

            case "imgAttach":

                //Here will show up a winow relatice to attachement depending on the case we are working on
                break;

            default:
                break;
            }
        }
Esempio n. 23
0
        protected void PoPuP(object sender, DirectEventArgs e)
        {
            paycode.ReadOnly = true;
            string payCode = e.ExtraParams["payCode"];
            string name    = e.ExtraParams["name"];
            string type    = e.ExtraParams["type"];

            switch (type)
            {
            case "imgEdit":
                //Step 1 : get the object from the Web Service
                PayCodeRecordRequest r = new PayCodeRecordRequest();
                r.payCode = payCode;

                RecordResponse <PayCode> response = _payrollService.ChildGetRecord <PayCode>(r);
                if (!response.Success)
                {
                    X.MessageBox.ButtonText.Ok = Resources.Common.Ok;
                    Common.errorMessage(response);
                    return;
                }
                //Step 2 : call setvalues with the retrieved object
                this.BasicInfoTab.SetValues(response.result);


                this.EditRecordWindow.Title = Resources.Common.EditWindowsTitle;
                this.EditRecordWindow.Show();
                break;

            case "imgDelete":
                X.Msg.Confirm(Resources.Common.Confirmation, Resources.Common.DeleteOneRecord, new MessageBoxButtonsConfig
                {
                    Yes = new MessageBoxButtonConfig
                    {
                        //We are call a direct request metho for deleting a record
                        Handler = String.Format("App.direct.DeleteRecord('{0}','{1}')", payCode, name),
                        Text    = Resources.Common.Yes
                    },
                    No = new MessageBoxButtonConfig
                    {
                        Text = Resources.Common.No
                    }
                }).Show();
                break;

            case "imgAttach":

                //Here will show up a winow relatice to attachement depending on the case we are working on
                break;

            default:
                break;
            }
        }
Esempio n. 24
0
        protected void PoPuPMessage(object sender, DirectEventArgs e)
        {
            string languageIdParamter = e.ExtraParams["languageId"];
            string type = e.ExtraParams["type"];

            switch (type)
            {
            case "imgEdit":
                //Step 1 : get the object from the Web Service
                RuleMessageRecordRequest r = new RuleMessageRecordRequest();
                r.ruleId     = currentRuId.Text;
                r.languageId = languageIdParamter;

                RecordResponse <Model.Company.Structure.RuleMessage> response = _companyStructureService.ChildGetRecord <Model.Company.Structure.RuleMessage>(r);
                if (!response.Success)
                {
                    X.MessageBox.ButtonText.Ok = Resources.Common.Ok;
                    Common.errorMessage(response);
                    return;
                }
                //Step 2 : call setvalues with the retrieved object
                this.messageForm.SetValues(response.result);


                this.messageWindow.Title = Resources.Common.EditWindowsTitle;
                this.messageWindow.Show();
                break;

            case "imgDelete":
                X.Msg.Confirm(Resources.Common.Confirmation, Resources.Common.DeleteOneRecord, new MessageBoxButtonsConfig
                {
                    Yes = new MessageBoxButtonConfig
                    {
                        //We are call a direct request metho for deleting a record
                        Handler = String.Format("App.direct.DeleteMessageRecord({0})", languageIdParamter),
                        Text    = Resources.Common.Yes
                    },
                    No = new MessageBoxButtonConfig
                    {
                        Text = Resources.Common.No
                    }
                }).Show();
                break;

            case "imgAttach":

                //Here will show up a winow relatice to attachement depending on the case we are working on
                break;

            default:
                break;
            }
        }
Esempio n. 25
0
        private object GetDateFormat()
        {
            SystemDefaultRecordRequest req = new SystemDefaultRecordRequest();

            req.Key = "dateFormat";
            RecordResponse <KeyValuePair <string, string> > response = _systemService.ChildGetRecord <KeyValuePair <string, string> >(req);

            if (!response.Success)
            {
            }
            return(response.result.Value);
        }
Esempio n. 26
0
        protected void PoPuP(object sender, DirectEventArgs e)
        {
            string id   = e.ExtraParams["id"];
            string type = e.ExtraParams["type"];

            switch (type)
            {
            case "ColName":
                //Step 1 : get the object from the Web Service
                RecordRequest r = new RecordRequest();
                r.RecordID = id;

                RecordResponse <CertificateLevel> response = _employeeService.ChildGetRecord <CertificateLevel>(r);
                if (!response.Success)
                {
                    X.MessageBox.ButtonText.Ok = Resources.Common.Ok;
                    X.Msg.Alert(Resources.Common.Error, response.Summary).Show();
                    return;
                }
                //Step 2 : call setvalues with the retrieved object
                this.BasicInfoTab.SetValues(response.result);


                this.EditRecordWindow.Title = Resources.Common.EditWindowsTitle;
                this.EditRecordWindow.Show();
                break;

            case "colDelete":
                X.Msg.Confirm(Resources.Common.Confirmation, Resources.Common.DeleteOneRecord, new MessageBoxButtonsConfig
                {
                    Yes = new MessageBoxButtonConfig
                    {
                        //We are call a direct request metho for deleting a record
                        Handler = String.Format("App.direct.DeleteRecord({0})", id),
                        Text    = Resources.Common.Yes
                    },
                    No = new MessageBoxButtonConfig
                    {
                        Text = Resources.Common.No
                    }
                }).Show();
                break;

            case "colAttach":

                //Here will show up a winow relatice to attachement depending on the case we are working on
                break;

            default:
                break;
            }
        }
Esempio n. 27
0
        protected void PoPuPCP(object sender, DirectEventArgs e)
        {
            string propertyId = e.ExtraParams["propertyId"];
            string type       = e.ExtraParams["type"];

            switch (type)
            {
            case "imgEdit":
                //Step 1 : get the object from the Web Service
                AssetManagementCategoryPropertyRecordRequest r = new AssetManagementCategoryPropertyRecordRequest();
                r.categoryId = currentCategory.Text;
                r.propertyId = propertyId;
                RecordResponse <AssetManagementCategoryProperty> response = _assetManagementService.ChildGetRecord <AssetManagementCategoryProperty>(r);
                if (!response.Success)
                {
                    X.MessageBox.ButtonText.Ok = Resources.Common.Ok;
                    Common.errorMessage(response);
                    return;
                }
                //Step 2 : call setvalues with the retrieved object

                this.PropertiesForm.SetValues(response.result);

                this.EditPropertyWindow.Title = Resources.Common.EditWindowsTitle;
                this.EditPropertyWindow.Show();
                break;

            case "imgDelete":
                X.Msg.Confirm(Resources.Common.Confirmation, Resources.Common.DeleteOneRecord, new MessageBoxButtonsConfig
                {
                    Yes = new MessageBoxButtonConfig
                    {
                        //We are call a direct request metho for deleting a record
                        Handler = String.Format("App.direct.DeletePropertyRecord({0})", propertyId),
                        Text    = Resources.Common.Yes
                    },
                    No = new MessageBoxButtonConfig
                    {
                        Text = Resources.Common.No
                    }
                }).Show();
                break;

            case "imgAttach":

                //Here will show up a winow relatice to attachement depending on the case we are working on
                break;

            default:
                break;
            }
        }
Esempio n. 28
0
        public RecordResponse GetRecordsByDeviceID(string deviceID, int limit)
        {
            var data     = _obdDataRecordRepository.GetRecordByDeviceOriginalID(deviceID, limit);
            var pidCodes = data.Select(p => p.pid).Distinct().ToList();

            var            buf    = data.Select(p => { return(new ObdDataRecordViewModel(p.original_id, p.unix_timestamp, p.value, p.pid, p.system_timestamp)); });
            RecordResponse result = new RecordResponse();

            result.PidCodes = pidCodes;
            result.PidNames = data.Select(p => PidsDictionaryHolder.pids[p.pid]).Distinct().ToList();
            result.Pids     = buf.ToList();
            return(result);
        }
Esempio n. 29
0
        public override RecordResponse <T> Get <T>(RecordRequest request)
        {
            RecordResponse <T> f = base.Get <T>(request);

            if (f != null && f.result != null)
            {
                if (string.IsNullOrEmpty(((f.result) as Employee).pictureUrl))
                {
                    ((f.result) as Employee).pictureUrl = "images/empPhoto.jpg";
                }
            }
            return(f);
        }
Esempio n. 30
0
        private List <Employee> GetEmployeeByID(string id)
        {
            RecordRequest req = new RecordRequest();

            req.RecordID = id;



            List <Employee>           emps = new List <Employee>();
            RecordResponse <Employee> emp  = _employeeService.Get <Employee>(req);

            emps.Add(emp.result);
            return(emps);
        }