Пример #1
0
        private static object GetScopesPayload(List <PermissionScope> scopes)
        {
            var resourcePermissions = new List <AppResource>();
            var distinctResources   = scopes.GroupBy(s => s.resourceAppId).Select(r => r.First()).ToList();

            foreach (var distinctResource in distinctResources)
            {
                var id          = distinctResource.resourceAppId;
                var appResource = new AppResource()
                {
                    Id = id
                };
                appResource.ResourceAccess.AddRange(scopes.Where(s => s.resourceAppId == id).ToList());
                resourcePermissions.Add(appResource);
            }
            return(resourcePermissions);
        }
Пример #2
0
        private void bindProfile(User m)
        {
            set("m.Id", m.Id);
            set("m.Name", m.RealName);
            set("m.NickName", m.Name);
            set("m.Title", m.Title);

            String kv = "Name=Value";

            dropList("Year", AppResource.GetInts(1910, 2009), kv, m.BirthYear);
            dropList("Month", AppResource.GetInts(1, 12), kv, m.BirthMonth);
            dropList("Day", AppResource.GetInts(1, 31), kv, m.BirthDay);


            dropList("Gender", AppResource.Gender, kv, m.Gender);
            dropList("Relationship", AppResource.Relationship, kv, m.Relationship);
            dropList("Blood", AppResource.Blood, kv, m.Blood);
            dropList("Degree", AppResource.Degree, kv, m.Degree);
            dropList("Zodiac", AppResource.Zodiac, kv, m.Zodiac);

            dropList("ProvinceId1", AppResource.Province, kv, m.ProvinceId1);
            dropList("ProvinceId2", AppResource.Province, kv, m.ProvinceId2);

            set("m.City1", m.City1);
            set("m.City2", m.City2);

            set("m.Birthday", string.Format("{0}-{1}-{2}", m.BirthYear, m.BirthMonth, m.BirthDay));

            checkboxList("Purpose", AppResource.Purpose, "Name=Name", m.Profile.Purpose);
            dropList("ContactCondition", AppResource.ContactCondition, kv, m.Profile.ContactCondition);

            IBlock block = getBlock("sexyInfo");

            if (config.Instance.Site.ShowSexyInfoInProfile)
            {
                bindSexyInfo(block, m);
            }
            set("m.Description", m.Profile.Description);
            set("m.Signature", m.Signature);

            set("m.UserDescriptionMin", config.Instance.Site.UserDescriptionMin);
            set("m.UserDescriptionMax", config.Instance.Site.UserDescriptionMax);
            set("m.UserSignatureMin", config.Instance.Site.UserSignatureMin);
            set("m.UserSignatureMax", config.Instance.Site.UserSignatureMax);
        }
Пример #3
0
        private void OnFormLoad(object sender, EventArgs e)
        {
            ImageCollection ic = AppResource.LoadToolImages();

            barManager1.Images        = ic;
            toolAdd.ImageIndex        = (int)AppResource.EIcons.add;
            toolEdit.ImageIndex       = (int)AppResource.EIcons.edit;
            toolDel.ImageIndex        = (int)AppResource.EIcons.delete;
            toolRefresh.ImageIndex    = (int)AppResource.EIcons.refresh;
            toolSearch.ImageIndex     = (int)AppResource.EIcons.search;
            toolPrint.ImageIndex      = (int)AppResource.EIcons.print;
            toolDesign.ImageIndex     = (int)AppResource.EIcons.tree;
            toolWeight.ImageIndex     = (int)AppResource.EIcons.download;
            barButtonItem1.ImageIndex = (int)AppResource.EIcons.search;
            barButtonItem2.ImageIndex = (int)AppResource.EIcons.back;
            //containerDal = new ContainerDal();
            LoadDataAndBindGrid();
        }
Пример #4
0
        public FrmLogin()
        {
            //读取设置
            Properties.Settings _setting = Properties.Settings.Default;

            //按照用户保存的设置改变皮肤
            SkinUtil.RegisterSkin(System.IO.Path.Combine(Application.StartupPath, "skins.dll"));
            SkinUtil.SetSkin(_setting.Skin);
            SkinManager.EnableFormSkins();
            SkinUtil.SetFont(_setting.FontFamily, _setting.FontSize);

            InitializeComponent();

            txtID.Text             = _setting.Usercode;
            this.btnSettings.Image = AppResource.GetIcon(AppResource.EIcons.settings);
            //txtPwd.Text = SecurityUtil.Base64ToString(_setting.password);
            //checkRememberMe.Checked = _setting.RememberMe;
        }
