예제 #1
0
 public ClientForm(OrganizationsModel model, MainForm mainForm)
 {
     InitializeComponent();
     Name.Text                = model.Name;
     Bank.Text                = model.Account;
     Address.Text             = model.Address;
     Phone.Text               = model.Phone;
     Contact.Text             = model.Director;
     Discount.Visibility      = Visibility.Visible;
     Discount.Text            = model.Discount;
     DiscountLabel.Visibility = Visibility.Visible;
     AddClient.Content        = "Сохранить";
     Title.Content            = "Редактирование данных клиента";
     this.mainForm            = mainForm;
     orgModel = model;
 }
예제 #2
0
        public async Task <OperationDataResult <OrganizationsModel> > Index(OrganizationsRequestModel requestModel)
        {
            try
            {
                OrganizationsModel organizationsPnModel = new OrganizationsModel();

                if (new[] { "Status" }.Contains(requestModel.SortColumnName))
                {
                }
                IQueryable <Organization> organizationsQuery = myMicrotingDbContext.Organizations.AsQueryable();
                if (!string.IsNullOrEmpty(requestModel.SortColumnName))
                {
                    if (requestModel.IsSortDsc)
                    {
                        organizationsQuery = organizationsQuery
                                             .CustomOrderByDescending(requestModel.SortColumnName);
                    }
                    else
                    {
                        organizationsQuery = organizationsQuery
                                             .CustomOrderBy(requestModel.SortColumnName);
                    }
                }
                else
                {
                    organizationsQuery = myMicrotingDbContext.Organizations.OrderBy(x => x.Id);
                }

                if (!string.IsNullOrEmpty(requestModel.Name))
                {
                    organizationsQuery = organizationsQuery.Where(x =>
                                                                  x.CustomerId.ToString().Contains(requestModel.Name.ToLower()) ||
                                                                  x.DomainName.ToString().Contains(requestModel.Name.ToLower()) ||
                                                                  x.Id.ToString().Contains(requestModel.Name.ToLower()) ||
                                                                  x.InstanceId.ToString().Contains(requestModel.Name.ToLower()) ||
                                                                  x.InstanceStatus.ToString().Contains(requestModel.Name.ToLower()) ||
                                                                  x.NextUpgrade.ToString().Contains(requestModel.Name.ToLower()) ||
                                                                  x.NumberOfLicenses.ToString().Contains(requestModel.Name.ToLower()) ||
                                                                  x.NumberOfLicensesUsed.ToString().Contains(requestModel.Name.ToLower()) ||
                                                                  x.ServiceEmail.ToString().Contains(requestModel.Name.ToLower()) ||
                                                                  x.UpToDateStatus.ToString().Contains(requestModel.Name.ToLower()));
                }

                var organizationsResult = await organizationsQuery.Where(x => x.WorkflowState != Constants.WorkflowStates.Removed)
                                          .Skip(requestModel.Offset)
                                          .Take(requestModel.PageSize)
                                          .ToListAsync();

                List <OrganizationModel> organizations = mapper.Map <List <OrganizationModel> >(organizationsResult);
                organizationsPnModel.Total = await myMicrotingDbContext.Organizations.CountAsync(x => x.WorkflowState != Constants.WorkflowStates.Removed);

                organizationsPnModel.Organizations = organizations;

                return(new OperationDataResult <OrganizationsModel>(true, organizationsPnModel));
            }
            catch (Exception e)
            {
                Trace.TraceError(e.Message);
                logger.LogError(e.Message);
                return(new OperationDataResult <OrganizationsModel>(false,
                                                                    localizationService.GetString("ErrorObtainingOrganizationsInfo") + e.Message));
            }
        }
예제 #3
0
 public async Task <AjaxModel <DataModel> > OrganizationsSave([FromBody] OrganizationsModel model)
 {
     return(await AjaxHelper.SaveAsync(m => this.masterRepository.OrganizationsSave(model), "OrganizationsSave Saved Successfully"));
 }
예제 #4
0
        public ActionResult Organizations(int?page)
        {
            OrganizationsModel model = new OrganizationsModel();

            return(View(model));
        }
예제 #5
0
 public async Task OrganizationsSave(OrganizationsModel model)
 {
     await SaveEntity <OrganizationsEntity, OrganizationsModel>(model);
 }