Exemplo n.º 1
0
        public object FillParent(string action, Dictionary <string, object> extraParams)
        {
            StoreRequestParameters prms = new StoreRequestParameters(extraParams);



            List <UserInfo>  data;
            UsersListRequest req = new UsersListRequest();

            req.Size    = "1000";
            req.StartAt = "0";
            req.Filter  = "";


            req.DepartmentId = "0";
            req.PositionId   = "0";
            req.BranchId     = "0";
            req.SortBy       = "fullName";

            ListResponse <UserInfo> response = _systemService.ChildGetAll <UserInfo>(req);

            data = response.Items;
            return(new
            {
                data
            });
        }
Exemplo n.º 2
0
        private List <SystemFolder> GetFolders()
        {
            ListRequest req = new ListRequest();
            ListResponse <SystemFolder> docs = _systemService.ChildGetAll <SystemFolder>(req);

            return(docs.Items);
        }
Exemplo n.º 3
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 <Letter> nationalities = _systemService.ChildGetAll <Letter>(request);

            if (!nationalities.Success)
            {
                X.Msg.Alert(Resources.Common.Error, GetGlobalResourceObject("Errors", nationalities.ErrorCode) != null ? GetGlobalResourceObject("Errors", nationalities.ErrorCode).ToString() + "<br>" + GetGlobalResourceObject("Errors", "ErrorLogId") + nationalities.LogId : nationalities.Summary).Show();
                return;
            }
            this.Store1.DataSource = nationalities.Items;
            e.Total = nationalities.Items.Count;

            this.Store1.DataBind();
        }
Exemplo n.º 4
0
        private void FillNationality()
        {
            ListRequest documentTypes       = new ListRequest();
            ListResponse <Nationality> resp = _systemService.ChildGetAll <Nationality>(documentTypes);

            if (!resp.Success)
            {
                X.Msg.Alert(Resources.Common.Error, GetGlobalResourceObject("Errors", resp.ErrorCode) != null ? GetGlobalResourceObject("Errors", resp.ErrorCode).ToString() + "<br>" + GetGlobalResourceObject("Errors", "ErrorLogId") + resp.LogId : resp.Summary).Show();
                return;
            }
            naStore.DataSource = resp.Items;
            naStore.DataBind();
        }
Exemplo n.º 5
0
        private void FillNationality()
        {
            ListRequest documentTypes       = new ListRequest();
            ListResponse <Nationality> resp = _systemService.ChildGetAll <Nationality>(documentTypes);

            if (!resp.Success)
            {
                Common.errorMessage(resp);
                return;
            }
            naStore.DataSource = resp.Items;
            naStore.DataBind();
        }
Exemplo n.º 6
0
        public void FillDocumentType()
        {
            ListRequest req = new ListRequest();

            ListResponse <CompanyDocumentType> response = _systemService.ChildGetAll <CompanyDocumentType>(req);

            if (!response.Success)
            {
                Common.errorMessage(response);
                return;
            }
            dtStore.DataSource = response.Items;
            dtStore.DataBind();
        }
Exemplo n.º 7
0
        private void FillReportsComboStore()
        {
            ReportsListRequest request = new ReportsListRequest();

            request.moduleId = "80";
            request.Filter   = "";
            ListResponse <ModuleClass> resp = _systemService.ChildGetAll <ModuleClass>(request);

            if (!resp.Success)
            {
                Common.errorMessage(resp);
            }
            ReportComboStore.DataSource = resp.Items;
            ReportComboStore.DataBind();
        }
Exemplo n.º 8
0
        private void FillDashboard()
        {
            ListRequest req = new ListRequest();


            ListResponse <DashboardItem> dashoard = _systemService.ChildGetAll <DashboardItem>(req);

            if (!dashoard.Success)
            {
                X.Msg.Alert(Resources.Common.Error, dashoard.Summary).Show();
                return;
            }

            store1.DataSource = dashoard.Items.Where(d => d.itemId / 10 == 1).ToList();
            store1.DataBind();

            store2.DataSource = dashoard.Items.Where(d => d.itemId / 10 == 2).ToList();
            store2.DataBind();

            store3.DataSource = dashoard.Items.Where(d => d.itemId / 10 == 3).ToList();
            store3.DataBind();

            store4.DataSource = dashoard.Items.Where(d => d.itemId / 10 == 4).ToList();
            store4.DataBind();

            store5.DataSource = dashoard.Items.Where(d => d.itemId / 10 == 5).ToList();
            store5.DataBind();

            store6.DataSource = dashoard.Items.Where(d => d.itemId / 10 == 6).ToList();
            store6.DataBind();
        }