Пример #5
0
        public FormConfig(AppConfig appConfig, AppResource appResource)
        {
            _appConfig   = appConfig;
            _appResource = appResource;
            InitializeComponent();

            // Language
            this.Text                = "TileWindow - " + resources.GetString("Configuration");
            this.label1.Text         = resources.GetString("ColorOnTiles");
            this.label2.Text         = resources.GetString("OpacityOnTiles");
            this.btnSaveChanges.Text = resources.GetString("SaveChanges");
            this.btnClose.Text       = resources.GetString("Close");

            // Read config
            this.cmbStartup.Items.Clear();
            this.cmbStartup.Items.Add(EmptyStartup);
            this.cmbStartup.SelectedItem = EmptyStartup;
        }
Пример #6
0
        private void OnFormLoad(object sender, EventArgs e)
        {
            ImageCollection ic = AppResource.LoadToolImages();

            barManager1.Images        = ic;
            barButtonItem7.ImageIndex = (int)AppResource.EIcons.report;
            barButtonItem1.ImageIndex = (int)AppResource.EIcons.ok;
            barButtonItem2.ImageIndex = (int)AppResource.EIcons.refresh;
            barButtonItem3.ImageIndex = (int)AppResource.EIcons.search;
            barButtonItem4.ImageIndex = (int)AppResource.EIcons.approved;
            barButtonItem5.ImageIndex = (int)AppResource.EIcons.week;
            barButtonItem6.ImageIndex = (int)AppResource.EIcons.design;
            barButtonItem8.ImageIndex = (int)AppResource.EIcons.report;

            InitDate();
            BindLookUpControl();
            Query(1, null, null);
        }
Пример #7
0
        public async static Task <bool> GetAppText()
        {
            var httpResponseMessage = await Client.GetAsync(_stringJsonUrl);

            try
            {
                httpResponseMessage.EnsureSuccessStatusCode();
                string jsonString = await httpResponseMessage.Content.ReadAsStringAsync();

                TextResource = JsonConvert.DeserializeObject <AppResource>(jsonString);
                return(true);
            }
            catch (Exception ex)
            {
                Console.WriteLine(ex);
                return(false);
            }
        }
Пример #8
0
        public AppResource GetAllByID(ref BaseEntity Base, Int32 ID)
        {
            AppResource   objAppResource = new AppResource();
            SqlDataReader dr             = null;
            SqlCommand    cmd            = null;

            try
            {
                cmd = new SqlCommand("AppResource_GetById_Sp", clsConnection.GetConnection())
                {
                    CommandType = CommandType.StoredProcedure
                };
                cmd.Parameters.AddWithValue("@ID", ID);
                dr = cmd.ExecuteReader();
                while (dr.Read())
                {
                    objAppResource = GetEntity_v3(dr);
                }

                dr.NextResult();
                if (dr.HasRows)
                {
                    while (dr.Read())
                    {
                        //clsLanguage lang = new clsLanguage
                        //{
                        //    ID = dr.GetColumnValue<Int32>("LANGUAGEID")
                        //};
                        //lstLanguages.Add(lang);           comente
                    }
                    //objAppResource.ListLanguage = lstLanguages; comente
                }
            }
            catch (Exception ex)
            {
                objAppResource = null;
                Base.Errors.Add(new BaseEntity.ListError(ex, "An error occurred  getting a AppResource by it's Id."));
            }
            finally
            {
                clsConnection.DisposeCommand(cmd);
            }
            return(objAppResource);
        }
