Beispiel #1
0
        protected void Store1_RefreshData(object sender, StoreReadDataEventArgs e)
        {
            //GEtting the filter from the page
            string filter     = string.Empty;
            int    totalCount = 1;



            //Fetching the corresponding list

            //in this test will take a list of News
            ListRequest request = new ListRequest();

            request.Filter = "";
            ListResponse <LeaveReturn> resp = _leaveManagementService.ChildGetAll <LeaveReturn>(request);

            if (!resp.Success)
            {
                Common.errorMessage(resp);
                return;
            }
            List <XMLDictionary> statusList = Common.XMLDictionaryList(_systemService, "13");

            resp.Items.ForEach(x => x.apStatus = statusList.Where(y => y.key.ToString() == x.apStatus).Count() != 0 ? statusList.Where(y => y.key.ToString() == x.apStatus).First().value : "");
            this.Store1.DataSource             = resp.Items;
            e.Total = resp.Items.Count;;

            this.Store1.DataBind();
        }
Beispiel #2
0
        private void FillApprovalsStore(string leaveId, string employeeId, string returnType)
        {
            ReportGenericRequest req = new ReportGenericRequest();

            req.paramString = "8|" + leaveId;



            ListResponse <Model.LeaveManagement.LeaveReturnApproval> response = _leaveManagementService.ChildGetAll <Model.LeaveManagement.LeaveReturnApproval>(req);

            if (!response.Success)
            {
                Common.errorMessage(response);
                return;
            }
            List <XMLDictionary> statusList = Common.XMLDictionaryList(_systemService, "13");

            response.Items.ForEach(x =>
            {
                x.stringStatus = statusList.Where(y => y.key == x.status).Count() != 0 ? statusList.Where(y => y.key == x.status).First().value : string.Empty;
            }
                                   );
            ApprovalsStore.DataSource = response.Items;
            ApprovalsStore.DataBind();
        }
Beispiel #3
0
        protected void Page_Load(object sender, EventArgs e)
        {
            if (!X.IsAjaxRequest && !IsPostBack)
            {
                SetExtLanguage();
                HideShowButtons();
                HideShowColumns();
                approvalTypeStore.DataSource = Common.XMLDictionaryList(_systemService, "24");
                FillWorkFlowStore();


                try
                {
                    AccessControlApplier.ApplyAccessControlOnPage(typeof(LeaveType), BasicInfoTab, GridPanel1, btnAdd, SaveButton);
                }
                catch (AccessDeniedException exp)
                {
                    X.MessageBox.ButtonText.Ok = Resources.Common.Ok;
                    X.Msg.Alert(Resources.Common.Error, Resources.Common.ErrorAccessDenied).Show();
                    Viewport1.Hidden = true;
                    return;
                }
                //   FillDepartment();
                apId.Text = "";
            }
        }
Beispiel #4
0
        protected void Page_Load(object sender, EventArgs e)
        {
            if (!X.IsAjaxRequest && !IsPostBack)
            {
                SetExtLanguage();
                HideShowButtons();
                HideShowColumns();


                activeStatusStore.DataSource = Common.XMLDictionaryList(_systemService, "16");
                activeStatusStore.DataBind();
                if (_systemService.SessionHelper.CheckIfIsAdmin())
                {
                    return;
                }
                try
                {
                    AccessControlApplier.ApplyAccessControlOnPage(typeof(BusinessPartner), BasicInfoTab, GridPanel1, btnAdd, SaveButton);
                }
                catch (AccessDeniedException exp)
                {
                    X.MessageBox.ButtonText.Ok = Resources.Common.Ok;
                    X.Msg.Alert(Resources.Common.Error, Resources.Common.ErrorAccessDenied).Show();
                    Viewport1.Hidden = true;
                    return;
                }
            }
        }
Beispiel #5
0
 protected void Page_Load(object sender, EventArgs e)
 {
     if (!X.IsAjaxRequest && !IsPostBack)
     {
         SetExtLanguage();
         HideShowButtons();
         HideShowColumns();
         actionTypeStore.DataSource = Common.XMLDictionaryList(_systemService, "31");
         actionTypeStore.DataBind();
         operStore.DataSource = Common.XMLDictionaryList(_systemService, "32");
         operStore.DataBind();
         languageStore.DataSource = Common.XMLDictionaryList(_systemService, "23");
         languageStore.DataBind();
         moduleStore.DataSource = Common.XMLDictionaryList(_systemService, "1");
         moduleStore.DataBind();
         try
         {
             AccessControlApplier.ApplyAccessControlOnPage(typeof(EntitlementDeduction), BasicInfoTab, GridPanel1, btnAdd, SaveButton);
         }
         catch (AccessDeniedException exp)
         {
             X.MessageBox.ButtonText.Ok = Resources.Common.Ok;
             X.Msg.Alert(Resources.Common.Error, Resources.Common.ErrorAccessDenied).Show();
             Viewport1.Hidden = true;
             return;
         }
     }
 }