Exemplo n.º 9
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 <GovernmentOrganisation> nationalities = _systemService.ChildGetAll <GovernmentOrganisation>(request);

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

            this.Store1.DataBind();
        }
Exemplo n.º 10
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 <Currency> resp = _systemService.ChildGetAll <Currency>(request);

            if (!resp.Success)
            {
                Common.errorMessage(resp);
                return;
            }
            this.Store1.DataSource = resp.Items;
            e.Total = resp.count;

            this.Store1.DataBind();
        }
Exemplo n.º 11
0
        public object FillParent(string action, Dictionary <string, object> extraParams)
        {
            StoreRequestParameters prms = new StoreRequestParameters(extraParams);



            List <UserInfo> data;
            ListRequest     req = new ListRequest();

            ListResponse <UserInfo> response = _systemService.ChildGetAll <UserInfo>(req);

            data = response.Items;
            return(new
            {
                data
            });
        }
Exemplo n.º 12
0
        private void FillCountry()
        {
            ListRequest nationalityRequest  = new ListRequest();
            ListResponse <Nationality> resp = _systemService.ChildGetAll <Nationality>(nationalityRequest);

            NationalityStore.DataSource = resp.Items;
            NationalityStore.DataBind();
        }
Exemplo n.º 13
0
 protected void FillKeyName(object sender, DirectEventArgs e)
 {
     if (!string.IsNullOrEmpty(moduleId.SelectedItem.Value.ToString()) && !string.IsNullOrEmpty(classId.SelectedItem.Value.ToString()))
     {
         ClassPropertyListRequest req = new ClassPropertyListRequest();
         req.moduleId = moduleId.SelectedItem.Value.ToString();
         req.classId  = classId.SelectedItem.Value.ToString();
         ListResponse <Model.System.ClassProperty> resp = _systemService.ChildGetAll <Model.System.ClassProperty>(req);
         if (!resp.Success)
         {
             Common.errorMessage(resp);
             return;
         }
         keyNameStore.DataSource = resp.Items;
         keyNameStore.DataBind();
     }
 }
Exemplo n.º 14
0
        protected void ltId_ReadData(object sender, StoreReadDataEventArgs e)
        {
            ListRequest req = new ListRequest();
            ListResponse <LetterTemplate> eds = _systemService.ChildGetAll <LetterTemplate>(req);

            Store2.DataSource = eds.Items;
            Store2.DataBind();
        }
Exemplo n.º 15
0
        protected void Store1_RefreshData(object sender, StoreReadDataEventArgs e)
        {
            CompanyFilesListRequest request = new CompanyFilesListRequest();

            request.recordId = 0;

            ListResponse <Attachement> routers = _systemService.ChildGetAll <Attachement>(request);

            if (!routers.Success)
            {
                Common.errorMessage(routers);
                return;
            }
            this.Store1.DataSource = routers.Items;


            this.Store1.DataBind();
        }
Exemplo n.º 16
0
        public void FillFilesStore(int caseId)
        {
            //ListRequest request = new ListRequest();
            CaseAttachmentsListRequest request = new CaseAttachmentsListRequest();

            request.recordId = caseId;

            ListResponse <Attachement> routers = _systemService.ChildGetAll <Attachement>(request);

            if (!routers.Success)
            {
                X.Msg.Alert(Resources.Common.Error, GetGlobalResourceObject("Errors", routers.ErrorCode) != null ? GetGlobalResourceObject("Errors", routers.ErrorCode).ToString() + "<br>" + GetGlobalResourceObject("Errors", "ErrorLogId") + routers.LogId: routers.Summary).Show();
                return;
            }
            this.filesStore.DataSource = routers.Items;


            this.filesStore.DataBind();
        }