Пример #9
0
        public List <QuoteStatus> GetQuoteStatuses(QuoteFilter filter)
        {
            using var context = Context();
            var totalQuote = context.Quote.Where(u => u.OrganisationId == filter.OrganisationId &&
                                                 (filter.CustomerId == 0 || u.CustomerId == filter.CustomerId) &&
                                                 (
                                                     (filter.DateTypeFilter.Id == (int)QuoteFilterEnum.All &&
                                                      (filter.FromDate == null || u.Date >= filter.FromDate || u.ExpireDate >= filter.FromDate) &&
                                                      (filter.ToDate == null || u.Date <= filter.ToDate || u.ExpireDate <= filter.ToDate)) ||
                                                     (
                                                         filter.DateTypeFilter.Id == (int)QuoteFilterEnum.Date &&
                                                         (filter.FromDate == null || u.Date >= filter.FromDate) &&
                                                         (filter.ToDate == null || u.Date <= filter.ToDate)
                                                     ) ||
                                                     (
                                                         filter.DateTypeFilter.Id == (int)QuoteFilterEnum.Expire &&
                                                         (filter.FromDate == null || u.ExpireDate >= filter.FromDate) &&
                                                         (filter.ToDate == null || u.ExpireDate <= filter.ToDate)
                                                     )
                                                 ) &&
                                                 (u.StatusId != (int)QuoteEnum.Delete) &&
                                                 (string.IsNullOrEmpty(filter.SearchText) || u.Number.Contains(filter.SearchText))
                                                 ).GroupBy(u => u.StatusId)
                             .Select(u => new
            {
                StatusId = u.Key,
                Count    = u.Count()
            }).ToList();
            var status = context.QuoteStatus.Where(u => u.Id != (int)QuoteEnum.Delete).ToList().Select(u => new QuoteStatus
            {
                Id    = u.Id,
                Name  = IsKhmer?u.NameKh: u.Name,
                Count = totalQuote.Any(t => t.StatusId == u.Id) ? totalQuote.FirstOrDefault(t => t.StatusId == u.Id).Count : 0
            }).ToList();

            status.Insert(0, new QuoteStatus
            {
                Id    = 0,
                Name  = AppResource.GetResource("All"),
                Count = totalQuote.Sum(u => u.Count)
            });
            return(status);
        }
Пример #10
0
        private static void loadList()
        {
            all.Clear();

            var certificateMap = JsonObject
                                 .Parse(AppResource
                                        .GetResourceData("assets/certificate-map.json")
                                        .ToString(true));

            var displayNameMap = JsonObject
                                 .Parse(AppResource
                                        .GetResourceData("assets/display-names.json")
                                        .ToString(true));

            const string fallbackLanguageTag = "en-US";
            var          languageTag         = CultureInfo.CurrentUICulture.IetfLanguageTag;

            if (displayNameMap.ContainsName(languageTag))
            {
                displayNameMap = displayNameMap[languageTag].ObjectValue;
            }
            else
            {
                displayNameMap = displayNameMap[fallbackLanguageTag].ObjectValue;
            }

            var maps = from key in certificateMap.Select(p => p.Name)
                       join displayName in displayNameMap
                       on key equals displayName.Name
                       select(
                certificate : certificateMap[key].ArrayValue.FilterString().ToArray(),
                displayName : displayName.StringValue
                );

            foreach (var(certificate, displayName) in maps)
            {
                all.Add(new BuiltInCertificates(certificate)
                {
                    DisplayName = displayName
                });
            }
        }
Пример #11
0
        private void OnFormLoad(object sender, EventArgs e)
        {
            ImageCollection ic = AppResource.LoadToolImages();

            barManager1.Images        = ic;
            barButtonItem1.ImageIndex = (int)AppResource.EIcons.add;
            barButtonItem5.ImageIndex = (int)AppResource.EIcons.open;
            barButtonItem4.ImageIndex = (int)AppResource.EIcons.copy;
            barButtonItem6.ImageIndex = (int)AppResource.EIcons.save;
            barButtonItem2.ImageIndex = (int)AppResource.EIcons.print;

            //初始化控件的值
            InitUI();
            CustomFields.AppendLotExpFields(gridView1, true);
            CustomFields.AppendMaterialFields(gridView1);
            if (EditedAsnBody != null)
            {
                ShowAsnDetail(EditedAsnBody);
            }
        }
Пример #12
0
        private void OnFormLoad(object sender, EventArgs e)
        {
            ImageCollection ic = AppResource.LoadToolImages();

            barManager1.Images        = ic;
            barButtonItem1.ImageIndex = (int)AppResource.EIcons.save;
            barButtonItem2.ImageIndex = (int)AppResource.EIcons.remove;
            barButtonItem3.ImageIndex = (int)AppResource.EIcons.back;
            barButtonItem4.ImageIndex = (int)AppResource.EIcons.ok;
            barButtonItem5.ImageIndex = (int)AppResource.EIcons.approved;

            try
            {
                bindingSource1.DataSource = GetReportOnlyDiff(this.billID);
            }
            catch (Exception ex)
            {
                MsgBox.Err(ex.Message);
            }
        }