Beispiel #6
0
        protected void Store1_RefreshData(object sender, StoreReadDataEventArgs e)
        {
            try
            {
                //GEtting the filter from the page

                string rep_params = vals.Text;
                //ReportGenericRequest req = new ReportGenericRequest();
                TVListRequest req = new TVListRequest();
                req.paramString = rep_params;
                req.size        = "5000";
                req.startAt     = "0";
                req.sortBy      = "date,employeeRef";

                ListResponse <DashBoardTimeVariation3> daysResponse = _timeAttendanceService.ChildGetAll <DashBoardTimeVariation3>(req);

                //ActiveAttendanceRequest r = GetActiveAttendanceRequest();

                //ListResponse<ActiveAbsence> daysResponse = _timeAttendanceService.ChildGetAll<ActiveAbsence>(r);
                if (!daysResponse.Success)
                {
                    Common.errorMessage(daysResponse);
                    return;
                }
                bool rtl = _systemService.SessionHelper.CheckIfArabicSession();
                List <XMLDictionary> timeCode   = ConstTimeVariationType.TimeCodeList(_systemService);
                List <XMLDictionary> statusList = Common.XMLDictionaryList(_systemService, "13");
                List <XMLDictionary> damageList = Common.XMLDictionaryList(_systemService, "22");
                daysResponse.Items.ForEach(
                    x =>
                {
                    x.clockDurationString = time(x.clockDuration, true);
                    x.durationString      = time(x.duration, true);
                    x.timeCodeString      = timeCode.Where(y => y.key == Convert.ToInt16(x.timeCode)).Count() != 0 ? timeCode.Where(y => y.key == Convert.ToInt32(x.timeCode)).First().value : string.Empty;

                    x.apStatusString    = statusList.Where(y => y.key == x.apStatus).Count() != 0 ? statusList.Where(y => y.key == x.apStatus).First().value : "";
                    x.damageLevelString = damageList.Where(y => y.key == x.damageLevel).Count() != 0 ? damageList.Where(y => y.key == x.damageLevel).First().value : "";
                    if (rtl)
                    {
                        x.dayIdString = DateTime.ParseExact(x.dayId, "yyyyMMdd", new CultureInfo("en")).ToString("dddd  dd MMMM yyyy ", new System.Globalization.CultureInfo("ar-AE"));
                    }
                    else
                    {
                        x.dayIdString = DateTime.ParseExact(x.dayId, "yyyyMMdd", new CultureInfo("en")).ToString("dddd  dd MMMM yyyy ", new System.Globalization.CultureInfo("en-US"));
                    }
                }
                    );
                Store1.DataSource = daysResponse.Items;
                Store1.DataBind();
                e.Total     = daysResponse.count;
                format.Text = _systemService.SessionHelper.GetDateformat().ToUpper();
            }
            catch (Exception exp)
            {
                X.Msg.Alert(Resources.Common.Error, exp.Message).Show();
            }
        }
Beispiel #7
0
        private string FillApprovalStatus(short?apStatus)
        {
            string R = "";
            List <XMLDictionary> statusList = Common.XMLDictionaryList(_systemService, "13");

            if (apStatus != null)
            {
                R = statusList.Where(x => x.key == apStatus).Count() != 0 ? statusList.Where(x => x.key == apStatus).First().value : "";
            }
            return(R);
        }
Beispiel #8
0
        protected void PoPuP(object sender, DirectEventArgs e)
        {
            int    id   = Convert.ToInt32(e.ExtraParams["empId"]);
            string type = e.ExtraParams["type"];


            //ReportGenericRequest req = new ReportGenericRequest();
            //req.paramString = "1|"+ id + "^2|" + ColStartDate.Value.ToString().Substring(6,4) + ColStartDate.Value.ToString().Substring(3, 2) +
            //    ColStartDate.Value.ToString().Substring(0, 2) + "^3|" + ColEndDate.Value.ToString().Substring(6, 4) + ColEndDate.Value.ToString().Substring(3, 2) +
            //    ColEndDate.Value.ToString().Substring(0, 2) + "^4|35^5|2";

            MLDListRequest mlLR = new MLDListRequest();

            mlLR.PayId      = payId.SelectedItem.Value;
            mlLR.EmployeeId = id.ToString();

            ListResponse <DashBoardTimeVariation2> daysResponse = _timeAttendanceService.ChildGetAll <DashBoardTimeVariation2>(mlLR);

            if (!daysResponse.Success)
            {
                Common.errorMessage(daysResponse);
                return;
            }
            bool rtl = systemService.SessionHelper.CheckIfArabicSession();
            List <XMLDictionary> timeCode   = ConstTimeVariationType.TimeCodeList(systemService);
            List <XMLDictionary> statusList = Common.XMLDictionaryList(systemService, "13");
            List <XMLDictionary> damageList = Common.XMLDictionaryList(systemService, "22");

            daysResponse.Items.ForEach(
                x =>
            {
                x.clockDurationString = time(x.clockDuration, true);
                x.durationString      = time(x.duration, true);
                x.timeCodeString      = timeCode.Where(y => y.key == Convert.ToInt16(x.timeCode)).Count() != 0 ? timeCode.Where(y => y.key == Convert.ToInt32(x.timeCode)).First().value : string.Empty;

                x.apStatusString    = statusList.Where(y => y.key == x.apStatus).Count() != 0 ? statusList.Where(y => y.key == x.apStatus).First().value : "";
                x.damageLevelString = damageList.Where(y => y.key == x.damageLevel).Count() != 0 ? damageList.Where(y => y.key == x.damageLevel).First().value : "";
                if (rtl)
                {
                    x.dayIdString = DateTime.ParseExact(x.dayId, "yyyyMMdd", new CultureInfo("en")).ToString("dddd  dd MMMM yyyy ", new System.Globalization.CultureInfo("ar-AE"));
                }
                else
                {
                    x.dayIdString = DateTime.ParseExact(x.dayId, "yyyyMMdd", new CultureInfo("en")).ToString("dddd  dd MMMM yyyy ", new System.Globalization.CultureInfo("en-US"));
                }
            }
                );
            TimeVariationStore.DataSource = daysResponse.Items;
            TimeVariationStore.DataBind();
            //e.Total = daysResponse.count;
            //format.Text = systemService.SessionHelper.GetDateformat().ToUpper();
            this.EditRecordWindow.Show();
        }