Exemplo n.º 17
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
            //string s = File.ReadAllText(MapPath("~/Utilities/alerts.txt"));
            //List<SystemAlert> preDefined = JsonConvert.DeserializeObject<List<SystemAlert>>(s);

            ListRequest request = new ListRequest();

            request.Filter = "";
            ListResponse <SystemAlert> resp = _systemService.ChildGetAll <SystemAlert>(request);

            if (!resp.Success)
            {
                Common.errorMessage(resp);
                return;
            }
            //List<SystemAlert> union = new List<SystemAlert>();

            //foreach (var item in preDefined)
            //{
            //    if (stored.Items.Where(f => f.alertId == item.alertId).Count() > 0)
            //    {

            //        SystemAlert added = stored.Items.Where(f => f.alertId == item.alertId).First();
            //        added.predefined = true;
            //        union.Add(added);
            //        item.predefined = true;
            //    }
            //    else
            //        union.Add(item);
            //}
            resp.Items.ForEach(x =>
            {
                if (x.activeStatus == (Int16)ActiveStatus.ACTIVE)
                {
                    x.isActive = true;
                }
                else
                {
                    x.isActive = false;
                }
            });
            this.Store1.DataSource = resp.Items;
            e.Total = resp.Items.Count;

            this.Store1.DataBind();
        }
Exemplo n.º 18
0
        protected void Page_Load(object sender, EventArgs e)
        {
            if (!X.IsAjaxRequest && !IsPostBack)
            {
                SetExtLanguage();
                HideShowButtons();
                HideShowColumns();
            }
            ListRequest req = new ListRequest();
            ListResponse <KeyValuePair <string, string> > defaults = _systemService.ChildGetAll <KeyValuePair <string, string> >(req);

            if (!defaults.Success)
            {
                X.MessageBox.ButtonText.Ok = Resources.Common.Ok;
                X.Msg.Alert(Resources.Common.Error, defaults.Summary).Show();
                return;
            }
            FillCombos();
            FillDefaults(defaults.Items);
        }
Exemplo n.º 19
0
        private void FillCurrency()
        {
            ListRequest             branchesRequest = new ListRequest();
            ListResponse <Currency> resp            = _systemService.ChildGetAll <Currency>(branchesRequest);

            if (!resp.Success)
            {
                Common.errorMessage(resp);
            }
            currencyStore.DataSource = resp.Items;
            currencyStore.DataBind();
        }
Exemplo n.º 20
0
        protected void TransactionLog_RefreshData(object sender, StoreReadDataEventArgs e)
        {
            List <Ext.Net.Parameter> l = e.Parameters.ToList <Ext.Net.Parameter>();

            //GEtting the filter from the page
            TransactionLogListRequest request = new TransactionLogListRequest();

            request.ClassId    = Convert.ToInt32(l[0].Value);
            request.PrimaryKey = Convert.ToInt32(l[1].Value);
            request.UserId     = 0;
            request.Type       = 0;
            request.StartAt    = e.Start.ToString();
            request.Size       = e.Limit.ToString();
            request.SoryBy     = "eventDt";
            ListResponse <TransactionLog> logs = _systemService.ChildGetAll <TransactionLog>(request);


            e.Total = logs.count;
            transactionLogStore.DataSource = new List <object>();
            transactionLogStore.DataBind();
            TransationLogScreen.Show();
        }
Exemplo n.º 21
0
        public static List <XMLDictionary> XMLDictionaryList(ISystemService systemService, string database)
        {
            XMLDictionaryListRequest request = new XMLDictionaryListRequest();

            request.database = string.IsNullOrEmpty(database)?"0": database;
            ListResponse <XMLDictionary> resp = systemService.ChildGetAll <XMLDictionary>(request);

            if (!resp.Success)
            {
                Common.errorMessage(resp);
                return(new List <XMLDictionary>());
            }
            return(resp.Items);
        }
Exemplo n.º 22
0
        public static List <XMLDictionary> FillAcessLevel(ISystemService systemService)
        {
            XMLDictionaryListRequest request = new XMLDictionaryListRequest();

            request.database = "5";
            ListResponse <XMLDictionary> resp = systemService.ChildGetAll <XMLDictionary>(request);

            if (!resp.Success)
            {
                Common.errorMessage(resp);
                return(new List <XMLDictionary>());
            }
            return(resp.Items);
        }
        private void FillGOs()
        {
            ListRequest goRequest = new ListRequest();
            ListResponse <GovernmentOrganisation> resp = systemService.ChildGetAll <GovernmentOrganisation>(goRequest);

            if (!resp.Success)
            {
                Common.errorMessage(resp);
            }
            if (resp.Items != null)
            {
                goStore.DataSource = resp.Items;
                goStore.DataBind();
            }
        }