Пример #13
0
 public void OnDownloadCompleted(bool successful, AppResource ar, string msg)
 {
     if (ar.isRequired)
     {
         if (!successful)
         {
             if (RequiredReadyCallback != null)
             {
                 RequiredReadyCallback(successful, msg);
                 RequiredReadyCallback = null;
             }
         }
         else if (AllRequiredDownloaded() && RequiredReadyCallback != null)
         {
             RequiredReadyCallback(successful, msg);
             RequiredReadyCallback = null;
         }
     }
     DownloadNextInQueue();
 }
Пример #14
0
        public List <StatusOverview> GetStatusOverviews(string organisationId)
        {
            using var context = Context();
            var khmer = IsKhmer;
            var organisationCurrencySymbole = context.OrganisationBaseCurrency.FirstOrDefault(u => u.OrganisationId == organisationId).BaseCurrency.Symbole;
            var bills = context.Bill.Where(u => u.IdNavigation.OrganisationId == organisationId && (u.IdNavigation.ExpenseStatusId == (int)ExpenseStatusEnum.Draft || u.IdNavigation.ExpenseStatusId == (int)ExpenseStatusEnum.WaitingForApproval || u.IdNavigation.ExpenseStatusId == (int)ExpenseStatusEnum.Approved))
                        .Select(u => new { u.IdNavigation.ExpenseStatusId, u.IdNavigation.BaseCurrencyExchangeRate, u.IdNavigation.TotalIncludeTax })
                        .GroupBy(u => u.ExpenseStatusId)
                        .Select(u => new
            {
                StatusId = u.Key,
                Total    = u.Sum(u => u.TotalIncludeTax * u.BaseCurrencyExchangeRate),
                Count    = u.Count()
            }).ToList();
            var status = (from st in context.ExpenseStatus.Where(u => u.Id == (int)ExpenseStatusEnum.Draft || u.Id == (int)ExpenseStatusEnum.WaitingForApproval || u.Id == (int)ExpenseStatusEnum.Approved)
                          .Select(u => new { u.Id, Name = khmer?u.NameKh: u.Name }).ToList()
                          let bill = bills.FirstOrDefault(u => u.StatusId == st.Id)
                                     select new StatusOverview
            {
                Count = bill == null?0:bill.Count,
                StatusId = st.Id,
                StatusName = st.Name,
                CurrencySymbole = organisationCurrencySymbole,
                Total = bill == null?0:bill.Total.Value
            }).ToList();
            var now          = CurrentCambodiaTime;
            var totalOverDue = context.Bill.Where(u => u.IdNavigation.OrganisationId == organisationId && u.IdNavigation.ExpenseStatusId == (int)ExpenseStatusEnum.Approved && u.IdNavigation.DeliveryDate != null && u.IdNavigation.DeliveryDate < now)
                               .Sum(u => u.IdNavigation.TotalIncludeTax * u.IdNavigation.BaseCurrencyExchangeRate.Value);
            var countOverDue = context.Bill.Where(u => u.IdNavigation.OrganisationId == organisationId && u.IdNavigation.ExpenseStatusId == (int)ExpenseStatusEnum.Approved && u.IdNavigation.DeliveryDate != null && u.IdNavigation.DeliveryDate < now)
                               .Count();

            status.Add(new StatusOverview
            {
                Count           = countOverDue,
                CurrencySymbole = organisationCurrencySymbole,
                StatusId        = (int)ExpenseStatusEnum.OverDue,
                StatusName      = AppResource.GetResource("Overdue"),
                Total           = totalOverDue
            });
            return(status);
        }