Beispiel #9
0
 protected void fillMailEmployeeForm(object sender, DirectEventArgs e)
 {
     try
     {
         FillTemplateStore();
         langaugeStore.DataSource = Common.XMLDictionaryList(_systemService, "23");
         langaugeStore.DataBind();
     }
     catch (Exception exp)
     {
         X.Msg.Alert(Resources.Common.Error, exp.Message).Show();
     }
 }
Beispiel #10
0
        protected void userTypeStore_RefreshData(object sender, StoreReadDataEventArgs e)
        {
            //XMLDictionaryListRequest request = new XMLDictionaryListRequest();

            //request.database = "7";
            //ListResponse<XMLDictionary> resp = _systemService.ChildGetAll<XMLDictionary>(request);
            //if (!resp.Success)
            //{
            //    Common.errorMessage(resp);
            //    return;
            //}
            userTypeStore.DataSource = Common.XMLDictionaryList(_systemService, "7");
            userTypeStore.DataBind();
        }
Beispiel #11
0
        protected void Store1_RefreshData(object sender, StoreReadDataEventArgs e)
        {
            //GEtting the filter from the page
            string filter     = string.Empty;
            int    totalCount = 1;



            //Fetching the corresponding list

            //in this test will take a list of News
            ListRequest request = new ListRequest();

            request.Filter  = "";
            request.StartAt = e.Start.ToString();
            request.Size    = "30";
            var s = jobInfo1.GetJobInfo();
            UsersListRequest req = new UsersListRequest();

            req.Filter       = searchTrigger.Text;
            req.StartAt      = e.Start.ToString();
            req.Size         = "30";
            req.DepartmentId = s.DepartmentId.HasValue ? s.DepartmentId.Value.ToString() : "0";
            req.PositionId   = s.PositionId.HasValue ? s.PositionId.Value.ToString() : "0";
            req.BranchId     = s.BranchId.HasValue ? s.BranchId.Value.ToString() : "0";

            req.SortBy = "employeeId";
            ListResponse <UserInfo> branches = _systemService.ChildGetAll <UserInfo>(req);

            if (!branches.Success)
            {
                X.Msg.Alert(Resources.Common.Error, GetGlobalResourceObject("Errors", branches.ErrorCode) != null ? GetGlobalResourceObject("Errors", branches.ErrorCode).ToString() + "<br>" + GetGlobalResourceObject("Errors", "ErrorLogId") + branches.LogId : branches.Summary).Show();
                return;
            }
            List <XMLDictionary> userTypeList = Common.XMLDictionaryList(_systemService, "7");

            branches.Items.ForEach(x =>
            {
                x.userTypeString = userTypeList.Where(y => y.key == x.userType).Count() != 0 ? userTypeList.Where(y => y.key == x.userType).First().value : null;
            }
                                   );



            this.Store1.DataSource = branches.Items;
            e.Total = branches.count;

            this.Store1.DataBind();
        }
Beispiel #12
0
        /// <summary>
        /// Adding new record
        /// </summary>
        /// <param name="sender"></param>
        /// <param name="e"></param>
        protected void ADDNewRecord(object sender, DirectEventArgs e)
        {
            //Reset all values of the relative object
            BasicInfoTab.Reset();
            approvalFlowStore.DataSource = Common.XMLDictionaryList(_systemService, "29");
            approvalFlowStore.DataBind();

            this.EditRecordWindow.Title = Resources.Common.AddNewRecord;

            // ApprovelDepartmentsGrid.Disabled = true;
            panelRecordDetails.ActiveIndex = 0;
            apId.Text = "";

            this.EditRecordWindow.Show();
        }
Beispiel #13
0
        protected void Page_Load(object sender, EventArgs e)
        {
            if (!X.IsAjaxRequest && !IsPostBack)
            {
                SetExtLanguage();
                HideShowButtons();
                HideShowColumns();
                activityStore.DataSource = Common.XMLDictionaryList(_systemService, "42");
                activityStore.DataBind();

                startingDate.Value = DateTime.Now;

                //    startingDate.MinDate = DateTime.Now.AddDays(-180);

                //   endingDate.MinDate = startingDate.SelectedDate;
                endingDate.Value = DateTime.Now;
            }
        }
