Ejemplo n.º 1
0
        protected void dependandtsStore_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

            EmployeeContactsListRequest request = new EmployeeContactsListRequest();

            request.EmployeeId = Convert.ToInt32(CurrentEmployee.Text);
            ListResponse <Dependant> resp = _employeeService.ChildGetAll <Dependant>(request);

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


            this.dependandtsStore.DataSource = resp.Items;
            e.Total = resp.count;

            this.dependandtsStore.DataBind();
        }
Ejemplo n.º 2
0
        protected void emergencyContactsStore_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

            EmployeeContactsListRequest request = new EmployeeContactsListRequest();

            request.EmployeeId = Convert.ToInt32(CurrentEmployee.Text);
            ListResponse <EmployeeEmergencyContact> documents = _employeeService.ChildGetAll <EmployeeEmergencyContact>(request);

            if (!documents.Success)
            {
                X.Msg.Alert(Resources.Common.Error, documents.Summary).Show();
                return;
            }
            this.emergencyContactStore.DataSource = documents.Items;
            e.Total = documents.count;

            this.emergencyContactStore.DataBind();
        }
Ejemplo n.º 3
0
        protected void Page_Load(object sender, EventArgs e)
        {
            if (!X.IsAjaxRequest && !IsPostBack)
            {
                SetExtLanguage();


                EmployeeContactsListRequest EVreq = new EmployeeContactsListRequest();
                EVreq.EmployeeId = Convert.ToInt32(Request.QueryString["employeeId"]);
                ListResponse <EmployeeUserValue> EVresp = _employeeService.ChildGetAll <EmployeeUserValue>(EVreq);
                if (!EVresp.Success)
                {
                    Common.errorMessage(EVresp);
                    return;
                }

                ListRequest UPReq = new ListRequest();

                UPReq.Filter = "";
                ListResponse <UserProperty> UPResp = _employeeService.ChildGetAll <UserProperty>(UPReq);
                if (!UPResp.Success)
                {
                    Common.errorMessage(UPResp);
                    return;
                }

                //UserPropertyRecordRequest UPReq = new UserPropertyRecordRequest();
                //UPReq.propertyId = propertyIdParamter;

                //RecordResponse<UserProperty> UPResp = _employeeService.ChildGetRecord<UserProperty>(UPReq);
                //if (!UPResp.Success)
                //{
                //    Common.errorMessage(UPResp);
                //    return;
                //}
                try
                {
                    //EmployeeUserValue EV;
                    //if (EVresp.result != null)
                    //    EV = EVresp.result;
                    //else
                    //    EV = new EmployeeUserValue();


                    EVresp.Items.ForEach(x =>
                    {
                        UserProperty corrVal = UPResp.Items.Where(y => y.recordId == x.propertyId).Count() != 0 ? UPResp.Items.Where(y => y.recordId == x.propertyId).First() : new UserProperty();
                        //AssetPropertyValue corrVal = valResp.Items.Where(d => d.propertyId == x.propertyId).ToList().Count > 0 ? valResp.Items.Where(d => d.propertyId == x.propertyId).ToList()[0] : null;
                        switch (x.mask)
                        {
                        case 1: propertiesForm.Items.Add(new TextField()
                            {
                                Text = x.value != null && !string.IsNullOrEmpty(x.value) ? x.value : "", FieldLabel = x.propertyName, Name = x.propertyId
                            }); break;                                                                                                                                                                                  //text

                        case 2: propertiesForm.Items.Add(new NumberField()
                            {
                                Value = x.value != null && !string.IsNullOrEmpty(x.value) ? x.GetValueDouble() : 0, FieldLabel = x.propertyName, Name = x.propertyId
                            }); break;                                                                                                                                                                                               //number

                        case 3: propertiesForm.Items.Add(new DateField()
                            {
                                Value = x.value, Name = x.propertyId, FieldLabel = x.propertyName, Format = _systemService.SessionHelper.GetDateformat()
                            }); break;                                                                                                                                                                                //datetime

                        case 4: propertiesForm.Items.Add(new DateField()
                            {
                                Value = x.value != null?x.value.Replace('.', ':'):"", Name = x.propertyId, FieldLabel = x.propertyName, Format = _systemService.SessionHelper.GetDateformat() + " HH.mm", SubmitFormat = "m/d/Y H.i"
                            }); break;

                        case 5: propertiesForm.Items.Add(new Checkbox()
                            {
                                Checked = x.value != null && !string.IsNullOrEmpty(x.value) ? x.GetValueBool() : false, FieldLabel = x.propertyName, Name = x.propertyId, InputValue = "true", SubmitValue = true
                            }); break;                                                                                                                                                                                                                                  //checkbox
                        }
                    });
                }
                catch (Exception exp)
                {
                    X.Msg.Alert("Error", exp.Message).Show();
                }
            }
        }