Пример #15
0
        private void OnFormLoad(object sender, EventArgs e)
        {
            ImageCollection ic = AppResource.LoadToolImages();

            barManager1.Images      = ic;
            toolAdd.ImageIndex      = (int)AppResource.EIcons.add;
            toolEdit.ImageIndex     = (int)AppResource.EIcons.edit;
            toolDel.ImageIndex      = (int)AppResource.EIcons.delete;
            toolRefresh.ImageIndex  = (int)AppResource.EIcons.refresh;
            toolSearch.ImageIndex   = (int)AppResource.EIcons.search;
            toolCopyNew.ImageIndex  = (int)AppResource.EIcons.copy;
            toolPrint.ImageIndex    = (int)AppResource.EIcons.print;
            toolDesign.ImageIndex   = (int)AppResource.EIcons.design;
            toolMaterial.ImageIndex = (int)AppResource.EIcons.search;
            //barButtonItem1.ImageIndex = (int)AppResource.EIcons.tree;
            //barButtonItem2.ImageIndex = (int)AppResource.EIcons.remove;

            //materialDal = new MaterialDal();
            //CustomFields.AppendMaterialFields(gridView1);
            LoadDataAndBindGrid();
        }
Пример #16
0
        public List <Models.InvoiceStatus> GetInvoiceStatuses(InvoiceFilter filter)
        {
            using var context = Context();
            var result = context.Invoice.Where(u => (u.IdNavigation.OrganisationId == filter.OrganisationId) &&
                                               (filter.CustomerId == 0 || u.IdNavigation.CustomerId == filter.CustomerId) &&
                                               (
                                                   (filter.DateTypeFilter.Id == (int)InvoiceDateTypeFilterEnum.All &&
                                                    (filter.FromDate == null || u.IdNavigation.Date >= filter.FromDate || u.IdNavigation.DueDate >= filter.FromDate) &&
                                                    (filter.ToDate == null || u.IdNavigation.Date <= filter.ToDate || u.IdNavigation.DueDate <= filter.ToDate)) ||
                                                   (filter.DateTypeFilter.Id == (int)InvoiceDateTypeFilterEnum.Date &&
                                                    (filter.FromDate == null || u.IdNavigation.Date >= filter.FromDate) &&
                                                    (filter.ToDate == null || u.IdNavigation.Date <= filter.ToDate)) ||
                                                   (
                                                       filter.DateTypeFilter.Id == (int)InvoiceDateTypeFilterEnum.DueDate &&
                                                       (filter.FromDate == null || u.IdNavigation.DueDate >= filter.FromDate) &&
                                                       (filter.ToDate == null || u.IdNavigation.DueDate <= filter.ToDate))
                                               ) &&
                                               (string.IsNullOrEmpty(filter.SearchText) || u.IdNavigation.Number.Contains(filter.SearchText))
                                               ).GroupBy(u => u.StatusId)
                         .Select(u => new
            {
                StatusId = u.Key,
                Count    = u.Count()
            }).ToList();
            var statues = context.InvoiceStatus.ToList()
                          .Select(u => new Models.InvoiceStatus
            {
                Count = result.Any(t => t.StatusId == u.Id)?result.FirstOrDefault(t => t.StatusId == u.Id).Count:0,
                Id    = u.Id,
                Name  = IsKhmer?u.NameKh: u.Name
            }).ToList();

            statues.Insert(0, new Models.InvoiceStatus
            {
                Id    = 0,
                Name  = AppResource.GetResource("All"),
                Count = result.Sum(u => u.Count)
            });
            return(statues);
        }
Пример #17
0
        public Int32 Get_QuantityLegalDocuments(ref BaseEntity Entity, AppResource resource /*, tBaseLanguagueIdList ListLanguage*/)
        {
            Int32      quantity = -1;
            SqlCommand cmd      = null;

            try
            {
                cmd = new SqlCommand("[AppResource_QuantityLegalDocuments_Sp]", clsConnection.GetConnection())
                {
                    CommandType = CommandType.StoredProcedure
                };

                cmd.Parameters.AddWithValue("@RESOURCECATEGORYID", resource.CategotyId);
                cmd.Parameters.AddWithValue("@RESOURCEID", resource.ID);

                //if (ListLanguage.Count > 0)
                //{
                //    cmd.Parameters.Add(new SqlParameter { ParameterName = "@TYPE_LANGUAGEID", Value = ListLanguage, SqlDbType = SqlDbType.Structured, TypeName = "dbo.TY_GET_LANGUAGESID" });
                //}

                SqlParameter outputParam = cmd.Parameters.Add("@QUANTITY", SqlDbType.Int);
                outputParam.Direction = ParameterDirection.Output;

                cmd.ExecuteNonQuery();
                if (!String.IsNullOrEmpty(cmd.Parameters["@QUANTITY"].Value.ToString()))
                {
                    quantity = Convert.ToInt32(cmd.Parameters["@QUANTITY"].Value);
                }
            }
            catch (Exception ex)
            {
                quantity = -1;
                Entity.Errors.Add(new BaseEntity.ListError(ex, "An error occurred  deleting a resource."));
            }
            finally
            {
                clsConnection.DisposeCommand(cmd);
            }
            return(quantity);
        }