Beispiel #14
0
        protected void Page_Load(object sender, EventArgs e)
        {
            if (!X.IsAjaxRequest && !IsPostBack)
            {
                SetExtLanguage();
                HideShowButtons();
                languageIdStore.DataSource = Common.XMLDictionaryList(_systemService, "23");
                languageIdStore.DataBind();
                this.rtl.Text = _systemService.SessionHelper.CheckIfArabicSession() ? "True" : "False";
                try
                {
                    AccessControlApplier.ApplyAccessControlOnPage(typeof(UserInfo), BasicInfoTab, GridPanel1, btnAdd, SaveButton);
                }
                catch (AccessDeniedException exp)
                {
                    X.MessageBox.ButtonText.Ok = Resources.Common.Ok;
                    X.Msg.Alert(Resources.Common.Error, Resources.Common.ErrorAccessDenied).Show();
                    Viewport1.Hidden = true;
                    return;
                }
                try
                {
                    AccessControlApplier.ApplyAccessControlOnPage(typeof(SecurityGroupUser), null, groupsGrid, addToGroupButton, addToGroupButton);
                }
                catch (AccessDeniedException exp)
                {
                    X.MessageBox.ButtonText.Ok = Resources.Common.Ok;
                    X.Msg.Alert(Resources.Common.Error, Resources.Common.ErrorAccessDenied).Show();
                    Viewport1.Hidden = true;
                    return;
                }

                //userSelector.ButtonsText = new ItemSelectorButtonsText();
                //userSelector.ButtonsText.Add = GetLocalResourceObject("Add").ToString();
                //userSelector.ButtonsText.Remove = GetLocalResourceObject("Remove").ToString();
                //userSelector.Buttons = new ItemSelectorButton[2];
                //userSelector.Buttons[0] = ItemSelectorButton.Add;
                //userSelector.Buttons[1] = ItemSelectorButton.Remove;
            }
        }
Beispiel #15
0
        protected void Store1_RefreshData(object sender, StoreReadDataEventArgs e)
        {
            List <XMLDictionary> statusList = Common.XMLDictionaryList(_systemService, "13");

            //GEtting the filter from the page
            string filter     = string.Empty;
            int    totalCount = 1;



            //Fetching the corresponding list

            //in this test will take a list of News
            LeaveRequestListRequest request = GetFilteredRequest();

            request.Size    = "50";
            request.StartAt = e.Start.ToString();
            request.SortBy  = "recordId";
            request.Params  = vals.Text;

            //request.Filter = "";
            ListResponse <LeaveRequest> routers = _leaveManagementService.ChildGetAll <LeaveRequest>(request);

            if (!routers.Success)
            {
                Common.errorMessage(routers);
                return;
            }
            routers.Items.ForEach(x =>
            {
                x.statusString = statusList.Where(y => y.key == x.apStatus).Count() != 0 ? statusList.Where(y => y.key == x.apStatus).First().value : "";
            }

                                  );

            this.Store1.DataSource = routers.Items;
            e.Total = routers.count;

            this.Store1.DataBind();
        }
        /// <summary>
        /// Adding new record
        /// </summary>
        /// <param name="sender"></param>
        /// <param name="e"></param>


        protected void Store1_RefreshData(object sender, StoreReadDataEventArgs e)
        {
            List <XMLDictionary> statusList = Common.XMLDictionaryList(_systemService, "13");

            //GEtting the filter from the page
            string filter     = string.Empty;
            int    totalCount = 1;



            LeaveReplacementApprovalListRequest req = new LeaveReplacementApprovalListRequest();

            req.employeeId = _systemService.SessionHelper.GetEmployeeId();
            req.apStatus   = "0";
            req.StartAt    = e.Start.ToString();
            req.Size       = "50";
            req.SortBy     = "recordId";


            ListResponse <LeaveReplacementApproval> routers = _selfServiceService.ChildGetAll <LeaveReplacementApproval>(req);

            if (!routers.Success)
            {
                Common.errorMessage(routers);
                return;
            }
            routers.Items.ForEach(x =>
            {
                x.statusString = statusList.Where(y => y.key == Convert.ToInt16(x.replApStatus)).Count() != 0 ? statusList.Where(y => y.key == Convert.ToInt16(x.replApStatus)).First().value : "";
            }

                                  );

            this.Store1.DataSource = routers.Items;
            e.Total = routers.count;

            this.Store1.DataBind();
        }
Beispiel #17
0
 protected void Page_Load(object sender, EventArgs e)
 {
     if (!X.IsAjaxRequest && !IsPostBack)
     {
         SetExtLanguage();
         HideShowButtons();
         HideShowColumns();
         modulesCombo1.ADDHandler("change", "App.CurrentModule.setValue(this.value); App.classesStore.reload();");
         accessTypeStore.DataSource = Common.XMLDictionaryList(_systemService, "33");
         accessTypeStore.DataBind();
         try
         {
             AccessControlApplier.ApplyAccessControlOnPage(typeof(CertificateLevel), null, GridPanel1, btnAdd, SaveButton);
         }
         catch (AccessDeniedException exp)
         {
             X.MessageBox.ButtonText.Ok = Resources.Common.Ok;
             X.Msg.Alert(Resources.Common.Error, Resources.Common.ErrorAccessDenied).Show();
             Viewport1.Hidden = true;
             return;
         }
     }
 }