Exemplo n.º 24
0
        protected void CalcMethodStore_RefreshData(object sender, StoreReadDataEventArgs e)
        {
            XMLDictionaryListRequest request = new XMLDictionaryListRequest();

            request.database = "48";
            ListResponse <XMLDictionary> resp = _systemService.ChildGetAll <XMLDictionary>(request);

            if (!resp.Success)
            {
                Common.errorMessage(resp);
                return;
            }
            calcMethodStore.DataSource = resp.Items;
            calcMethodStore.DataBind();
        }
Exemplo n.º 25
0
 private void FillCurrency()
 {
     try
     {
         ListRequest             request = new ListRequest();
         ListResponse <Currency> resp    = _systemService.ChildGetAll <Currency>(request);
         if (!resp.Success)
         {
             Common.errorMessage(resp);
         }
         currencyStore.DataSource = resp.Items;
         currencyStore.DataBind();
     }catch (Exception exp)
     {
         Common.errorMessage(new ListResponse <Currency>());
     }
 }
Exemplo n.º 26
0
        private List <UserInfo> GetUsersFiltered(string query)
        {
            UsersListRequest req = new UsersListRequest();

            req.Size    = "100";
            req.StartAt = "0";
            req.Filter  = query;


            req.DepartmentId = "0";
            req.PositionId   = "0";
            req.BranchId     = "0";
            req.SortBy       = "fullName";

            ListResponse <UserInfo> users = _systemService.ChildGetAll <UserInfo>(req);

            return(users.Items);
        }
Exemplo n.º 27
0
        protected void classesStore_ReadData(object sender, StoreReadDataEventArgs e)
        {
            if (!string.IsNullOrEmpty(CurrentModule.Text))
            {
                AccessControlListRequest req = new AccessControlListRequest();
                req.GroupId  = "0";
                req.ModuleId = CurrentModule.Text;
                ListResponse <ModuleClass> resp = _systemService.ChildGetAll <ModuleClass>(req);
                if (!resp.Success)
                {
                    Common.errorMessage(resp);
                    return;
                }


                classesStore.DataSource = resp.Items;
                classesStore.DataBind();
            }
        }
Exemplo n.º 28
0
        public bool ExistMandatoryFields(string reportCode)
        {
            ReportParametersListRequest req = new ReportParametersListRequest();

            req.ReportName = reportCode;
            ListResponse <ReportParameter> parameters = _systemService.ChildGetAll <ReportParameter>(req);

            if (!parameters.Success)
            {
                X.Msg.Alert("Error", "Error");
            }
            foreach (var item in parameters.Items)
            {
                if (item.mandatory)
                {
                    return(true);
                }
            }
            return(false);
        }
        protected void TimeVariationHistory_RefreshData(object sender, StoreReadDataEventArgs e)
        {
            List <Ext.Net.Parameter> l = e.Parameters.ToList <Ext.Net.Parameter>();

            TimeVariationHistoryListRequest req = new TimeVariationHistoryListRequest();

            req.classId   = l[0].Value;
            req.masterRef = l[1].Value;
            req.userId    = "0";
            req.type      = "0";

            ListResponse <TimeVariationHistory> resp = _systemService.ChildGetAll <TimeVariationHistory>(req);

            if (!resp.Success)
            {
                Common.errorMessage(resp);
                return;
            }
            resp.Items.ForEach(x => x.data       = x.data.Replace("{", string.Empty).Replace("\",", string.Empty).Replace(",", Environment.NewLine));
            TimeVariationHistoryStore.DataSource = resp.Items;
            TimeVariationHistoryStore.DataBind();
        }
Exemplo n.º 30
0
        private void FillUsers()
        {
            UsersListRequest req = new UsersListRequest();

            req.Size    = "1000";
            req.StartAt = "0";



            req.DepartmentId = "0";
            req.PositionId   = "0";
            req.BranchId     = "0";
            req.SortBy       = "fullName";
            ListResponse <UserInfo> users = _systemService.ChildGetAll <UserInfo>(req);

            if (!users.Success)
            {
                Common.errorMessage(users);
                return;
            }
            userStore.DataSource = users.Items;
            userStore.DataBind();
        }