Пример #18
0
        private void OnFormLoad(object sender, EventArgs e)
        {
            ImageCollection ic = AppResource.LoadToolImages();

            barManager1.Images               = ic;
            toolEdit.ImageIndex              = (int)AppResource.EIcons.edit;
            toolDel.ImageIndex               = (int)AppResource.EIcons.delete;
            toolRefresh.ImageIndex           = (int)AppResource.EIcons.refresh;
            toolToday.ImageIndex             = (int)AppResource.EIcons.today;
            toolWeek.ImageIndex              = (int)AppResource.EIcons.week;
            toolView.ImageIndex              = (int)AppResource.EIcons.eye;
            toolSearch.ImageIndex            = (int)AppResource.EIcons.search;
            barSubItem1.ImageIndex           = (int)AppResource.EIcons.print;
            toolCopy.ImageIndex              = (int)AppResource.EIcons.copy;
            toolCancelCommit.ImageIndex      = (int)AppResource.EIcons.remove;
            toolCommit.ImageIndex            = (int)AppResource.EIcons.ok;
            barButtonItem10.ImageIndex       = (int)AppResource.EIcons.message;
            toolModifyInstoreType.ImageIndex = (int)AppResource.EIcons.edit;

            //ucGridPanel.CustomGridCaption();
            ucQueryPanel.DoQueryNotCompleteBill("所有进行中(未完成收货)的单据");
        }
        private AppResource GetEntity_v3(SqlDataReader ObjDr)
        {
            AppResource obj = new AppResource
            {
                ID              = ObjDr.GetColumnValue <Int32>("ID"),
                Id              = ObjDr.GetColumnValue <Int32>("ID"),
                FileName        = ObjDr.GetColumnValue <String>("FileName"),
                FileDescription = ObjDr.GetColumnValue <String>("DESCRIPTION"),
                FileExtension   = ObjDr.GetColumnValue <String>("FileExtension"),
                FilePublicName  = ObjDr.GetColumnValue <String>("FilePublicname"),
                DOCTYPE         = ObjDr.GetColumnValue <String>("DOCTYPE"),
                NameResource    = ObjDr.GetColumnValue <String>("NameResource"),
                UserId          = ObjDr.GetColumnValue <Int32>("DistributorId"),
                Status          = ObjDr.GetColumnValue <Int16>("STATUS"),
                isUpload        = ObjDr.GetColumnValue <Int16>("ISUPLOAD"),
                CategotyId      = ObjDr.GetColumnValue <Int32>("RESOURCECATEGORYID"),
                Name            = ObjDr.GetColumnValue <String>("NAME"),
                UnitPrice       = ObjDr.GetColumnValue <Decimal>("UnitPrice"),
            };

            return(obj);
        }