Beispiel #18
0
 protected void Page_Load(object sender, EventArgs e)
 {
     if (!X.IsAjaxRequest && !IsPostBack)
     {
         SetExtLanguage();
         HideShowButtons();
         HideShowColumns();
         try
         {
             AccessControlApplier.ApplyAccessControlOnPage(typeof(CertificateLevel), BasicInfoTab, GridPanel1, btnAdd, SaveButton);
         }
         catch (AccessDeniedException exp)
         {
             X.MessageBox.ButtonText.Ok = Resources.Common.Ok;
             X.Msg.Alert(Resources.Common.Error, Resources.Common.ErrorAccessDenied).Show();
             Viewport1.Hidden = true;
             return;
         }
         date.Format = ColDate.Format = _systemService.SessionHelper.GetDateformat();
         returnTypeStore.DataSource = Common.XMLDictionaryList(_systemService, "41");
         returnTypeStore.DataBind();
     }
 }
Beispiel #19
0
        protected void ApprovalsStore_ReadData(object sender, StoreReadDataEventArgs e)
        {
            //AssetManagementPurchaseOrderApprovalListRequest req = new AssetManagementPurchaseOrderApprovalListRequest();
            //req.poId = currentPurchaseOrderId.Text;

            //if (string.IsNullOrEmpty(req.poId))
            //{
            //    ApprovalStore.DataSource = new List<AssetManagementPurchaseOrderApproval>();
            //    ApprovalStore.DataBind();
            //}
            //req.approverId = 0;
            //req.BranchId = "0";
            //req.DepartmentId = "0";

            //req.Status = 0;
            //req.Filter = "";



            ReportGenericRequest req = new ReportGenericRequest();

            req.paramString = "8|" + currentPurchaseOrderId.Text;

            ListResponse <AssetManagementPurchaseOrderApproval> response = _assetManagementService.ChildGetAll <AssetManagementPurchaseOrderApproval>(req);

            if (!response.Success)
            {
                Common.errorMessage(response);
                return;
            }
            response.Items.ForEach(x =>
            {
                x.statusString = Common.XMLDictionaryList(_systemService, "13").Where(y => y.key == (x.status != null ? Convert.ToInt32(x.status) : 0)).Count() != 0 ? Common.XMLDictionaryList(_systemService, "13").Where(y => y.key == (x.status != null ? Convert.ToInt32(x.status) : 0)).First().value : "";
            });
            ApprovalStore.DataSource = response.Items;
            ApprovalStore.DataBind();
        }
 private void FillCondition()
 {
     conditionStore.DataSource = Common.XMLDictionaryList(_systemService, "10");
     condition.DataBind();
 }
 private void FillStatus()
 {
     statusStore.DataSource = Common.XMLDictionaryList(_systemService, "9");
     statusStore.DataBind();
 }
Beispiel #22
0
        //protected void FillTimeApproval(int dayId, int employeeId,string timeCode, string shiftId , string apstatus)
        //{
        //    try
        //    {
        //        //DashboardTimeListRequest r = new DashboardTimeListRequest();
        //        //r.fromDayId= dayId.ToString();
        //        //r.toDayId= dayId.ToString();
        //        //r.employeeId = employeeId;
        //        //r.approverId = 0;
        //        //r.timeCode = timeCode;
        //        //r.shiftId = shiftId;
        //        //// r.apStatus = apstatus.ToString();
        //        //r.apStatus = "0";
        //        //r.DepartmentId = "0";
        //        //r.DivisionId = "0";
        //        //r.BranchId = "0";
        //        //r.PositionId = "0";
        //        //r.EsId = "0";
        //        //r.StartAt = "0";
        //        //r.Size = "1000";
        //        //string rep_params = "";
        //        //Dictionary<string, string> parameters = new Dictionary<string, string>();
        //        //parameters.Add("1", employeeId.ToString());
        //        //parameters.Add("2", dayId.ToString());
        //        //parameters.Add("3", dayId.ToString());
        //        //if (!string.IsNullOrEmpty(shiftId))
        //        //parameters.Add("4", shiftId);
        //        //parameters.Add("5", timeCode);

        //        //foreach (KeyValuePair<string, string> entry in parameters)
        //        //{
        //        //    rep_params += entry.Key.ToString() + "|" + entry.Value + "^";
        //        //}
        //        //if (rep_params.Length > 0)
        //        //{
        //        //    if (rep_params[rep_params.Length - 1] == '^')
        //        //        rep_params = rep_params.Remove(rep_params.Length - 1);
        //        //}



        //        //ReportGenericRequest req = new ReportGenericRequest();
        //        //req.paramString = rep_params;



        //        //ListResponse<Time> Times = _timeAttendanceService.ChildGetAll<Time>(req);
        //        //if (!Times.Success)
        //        //{
        //        //    Common.errorMessage(Times);
        //        //    return;
        //        //}
        //        List<XMLDictionary> timeCodeList = ConstTimeVariationType.TimeCodeList(_systemService);
        //        //int currentTimeCode;
        //        //Times.Items.ForEach(x =>
        //        //{
        //        //    if (Int32.TryParse(x.timeCode, out currentTimeCode))
        //        //    {
        //        //        x.timeCodeString = timeCodeList.Where(y => y.key == Convert.ToInt32(x.timeCode)).Count() != 0 ? timeCodeList.Where(y => y.key == Convert.ToInt32(x.timeCode)).First().value : string.Empty;
        //        //    }

        //        //    x.statusString = FillApprovalStatus(x.status);
        //        //});

        //        TimeStore.DataSource = Times.Items;
        //        ////List<ActiveLeave> leaves = new List<ActiveLeave>();
        //        //leaves.Add(new ActiveLeave() { destination = "dc", employeeId = 8, employeeName = new Model.Employees.Profile.EmployeeName() { fullName = "vima" }, endDate = DateTime.Now.AddDays(10) });


        //        TimeStore.DataBind();
        //    }
        //    catch (Exception exp)
        //    {
        //        X.Msg.Alert(Resources.Common.Error, exp.Message).Show();
        //    }

        //}
        private void FillDamageStore()
        {
            damageStore.DataSource = Common.XMLDictionaryList(_systemService, "22");
            damageStore.DataBind();
        }