Пример #20
0
        private void OnFormLoad(object sender, EventArgs e)
        {
            ImageCollection ic = AppResource.LoadToolImages();

            barManager1.Images           = ic;
            toolEdit.ImageIndex          = (int)AppResource.EIcons.download;
            toolRefresh.ImageIndex       = (int)AppResource.EIcons.refresh;
            toolToday.ImageIndex         = (int)AppResource.EIcons.today;
            toolWeek.ImageIndex          = (int)AppResource.EIcons.week;
            toolSearch.ImageIndex        = (int)AppResource.EIcons.search;
            toolPrint.ImageIndex         = (int)AppResource.EIcons.print;
            barSubItem1.ImageIndex       = (int)AppResource.EIcons.log;
            toolDeleteBill.ImageIndex    = (int)AppResource.EIcons.edit;
            toolCreateCRNBill.ImageIndex = (int)AppResource.EIcons.copy;
            toolModifyAmount.ImageIndex  = (int)AppResource.EIcons.design;
            toolRelatingStack.ImageIndex = (int)AppResource.EIcons.approved;
            InitDate();
            BindLookUpControl();

            //默认显示所有未完成单据
            myPre.Query(1, DateTime.Now, DateTime.Now);
        }
        public void TestServiceLifeCycle()
        {
            using (var context = MockContext.Start(GetType()))
            {
                string rgName         = CreateName("appplatform-sdk-test-rg");
                string serviceName    = CreateName("appplatform-sdk-test-asc");
                string appName        = CreateName("appplatform-sdk-test-app");
                string deploymentName = CreateName("default");

                CreateResourceGroup(context, rgName);
                ServiceResource service = CreateService(context, rgName, serviceName);
                Assert.NotNull(service);

                AppResource app = CreateApp(context, rgName, serviceName, appName, deploymentName);
                Assert.NotNull(app);

                DeleteService(context, rgName, serviceName);
                AssertNoService(context, rgName);

                DeleteResourceGroup(context, rgName);
            }
        }
Пример #22
0
        public PieChart GetIncome(DashboardFilter filter)
        {
            using var context = Context();
            var organisationIds = filter.OrganisationIds;
            var totalInvoice    = context.Invoice.Where(u => organisationIds.Any(t => t == u.IdNavigation.OrganisationId) &&
                                                        u.IdNavigation.Date >= filter.FromDate &&
                                                        u.IdNavigation.Date <= filter.ToDate
                                                        )
                                  .Select(u => new { u.IdNavigation.TotalIncludeTax, u.IdNavigation.BaseCurrencyExchangeRate })
                                  .Sum(u => u.BaseCurrencyExchangeRate * u.TotalIncludeTax);
            var totalOpeningQuote = context.Quote.Where(u => organisationIds.Any(t => t == u.OrganisationId) &&
                                                        u.Date >= filter.FromDate &&
                                                        u.Date <= filter.ToDate &&
                                                        (u.StatusId != (int)QuoteEnum.Delete && u.StatusId != (int)QuoteEnum.Declined && u.StatusId != (int)QuoteEnum.Invoiced)
                                                        ).Sum(u => u.TotalIncludeTax * u.BaseCurrencyExchangeRate);
            var totalNotePaid = context.Invoice.Where(u => organisationIds.Any(t => t == u.IdNavigation.OrganisationId) &&
                                                      u.IdNavigation.Date >= filter.FromDate &&
                                                      u.IdNavigation.Date <= filter.ToDate &&
                                                      u.StatusId == (int)InvoiceStatusEnum.WaitingForPayment
                                                      ).Select(u => new { u.IdNavigation.TotalIncludeTax, u.IdNavigation.BaseCurrencyExchangeRate })
                                .Sum(u => u.BaseCurrencyExchangeRate * u.TotalIncludeTax);

            return(new PieChart
            {
                Labels = new List <string>
                {
                    AppResource.GetResource("Total Invoice"),
                    AppResource.GetResource("Pending Quote"),
                    AppResource.GetResource("Un-Paid Invoice")
                },
                Values = new List <decimal>
                {
                    Math.Round(totalInvoice, 0),
                    Math.Round(totalOpeningQuote.Value, 0),
                    Math.Round(totalNotePaid)
                }
            });
        }
Пример #23
0
        private void OnFormLoad(object sender, EventArgs e)
        {
            ImageCollection ic = AppResource.LoadToolImages();

            barManager1.Images              = ic;
            toolEdit.ImageIndex             = (int)AppResource.EIcons.download;
            toolRefresh.ImageIndex          = (int)AppResource.EIcons.refresh;
            toolToday.ImageIndex            = (int)AppResource.EIcons.today;
            toolWeek.ImageIndex             = (int)AppResource.EIcons.week;
            toolSearch.ImageIndex           = (int)AppResource.EIcons.search;
            toolPrint.ImageIndex            = (int)AppResource.EIcons.print;
            barSubItem1.ImageIndex          = (int)AppResource.EIcons.log;
            barButtonItem8.ImageIndex       = (int)AppResource.EIcons.edit;
            barButtonItem1.ImageIndex       = (int)AppResource.EIcons.ok;
            toolCreateCRNBill.ImageIndex    = (int)AppResource.EIcons.design;
            this.toolJoinVehicle.ImageIndex = (int)AppResource.EIcons.tree;
            toolCancelOrder.ImageIndex      = (int)AppResource.EIcons.remove;
            InitDate();
            BindLookUpControl();

            //默认显示所有未完成单据
            myPre.Query(1, DateTime.Now, DateTime.Now);
        }
Пример #24
0
        public PieChart GetProfiteAndLost(DashboardFilter filter)
        {
            using var context = Context();
            var organisationIds = filter.OrganisationIds;
            var totalInvoice    = context.Invoice.Where(u => organisationIds.Any(t => t == u.IdNavigation.OrganisationId) &&
                                                        u.IdNavigation.Date >= filter.FromDate &&
                                                        u.IdNavigation.Date <= filter.ToDate
                                                        )
                                  .Select(u => new { u.IdNavigation.TotalIncludeTax, u.IdNavigation.BaseCurrencyExchangeRate })
                                  .Sum(u => u.BaseCurrencyExchangeRate * u.TotalIncludeTax);
            var totalExpense = context.Expense.Where(u => (u.ExpenseStatusId == (int)ExpenseStatusEnum.Approved || u.ExpenseStatusId == (int)ExpenseStatusEnum.Billed) &&
                                                     organisationIds.Any(t => t == u.OrganisationId) &&
                                                     u.CloseDate >= filter.FromDate &&
                                                     u.CloseDate <= filter.ToDate
                                                     )
                               .Select(u => new { u.TotalIncludeTax, u.BaseCurrencyExchangeRate })
                               .Sum(u => u.TotalIncludeTax * u.BaseCurrencyExchangeRate);
            var totalEmployeeSalary = context.PayrollEmployee.Where(u => u.Date >= filter.FromDate && u.Date <= filter.ToDate)
                                      .Sum(u => u.Total);

            totalExpense += totalEmployeeSalary;
            return(new PieChart
            {
                Labels = new List <string>
                {
                    AppResource.GetResource("Income"),
                    AppResource.GetResource("Expense"),
                    AppResource.GetResource("Profit & Lost")
                },
                Values = new List <decimal>
                {
                    Math.Round(totalInvoice, 0),
                    Math.Round(totalExpense.Value, 0),
                    Math.Round(totalInvoice - totalExpense.Value)
                }
            });
        }
Пример #25
0
        public override void ExecuteMigration()
        {
            var appRes = new AppResource();

            using (var transaction = Connection.BeginTransaction())
            {
                ExecuteOnResult("select Id, Path from App", reader =>
                {
                    var id   = reader.GetInt64(0);
                    var path = reader.IsDBNull(1) ? null : reader.GetString(1);
                    if (path == null)
                    {
                        return;
                    }
                    try
                    {
                        var(icon, col) = appRes.GetAppIconAndColor(path);
                        var name       = appRes.GetAppName(path);
                        ExecuteSql("update App set Name = @name, Color = @color, Icon = @icon where Id = @id",
                                   ("name", name),
                                   ("color", col),
                                   ("icon", icon),
                                   ("id", id));
                    }
Пример #26
0
 public void RemoveResource(AppResource appResource)
 {
     _context.AppResources.Remove(appResource);
 }
Пример #27
0
        public Task UpdateResource(AppResource appResource)
        {
            _context.AppResources.Update(appResource);

            return(Task.CompletedTask);
        }
Пример #28
0
 public void AddResource(AppResource appResource)
 {
     _context.AppResources.AddAsync(appResource);
 }
        public Boolean AppResource_Save(ref BaseEntity Entity, /*tBaseLanguagueIdList listLanguages,*/ AppResource Resource, Boolean RegisterTBL = false, String Username = "")
        {
            Boolean success = false;

            Entity = new BaseEntity();

            success = AppResourceDAO.Instance.Save(ref Entity, /*listLanguages,*/ Resource, RegisterTBL, Username);

            return(success);
        }
 public Int32 Get_QuantityLegalDocuments(ref BaseEntity Base, AppResource resource /*, tBaseLanguagueIdList ListLanguage*/)
 {
     return(AppResourceDAO.Instance.Get_QuantityLegalDocuments(ref Base, resource /*, ListLanguage*/));
 }