Beispiel #23
0
        protected void PoPuP(object sender, DirectEventArgs e)
        {
            try {
                BasicInfoTab.Reset();
                FillDamageStore();
                string id                 = e.ExtraParams["id"];
                int    dayId              = Convert.ToInt32(e.ExtraParams["dayId"]);
                int    employeeId         = Convert.ToInt32(e.ExtraParams["employeeId"]);
                string damageLavel        = e.ExtraParams["damage"];
                string durationValue      = e.ExtraParams["duration"];
                string timeCodeParameter  = e.ExtraParams["timeCode"];
                string shiftId            = e.ExtraParams["shiftId"];
                string apStatus           = e.ExtraParams["apStatus"];
                string type               = e.ExtraParams["type"];
                string justificationParam = e.ExtraParams["justification"];
                string clockDuration      = e.ExtraParams["clockDuration"];
                string arId               = e.ExtraParams["arId"];


                switch (type)
                {
                case "imgEdit":
                    //Step 1 : get the object from the Web Service

                    //Step 2 : call setvalues with the retrieved object

                    damage.Select(damageLavel);
                    duration.Text = durationValue;
                    clock.Text    = clockDuration;
                    // recordId.Text = id;
                    justification.Text = justificationParam;
                    TimeApprovalReasonControl.setApprovalReason(arId);
                    if (apStatus == "2" || apStatus == "-1")
                    {
                        disableEditing(false);
                    }
                    else
                    {
                        disableEditing(true);
                    }

                    recordId.Text = id;
                    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 "imgReject":
                    X.Msg.Confirm(Resources.Common.Confirmation, GetLocalResourceObject("RejectRecord").ToString(), new MessageBoxButtonsConfig
                    {
                        Yes = new MessageBoxButtonConfig
                        {
                            //We are call a direct request metho for deleting a record
                            Handler = String.Format("App.direct.RejectRecord({0})", id),
                            Text    = Resources.Common.Yes
                        },
                        No = new MessageBoxButtonConfig
                        {
                            Text = Resources.Common.No
                        }
                    }).Show();
                    break;

                case "imgAttach":
                    overrideForm.Reset();
                    RecordRequest req = new RecordRequest();
                    //req.employeeId = employeeId.ToString();
                    //req.dayId = dayId.ToString();
                    //req.shiftId = shiftId;
                    //req.timeCode = timeCodeParameter;
                    req.RecordID = id;
                    RecordResponse <DashBoardTimeVariation> resp = _timeAttendanceService.ChildGetRecord <DashBoardTimeVariation>(req);
                    if (!resp.Success)
                    {
                        Common.errorMessage(resp);
                        return;
                    }

                    ORId.Text = resp.result.recordId;
                    timeCodeStore.DataSource = ConstTimeVariationType.TimeCodeList(_systemService).Where(x => x.key == Convert.ToInt32(timeCodeParameter)).ToList();
                    timeCodeStore.DataBind();

                    FillBranch();
                    EmployeeQuickViewRecordRequest QVReq = new EmployeeQuickViewRecordRequest();
                    QVReq.RecordID = employeeId.ToString();

                    QVReq.asOfDate = DateTime.Now;
                    RecordResponse <EmployeeQuickView> qv = _employeeService.ChildGetRecord <EmployeeQuickView>(QVReq);

                    if (!qv.Success)
                    {
                        Common.errorMessage(qv);
                        return;
                    }
                    overrideForm.SetValues(resp.result);


                    branchId.Select(qv.result.branchId);

                    ListRequest UdIdReq = new ListRequest();

                    UdIdReq.Filter = "";
                    ListResponse <BiometricDevice> UdIdResp = _timeAttendanceService.ChildGetAll <BiometricDevice>(UdIdReq);
                    if (!UdIdResp.Success)
                    {
                        Common.errorMessage(UdIdResp);
                        return;
                    }
                    udIdStore.DataSource = UdIdResp.Items;
                    udIdStore.DataBind();
                    FlatPunchesListRequest FPreq = new FlatPunchesListRequest();
                    FPreq.shiftId = shiftId;
                    FPreq.sortBy  = "clockStamp";
                    FPreq.StartAt = "0";
                    FPreq.Size    = "30";
                    ListResponse <FlatPunch> FPresp = _timeAttendanceService.ChildGetAll <FlatPunch>(FPreq);

                    if (!FPresp.Success)
                    {
                        Common.errorMessage(FPresp);
                        return;
                    }

                    punchesList.Text = "";
                    FPresp.Items.ForEach(x =>
                    {
                        punchesList.Text += x.clockStamp.ToString(_systemService.SessionHelper.GetDateformat() + " HH:mm", CultureInfo.CurrentUICulture) + System.Environment.NewLine;
                    }


                                         );


                    inOutStore.DataSource = Common.XMLDictionaryList(_systemService, "34");
                    inOutStore.DataBind();
                    overrideWindow.Show();

                    break;

                case "LinkRender":
                    FillTimeApproval(id);
                    TimeApprovalWindow.Show();

                    break;

                case "imgHistory":

                    TimeVariationHistoryControl1.Show("41203", id);
                    break;

                default:
                    break;
                }
            }
            catch (Exception exp)
            {
                X.Msg.Alert(Resources.Common.Error, exp.Message).Show();
            }
        }
Beispiel #24
0
 private void FillProfileStore()
 {
     profileStore.DataSource = Common.XMLDictionaryList(_systemService, "11");
     profileStore.DataBind();
 }
Beispiel #25
0
        protected void PoPuP(object sender, DirectEventArgs e)
        {
            string id   = e.ExtraParams["id"];
            string type = e.ExtraParams["type"];

            apId.Text = id;
            panelRecordDetails.ActiveIndex = 0;
            approvalFlowStore.DataSource   = Common.XMLDictionaryList(_systemService, "29");
            approvalFlowStore.DataBind();

            //departmentId.Select("");
            //     ApprovelDepartmentsStore.Reload();

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

                RecordResponse <Approval> response = _companyStructureService.ChildGetRecord <Approval>(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;
                //ApprovelDepartmentsGrid.Disabled = false;
                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;
            }
        }
Beispiel #26
0
 private void FillapproverPositionStore()
 {
     approverPositionStore.DataSource = Common.XMLDictionaryList(_systemService, "28");
     approverPositionStore.DataBind();
 }
Beispiel #27
0
        protected void PoPuP(object sender, DirectEventArgs e)
        {
            try {
                string type         = e.ExtraParams["type"];
                string edTypeP      = e.ExtraParams["edType"];
                string timeCodeP    = e.ExtraParams["timeCode"];
                string edIdP        = e.ExtraParams["edId"];
                string apIdP        = e.ExtraParams["apId"];
                string gracePeriodP = e.ExtraParams["gracePeriod"];
                currentEDtype.Text = edTypeP;
                switch (type)
                {
                case "imgEdit":
                    //Step 1 : get the object from the Web Service

                    //Step 2 : call setvalues with the retrieved object

                    TimeCodeRecordRequest r = new TimeCodeRecordRequest();
                    r.timeCode = timeCodeP;
                    RecordResponse <TimeCode> response = _payrollService.ChildGetRecord <TimeCode>(r);
                    if (!response.Success)
                    {
                        X.MessageBox.ButtonText.Ok = Resources.Common.Ok;
                        Common.errorMessage(response);
                        return;
                    }
                    FillApprovalStory();
                    FillensStore();
                    timeCodeStore.DataSource = Common.XMLDictionaryList(_systemService, "3");
                    timeCodeStore.DataBind();
                    this.BasicInfoTab.Reset();
                    //Step 2 : call setvalues with the retrieved object
                    this.BasicInfoTab.SetValues(response.result);
                    if (!String.IsNullOrEmpty(timeCodeP))
                    {
                        timecode.Select(timeCodeP);
                    }
                    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})", ),
                            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;
                }
            }
            catch (Exception exp)
            {
                X.Msg.Alert(Resources.Common.Error, exp.Message).Show();
            }
        }
        protected void Page_Load(object sender, EventArgs e)
        {
            if (!X.IsAjaxRequest && !IsPostBack)
            {
                activeControls = new List <UserControl>();
                SetExtLanguage();
                if (string.IsNullOrEmpty(Request.QueryString["_reportName"]))
                {
                    X.Msg.Alert("Error", "Error");
                }
                bool fillValues = false;
                Dictionary <string, string> valuesDict = null;
                if (!string.IsNullOrEmpty(Request.QueryString["values"]))
                {
                    fillValues = true;
                    valuesDict = new Dictionary <string, string>();
                    string[] valsPairs = Request.QueryString["values"].Split('^');
                    foreach (var item in valsPairs)
                    {
                        string[] pair = item.Split('|');
                        valuesDict.Add(pair[0], pair[1]);
                    }
                }
                ReportParametersListRequest req = new ReportParametersListRequest();
                req.ReportName = Request.QueryString["_reportName"];
                ListResponse <ReportParameter> parameters = _systemService.ChildGetAll <ReportParameter>(req);
                if (!parameters.Success)
                {
                    X.Msg.Alert("Error", "Error");
                }
                int i = -1;

                string labels = "";
                foreach (var item in parameters.Items)
                {
                    i += 1;

                    switch (item.controlType)
                    {
                    case 1: TextField tf = new TextField()
                    {
                            ID = "tb_" + item.id, FieldLabel = item.caption
                    };
                        FormPanel1.Items.Add(tf);
                        if (valuesDict != null && valuesDict.ContainsKey(item.id))
                        {
                            tf.Text = valuesDict[item.id];
                        }
                        tf.AllowBlank = !item.mandatory;
                        break;

                    case 3:
                    case 2: NumberField nf = new NumberField()
                    {
                            ID = "nb_" + item.id, FieldLabel = item.caption
                    };
                        if (valuesDict != null && valuesDict.ContainsKey(item.id))
                        {
                            nf.Value = Convert.ToDouble(valuesDict[item.id]);
                        }
                        FormPanel1.Items.Add(nf);


                        break;

                    case 4: DateField d = new DateField()
                    {
                            ID = "date_" + item.id, FieldLabel = item.caption
                    }; FormPanel1.Items.Add(d);
                        if (valuesDict != null && valuesDict.ContainsKey(item.id))
                        {
                            d.SelectedDate = DateTime.ParseExact(valuesDict[item.id], "yyyyMMdd", new CultureInfo("en"));
                        }

                        d.AllowBlank = !item.mandatory;
                        break;

                    case 5:
                        if (item.classId == 0)
                        {
                            ComboBox             box  = new ComboBox();
                            List <XMLDictionary> dict = Common.XMLDictionaryList(_systemService, item.data);
                            box.Triggers.Add(new FieldTrigger()
                            {
                                Icon = TriggerIcon.Clear
                            });
                            box.Listeners.TriggerClick.Handler = "this.clearValue();";



                            foreach (var xml_elem in dict)
                            {
                                box.Items.Add(new Ext.Net.ListItem(Server.UrlDecode(xml_elem.value), xml_elem.key));
                            }
                            box.ID            = "control_" + item.id;
                            box.Name          = "control_" + item.id;
                            box.AnyMatch      = true;
                            box.CaseSensitive = false;
                            box.Editable      = false;

                            box.FieldLabel = item.caption;
                            if (valuesDict != null && valuesDict.ContainsKey(item.id))
                            {
                                box.Select(valuesDict[item.id]);
                            }
                            FormPanel1.Items.Add(box);
                            box.AllowBlank = !item.mandatory;

                            break;
                        }



                        Control       cont        = LoadControl("Reports/Controls/" + GetControlNameByClassId(item.classId));
                        IComboControl contAsCombo = cont as IComboControl;
                        if (contAsCombo != null)
                        {
                            contAsCombo.SetLabel(item.caption);
                        }
                        if (item.classId == 31201)
                        {
                            ((EmployeeFilter)cont).SetLabel(item.caption);
                            ((EmployeeFilter)cont).EmployeeComboBox.EmptyText = "";
                        }
                        if (item.classId == 31107)
                        {
                            ((EmploymentStatusFilter)cont).Filter.FieldLabel = ((EmploymentStatusFilter)cont).Filter.EmptyText;
                            ((EmploymentStatusFilter)cont).Filter.EmptyText  = "";
                        }
                        cont.ID = "control_" + item.id;
                        contAsCombo.GetComboBox().AllowBlank = !item.mandatory;
                        if (valuesDict != null && valuesDict.ContainsKey(item.id))
                        {
                            if (contAsCombo != null)
                            {
                                contAsCombo.Select(valuesDict[item.id]);
                            }
                            contAsCombo.GetComboBox().Select(0);
                        }

                        Container c = new Container()
                        {
                            Layout = "FitLayout"
                        };
                        c.ContentControls.Add(cont);
                        FormPanel1.Items.Add(c);
                        break;

                    case 6: Checkbox cb = new Checkbox()
                    {
                            ID = "control_" + item.id, FieldLabel = item.caption
                    }; cb.InputValue = "true"; if (valuesDict != null && valuesDict.ContainsKey(item.id))
                        {
                            cb.Checked
                                = valuesDict[item.id] == "true";
                        }
                        break;

                    default: X.Msg.Alert("Error", "unknown control"); break;
                    }
                    labels += item.caption + "^";
                }
                labels.TrimEnd('^');
                X.Call("parent.setLabels", labels);
                this.labels.Text = labels;
            }
        }
Beispiel #29
0
 private void FillActiveStatus()
 {
     activeStatusStore.DataSource = Common.XMLDictionaryList(_systemService, "16");
     activeStatusStore.DataBind();
 }
Beispiel #30
0
 private void FillLdMethodStore()
 {
     ldMethodStore.DataSource = Common.XMLDictionaryList(_systemService, "17");
     ldMethodStore.DataBind();
 }