Beispiel #1
0
    // Update is called once per frame
    void Update()
    {
        if (!healthSystem.gameOver)
        {
            if (Input.GetKeyUp(KeyCode.Escape))
            {
                if (!menuPanel.activeSelf)
                {
                    stopGame = true;
                    menuPanel.SetActive(true);
                    mainMenu.SetActive(true);
                    Time.timeScale = 0;
                }
                else
                {
                    stopGame = false;
                    menuPanel.SetActive(false);
                    mainMenu.SetActive(false);

                    settings.SetActive(false);
                    settingsDefault.SetActive(false);
                    settingsSound.SetActive(false);
                    settingsDifficulty.SetActive(false);

                    Time.timeScale = 1;

                    int tmpSkillVal = StaticSettings.setSkillMargin();
                    skillbar.updateSkillMargin(tmpSkillVal);

                    bgm.updateBGMVolume(StaticSettings.volumeBGM);
                }
            }
        }
    }
        void Init()
        {
            try
            {
                if (methodType == MethodType.Edit)
                {
                    Details();
                    return;
                }

                StaticSettings staticSettings = new StaticSettings();
                letters = new Letters()
                {
                    RefId               = letters.RefId,
                    TableName           = letters.TableName,
                    ControlNo           = letters.ControlNo,
                    Date                = DateTime.Now,
                    Signatories         = staticSettings.Head,
                    SignatoriesPosition = staticSettings.HeadPos,
                    CreatedBy           = User.UserId,
                    DateCreated         = DateTime.Now
                };
                UnitOfWork unitOfWork = new UnitOfWork();
                unitOfWork.LettersRepo.Insert(letters);
                unitOfWork.Save();
                Details();
            }
            catch (Exception ex)
            {
                MessageBox.Show(ex.Message, ex.Message, MessageBoxButtons.OK, MessageBoxIcon.Error);
            }
        }
Beispiel #3
0
        private void Details()
        {
            try
            {
                UnitOfWork     unitOfWork     = new UnitOfWork();
                StaticSettings staticSettings = new StaticSettings();
                cboAccountant.Properties.DataSource = unitOfWork.Signatories.Get(x => x.Office.Contains("Accounting") || x.Position.Contains("Accountant"));
                cboDepthead.Properties.DataSource   =
                    unitOfWork.Signatories.Get(x => x.Office.Contains(staticSettings.OfficeName));
                if (staticSettings.Offices.IsDivision == true)
                {
                    cboDepthead.Properties.DataSource =
                        unitOfWork.Signatories.Get(x => x.Office.Contains(staticSettings.Offices.UnderOfOffice.OfficeName));
                }
                cboPayee.Properties.DataSource = unitOfWork.EmployeesRepo.Get();

                var item = unitOfWork.LiquidationsRepo.Find(x => x.Id == liquidations.Id);
                cboPayee.EditValue         = item.EmployeeId;
                cboAccountant.EditValue    = item.PAId;
                cboDepthead.EditValue      = item.HeadOfDep;
                dtDate.EditValue           = item.Date;
                txtParticulars.EditValue   = item.Particulars;
                txtAmount.EditValue        = item.Amount;
                txtPeriodCovered.EditValue = item.PeriodCovered;
            }
            catch (Exception e)
            {
            }
        }
Beispiel #4
0
 public DetailsModel(ApplicationDbContext context, CoreService coreService, SiteContext siteContext, StaticSettings staticSettings)
 {
     DbContext      = context;
     CoreService    = coreService;
     SiteContext    = siteContext;
     StaticSettings = staticSettings;
 }
        async void ILoad <PurchaseRequests> .Init()
        {
            var staticSetting = new StaticSettings();
            var ft            = Win.Properties.Settings.Default.FundType;

            UnitOfWork unitOfWork = new UnitOfWork();

            ucPR.PRGrid.ShowLoadingPanel();
            if (ucPR.InvokeRequired)
            {
                ucPR.Invoke(new Action(async() =>
                {
                    ucPR.PRGridControl.DataSource = await new UnitOfWork().PurchaseRequestsRepo
                                                    .Fetch(m => m.OfficeId == staticSetting.OfficeId && m.Year == staticSetting.Year && m.FT == ft)
                                                    .OrderByDescending(x => x.Date)
                                                    .ToListAsync();
                }));
            }
            else
            {
                ucPR.PRGridControl.DataSource = await new UnitOfWork().PurchaseRequestsRepo
                                                .Fetch(m => m.OfficeId == staticSetting.OfficeId && m.Year == staticSetting.Year && m.FT == ft)
                                                .OrderByDescending(x => x.Date)
                                                .ToListAsync();
            }

            ucPR.PRGrid.HideLoadingPanel();
        }
        void _search(string search)
        {
            try
            {
                UnitOfWork unitOfWork = new UnitOfWork();
                ucPR.txtSearch.Text = search;
                StaticSettings staticSettings = new StaticSettings();
                var            status         = ucPR.chkIsClosed.Checked;

                ucPR.PRGridControl.DataSource = new BindingList <PurchaseRequests>(unitOfWork.PurchaseRequestsRepo.Get(x => (x.OfficeId == staticSettings.OfficeId && (x.Description.Contains(search) || x.ControlNo == search)) && x.IsClosed == status));
                if (search.ToDecimal() > 0)
                {
                    var amount = search.ToDecimal();
                    ucPR.PRGridControl.DataSource = new BindingList <PurchaseRequests>(unitOfWork.PurchaseRequestsRepo.Get(x => (x.OfficeId == staticSettings.OfficeId && (x.TotalAmount >= amount && x.TotalAmount <= amount)) && x.IsClosed == status));
                }

                if (ucPR.PRGridControl.DataSource is BindingList <PurchaseRequests> list)
                {
                    Detail(list.FirstOrDefault());
                }
            }
            catch (Exception exception)
            {
            }
        }
Beispiel #7
0
    // player chose hard difficulty
    public void HardDifficulty()
    {
        StaticSettings.changeDifficulty(StaticSettings.HARD);

        normalBtn.interactable = true;
        hardBtn.interactable   = false;
    }
 void ITransactions <PurchaseRequests> .Init()
 {
     try
     {
         if (methodType == MethodType.Add)
         {
             UnitOfWork     unitOfWork     = new UnitOfWork();
             StaticSettings staticSettings = new StaticSettings();
             var            pr             = unitOfWork.PurchaseRequestsRepo.Fetch(m => m.OfficeId == staticSettings.OfficeId)
                                             .OrderByDescending(m => m.Id).FirstOrDefault();
             item = new PurchaseRequests()
             {
                 ControlNo       = IdHelper.OfficeControlNo(pr?.ControlNo, staticSettings.OfficeId, "PR", "PurchaseRequests"),
                 DivisionHead    = staticSettings.Offices.IsDivision == true ? staticSettings.Head : "",
                 DivisionHeadPos = staticSettings.Offices.IsDivision == true ? staticSettings.Head : "",
                 OfficeId        = staticSettings.OfficeId,
                 CreatedBy       = User.UserId,
                 Year            = staticSettings.Year,
                 FT = Win.Properties.Settings.Default.FundType
             };
             unitOfWork.PurchaseRequestsRepo.Insert(item);
             unitOfWork.Save();
         }
         Detail();
     }
     catch (Exception e)
     {
         MessageBox.Show(e.Message, e.Message, MessageBoxButtons.OK, MessageBoxIcon.Error);
     }
 }
Beispiel #9
0
        public void LoadPayees()
        {
            UnitOfWork     unitOfWork     = new UnitOfWork();
            StaticSettings staticSettings = new StaticSettings();

            frm.cboPayee.Properties.DataSource = new EntityServerModeSource()
            {
                QueryableSource = unitOfWork.PayeesRepo.Fetch()
            };
            frm.cboAccountant.Properties.DataSource = new BindingList <Signatories>(unitOfWork.Signatories
                                                                                    .Get(m => m.Office.Contains("Accounting") || m.Office.Contains("Accountant")));
            frm.cboTreasurer.Properties.DataSource = new BindingList <Signatories>(unitOfWork.Signatories
                                                                                   .Get(m => m.Office.Contains("Treasurer") || m.Office.Contains("Treasury")));

            frm.txtBudgetOfficer.Properties.DataSource = new BindingList <Signatories>(unitOfWork.Signatories
                                                                                       .Get(m => m.Office.Contains("Provincial Budget Office")));
            if (staticSettings.Offices.IsDivision == true)
            {
                frm.cboApprovedBy.Properties.DataSource = new BindingList <Signatories>(unitOfWork.Signatories
                                                                                        .Get(m => m.Office.Contains("Governor Office") || m.Office.Contains("Governor's Office")));
            }
            else
            {
                frm.cboApprovedBy.Properties.DataSource = new BindingList <Signatories>(unitOfWork.Signatories
                                                                                        .Get(m => m.Office.Contains(staticSettings.OfficeName)));
            }
        }
Beispiel #10
0
    // player chose normal difficulty
    public void NormalDifficulty()
    {
        StaticSettings.changeDifficulty(StaticSettings.NORMAL);

        normalBtn.interactable = false;
        hardBtn.interactable   = true;
    }
Beispiel #11
0
 void ReInit()
 {
     try
     {
         var unitOfWork    = new UnitOfWork();
         var staticSttings = new StaticSettings();
         var ob            = unitOfWork.ObligationsRepo.Fetch(m => m.OfficeId == staticSttings.OfficeId).OrderByDescending(x => x.Id).FirstOrDefault();
         //  this.obId = (ob?.Id ?? 0) + 1;
         // this.controlNo = DateTime.Now.ToString("yyyy-MM-") + obId.ToString("0000");
         //var payee = unitOfWork.PayeesRepo.Find(m => m.Name == "Earmarked PR");
         this.obligations = new Obligations()
         {
             ControlNo    = IdHelper.OfficeControlNo(ob?.ControlNo, staticSttings.OfficeId, "ObR", "Obligations"),
             Year         = new StaticSettings().Year,
             Date         = DateTime.Now,
             Earmarked    = obligations?.Earmarked,
             PayeeId      = obligations?.PayeeId,
             PayeeOffice  = obligations?.PayeeOffice,
             PayeeAddress = obligations?.PayeeAddress,
             Description  = obligations?.Description,
             ORDetails    = obligations?.ORDetails ?? new List <ORDetails>(),
             PRNo         = obligations?.PRNo,
             OfficeId     = new StaticSettings().OfficeId,
             FT           = Win.Properties.Settings.Default.FundType
         };
         unitOfWork.ObligationsRepo.Insert(obligations);
         unitOfWork.Save();
     }
     catch (Exception e)
     {
         Console.WriteLine(e);
         throw;
     }
 }
Beispiel #12
0
        public void Search(string search)
        {
            UnitOfWork             unitOfWork     = new UnitOfWork();
            IQueryable <Employees> employees      = unitOfWork.EmployeesRepo.Fetch();
            StaticSettings         staticSettings = new StaticSettings();

            if (employees.Any(m => m.OffcAcr.Contains(search)))
            {
                employees = employees.Where(m => m.OffcAcr.Contains(search));
            }
            if (employees.Any(m => m.OfficeName.Contains(search)))
            {
                employees = employees.Where(m => m.OfficeName.Contains(search));
            }
            if (employees.Any(m => (m.FirstName + " " + m.LastName).Contains(search)))
            {
                employees = employees.Where(m => (m.FirstName + " " + m.LastName).Contains(search));
            }
            if (cboOfficeSearch.GetSelectedDataRow() is Offices item)
            {
                employees = employees.Where(x => x.OfficeId == item.Id);
            }
            else
            {
                employees = employees.Where(x => x.OfficeId == staticSettings.OfficeId);
            }
            EmployeesGridControl.DataSource = new BindingList <Employees>(employees.ToList());
        }
        public void Awake()
        {
            var extraInstallers = new List<IInstaller>();

            if (_staticSettings != null)
            // Static settings are needed if creating a SceneCompositionRoot dynamically
            {
                extraInstallers = _staticSettings.Installers;
                OnlyInjectWhenActive = _staticSettings.OnlyInjectWhenActive;
                ParentNewObjectsUnderRoot = _staticSettings.ParentNewObjectsUnderRoot;
                _staticSettings = null;
            }

            // We always want to initialize GlobalCompositionRoot as early as possible
            GlobalCompositionRoot.Instance.EnsureIsInitialized();

            Assert.IsNull(Container);
            Assert.IsNull(RootFacade);

            Log.Debug("Initializing SceneCompositionRoot in scene '{0}'", this.gameObject.scene.name);
            _container = CreateContainer(
                false, GlobalCompositionRoot.Instance.Container, extraInstallers);

            Log.Debug("SceneCompositionRoot: Finished install phase.  Injecting into scene...");
            InjectObjectsInScene();

            Log.Debug("SceneCompositionRoot: Resolving root IFacade...");
            _rootFacade = _container.Resolve<IFacade>();

            DecoratedScenes.Clear();

            Assert.IsNotNull(Container);
            Assert.IsNotNull(RootFacade);
        }
Beispiel #14
0
 public ReactionSendService(ApplicationDbContext dbContext, CoreService coreService, SiteContext siteContext, StaticSettings staticSettings)
 {
     DbContext      = dbContext;
     CoreService    = coreService;
     SiteContext    = siteContext;
     StaticSettings = staticSettings;
 }
Beispiel #15
0
        public frmObligationRequestReportViewer()
        {
            InitializeComponent();
            StaticSettings staticSettings = new StaticSettings();

            cboYearList.Properties.DataSource = new BindingList <Years>(new UnitOfWork().YearsRepo.Get(m => m.OfficeId == staticSettings.OfficeId));
        }
 public AuthenticationController(ApplicationDbContext dbContext, CoreService coreService, SiteContext siteContext, StaticSettings staticSettings)
 {
     DbContext      = dbContext;
     CoreService    = coreService;
     SiteContext    = siteContext;
     StaticSettings = staticSettings;
 }
Beispiel #17
0
        private void btnAccomplishmentReport_ItemClick(object sender, DevExpress.XtraBars.ItemClickEventArgs e)
        {
            StaticSettings          staticSettings = new StaticSettings();
            frmAccomplishmentReport frm            = new frmAccomplishmentReport("Documents", $"[{staticSettings.Offices.OffcAcr}]Document Tracking System({User.UserName })");

            frm.ShowDialog();
        }
Beispiel #18
0
        private void xrLabel37_BeforePrint(object sender, System.Drawing.Printing.PrintEventArgs e)
        {
            var            lbl            = sender as XRLabel;
            StaticSettings staticSettings = new StaticSettings();

            lbl.Text = $@"[{staticSettings.Offices?.OffcAcr}] Office Fund Information Management System ({User.UserName})";
        }
Beispiel #19
0
        private void btnPreviewRepo_ButtonClick(object sender, DevExpress.XtraEditors.Controls.ButtonPressedEventArgs e)
        {
            if (DocActionGridView.GetFocusedRow() is DocumentActions item)
            {
                using (NetworkShareAccesser.Access("PLGUNV_NAS", @"", "pitd.is_user", "Apple_01"))
                {
                    StaticSettings staticSettings = new StaticSettings();
                    UnitOfWork     unitOfWork     = new UnitOfWork();
                    var            root           = $@"\\plgunv_nas\is_docs\ofmis\{staticSettings.Offices.OffcAcr}";
                    if (!Directory.Exists(root))
                    {
                        Directory.CreateDirectory(root);
                    }

                    var files = unitOfWork.FilesRepo.Find(x => x.RefId == item.Id && x.TableName == "Action");

                    if (files == null)
                    {
                        return;
                    }
                    var          path = Path.Combine(root, files.Path + ".png");
                    frmPreviewer frm  = new frmPreviewer(path);
                    frm.ShowDialog();
                }
            }
        }
Beispiel #20
0
        public ResponseModel UpdateMailSettings(MailSettings updObj)
        {
            ResponseModel result = new ResponseModel();

            result = ValidateUpdateMailSettings(updObj);

            if (!result.IsSuccess)
            {
                return(result);
            }

            bool value = _mailRepo.Update(updObj);

            result.IsSuccess = value;

            if (updObj.ApproveSendMailNewUser)
            {
                var sms_ = _smsRepo.GetAll().FirstOrDefault();
                sms_.RequiredIsRegister = false;
                _smsRepo.Update(sms_);
            }

            if (result.IsSuccess)
            {
                result.Message = "Bilgiler başarı ile güncellendi!";
            }
            StaticSettings.ReloadSettings();
            return(result);
        }
Beispiel #21
0
        public void Init()
        {
            try
            {
                if (methodType == MethodType.Edit)
                {
                    Detail();
                    return;
                }
                UnitOfWork     unitOfWork     = new UnitOfWork();
                StaticSettings staticSettings = new StaticSettings();
                var            item           = unitOfWork.APRsRepo.Fetch(x => x.PurchaseRequests.OfficeId == staticSettings.OfficeId).OrderByDescending(x => x.Id).FirstOrDefault();

                this.aPRs = new APRs()
                {
                    PRId         = aPRs.PRId,
                    Date         = DateTime.Now,
                    CreatedBy    = User.UserId,
                    DateCreated  = DateTime.Now,
                    ModifiedBy   = User.UserId,
                    DateModified = DateTime.Now,
                    ControlNo    = IdHelper.OfficeControlNo(item?.ControlNo, staticSettings.OfficeId, "APR", "APRs"),
                    GovernorId   = unitOfWork.Signatories.Find(x => x.Position == "Governor")?.Id,
                    AccountantId = unitOfWork.Signatories.Find(x => x.Position == "Provincial Accountant")?.Id,
                    PGSOId       = unitOfWork.Signatories.Find(x => x.Position == "Provincial General Services Officer")?.Id
                };
                unitOfWork.APRsRepo.Insert(this.aPRs);
                unitOfWork.Save();
                Detail();
            }
            catch (Exception e)
            {
                MessageBox.Show(e.Message, e.Message, MessageBoxButtons.OK, MessageBoxIcon.Error);
            }
        }
        public void Awake()
        {
            var extraInstallers = new List <IInstaller>();

            if (_staticSettings != null)
            // Static settings are needed if creating a SceneCompositionRoot dynamically
            {
                extraInstallers           = _staticSettings.Installers;
                OnlyInjectWhenActive      = _staticSettings.OnlyInjectWhenActive;
                ParentNewObjectsUnderRoot = _staticSettings.ParentNewObjectsUnderRoot;
                _staticSettings           = null;
            }

            // We always want to initialize GlobalCompositionRoot as early as possible
            GlobalCompositionRoot.Instance.EnsureIsInitialized();

            Assert.IsNull(Container);
            Assert.IsNull(RootFacade);

            Log.Debug("Initializing SceneCompositionRoot in scene '{0}'", this.gameObject.scene.name);
            _container = CreateContainer(
                false, GlobalCompositionRoot.Instance.Container, extraInstallers);

            Log.Debug("SceneCompositionRoot: Finished install phase.  Injecting into scene...");
            InjectObjectsInScene();

            Log.Debug("SceneCompositionRoot: Resolving root IFacade...");
            _rootFacade = _container.Resolve <IFacade>();

            DecoratedScenes.Clear();

            Assert.IsNotNull(Container);
            Assert.IsNotNull(RootFacade);
        }
Beispiel #23
0
 void Init()
 {
     try
     {
         UnitOfWork     unitOfWork     = new UnitOfWork(new DTSDb());
         StaticSettings staticSettings = new StaticSettings();
         this.DocumentGridControl.DataSource = new EntityServerModeSource()
         {
             QueryableSource = unitOfWork.DocumentsRepo.Fetch(x => x.OfficeId == staticSettings.OfficeId),
             ElementType     = typeof(Documents)
         };
         this.cboSignatoryRepo.DataSource = new EntityServerModeSource()
         {
             QueryableSource = new UnitOfWork().EmployeesRepo.Fetch()
         };
         this.cboSourceOfficeRepo.DataSource = new EntityServerModeSource()
         {
             QueryableSource = new UnitOfWork().OfficesRepo.Fetch()
         };
         // this.documenty
     }
     catch (Exception ex)
     {
         MessageBox.Show(ex.Message, ex.Message, MessageBoxButtons.OK, MessageBoxIcon.Error);
     }
 }
Beispiel #24
0
        public virtual void btnDelete_Click(object sender, EventArgs e)
        {
            if (MessageBox.Show("Do you want to Delete this?", "Delete", MessageBoxButtons.YesNo, MessageBoxIcon.Question) == DialogResult.No)
            {
                return;
            }
            using (NetworkShareAccesser.Access("PLGUNV_NAS", @"", "pitd.is_user", "Apple_01"))
            {
                StaticSettings staticSettings = new StaticSettings();
                UnitOfWork     unitOfWork     = new UnitOfWork();
                var            root           = $@"\\plgunv_nas\is_docs\ofmis\{staticSettings.Offices.OffcAcr}";
                if (!Directory.Exists(root))
                {
                    Directory.CreateDirectory(root);
                }

                var files = unitOfWork.FilesRepo.Find(x => x.RefId == documentActions.Id && x.TableName == "Action");


                var path = Path.Combine(root, files.Path + ".png");
                File.Delete(path);
                unitOfWork.FilesRepo.Delete(x => x.Id == files.Id);
                unitOfWork.Save();
                Detail();
            }
        }
Beispiel #25
0
        private void Init()
        {
            try
            {
                UnitOfWork     unitOfWork     = new UnitOfWork();
                StaticSettings staticSettings = new StaticSettings();
                cboStaff.Properties.DataSource      = unitOfWork.UsersRepo.Get(x => x.OfficeId == staticSettings.OfficeId);
                cboNotedBy.Properties.DataSource    = unitOfWork.EmployeesRepo.Get(x => x.OfficeId == staticSettings.OfficeId);
                cboReviewedBy.Properties.DataSource =
                    unitOfWork.EmployeesRepo.Get(x => x.OfficeId == staticSettings.OfficeId);
                cboStaff.EditValue = User.UserId;
                if (DateTime.Now.Day <= 15)
                {
                    this.dtDateFrom.EditValue = new DateTime(DateTime.Now.Year, DateTime.Now.Month, 1);
                    this.dtDateTo.EditValue   = new DateTime(DateTime.Now.Year, DateTime.Now.Month, 15);
                }

                if (DateTime.Now.Day > 15)
                {
                    this.dtDateFrom.EditValue = new DateTime(DateTime.Now.Year, DateTime.Now.Month, 16);
                    this.dtDateTo.EditValue   = new DateTime(DateTime.Now.Year, DateTime.Now.Month, DateTime.DaysInMonth(DateTime.Now.Year, DateTime.Now.Month));
                }
            }
            catch (Exception e)
            {
            }
        }
Beispiel #26
0
 public ContractCompleteModel(ApplicationDbContext context, CoreService coreService, SiteContext siteContext, StaticSettings staticSettings)
 {
     DbContext      = context;
     CoreService    = coreService;
     SiteContext    = siteContext;
     StaticSettings = staticSettings;
 }
Beispiel #27
0
        List <StatusSummaryOfFinancialDocumentsVM> PurchaseRequests()
        {
            List <StatusSummaryOfFinancialDocumentsVM> rpt = new List <StatusSummaryOfFinancialDocumentsVM>();

            try
            {
                UnitOfWork     unitOfWork     = new UnitOfWork();
                StaticSettings staticSettings = new StaticSettings();
                foreach (var i in unitOfWork.PurchaseRequestsRepo.Get(x => x.OfficeId == staticSettings.OfficeId && x.Year == staticSettings.Year && x.FT == staticSettings.FT))
                {
                    var action = unitOfWork.DocumentActionsRepo
                                 .Fetch(x => x.RefId == i.Id && x.TableName == "PurchaseRequests").OrderByDescending(x => x.Id)
                                 .FirstOrDefault();
                    rpt.Add(new StatusSummaryOfFinancialDocumentsVM()
                    {
                        FinancialDocumentId = i.Id,
                        ControlNo           = i.ControlNo,
                        Amount          = i.TotalAmount,
                        Description     = i.Description,
                        LastActionDate  = action?.ActionDate,
                        LastActionTaken = action?.ActionTaken,
                        Remarks         = action?.Remarks,
                        DocumentType    = "Purchase Request"
                    });
                }
            }
            catch (Exception ex)
            {
                MessageBox.Show(ex.Message, ex.Message, MessageBoxButtons.OK, MessageBoxIcon.Error);
            }

            return(rpt);
        }
Beispiel #28
0
        private void BtnCreateObR_Click(object sender, EventArgs e)
        {
            try
            {
                UnitOfWork unitOfWork = new UnitOfWork();
                if (this.purchaseOrders.Obligations.Any())
                {
                    if (MessageBox.Show("OBR is already created!,Do you want to create new OBR?", "OBR", MessageBoxButtons.YesNo, MessageBoxIcon.Question) == DialogResult.No)
                    {
                        return;
                    }
                }

                var staticSttings = new StaticSettings();
                var item          = unitOfWork.PurchaseOrdersRepo.Find(x => x.Id == purchaseOrders.Id);
                var ob            = unitOfWork.ObligationsRepo.Fetch(m => m.OfficeId == staticSttings.OfficeId).OrderByDescending(x => x.Id).FirstOrDefault();
                var payee         = unitOfWork.PayeesRepo.Find(x => x.Name == item.Supplier);
                var obr           = new Obligations()
                {
                    ControlNo    = IdHelper.OfficeControlNo(ob?.ControlNo, staticSttings.OfficeId, "ObR", "Obligations"),
                    Year         = staticSttings.Year,
                    Date         = DateTime.Now,
                    Description  = "",
                    OfficeId     = new StaticSettings().OfficeId,
                    PayeeId      = payee?.Id,
                    PayeeAddress = payee?.Address,
                    PayeeOffice  = payee?.Office,
                    FT           = new StaticSettings().FT,
                    ORDetails    = new List <ORDetails>()
                    {
                        new ORDetails()
                        {
                            Amount          = item.TotalAmount,
                            AppropriationId = item.PurchaseRequests.AppropriationId,
                            Particulars     = ""
                        }
                    },
                    CreatedBy = User.UserId,
                    POId      = this.purchaseOrders.Id
                };
                unitOfWork.ObligationsRepo.Insert(obr);
                unitOfWork.Save();
                var main = Application.OpenForms["Main"] as Main;
                var uc   = new OB.ucObligations()
                {
                    Dock = DockStyle.Fill
                };
                main.pnlMain.Controls.Clear();
                main.pnlMain.Controls.Add(uc);
                uc.txtSearch.Text = obr.ControlNo;
                uc.loadObligations.Search(obr.ControlNo);
                uc.loadObligations.EditObR(obr);
                frm.Close();
            }
            catch (Exception exception)
            {
                Console.WriteLine(exception);
                throw;
            }
        }
        public void Init()
        {
            try
            {
                if (methodType == MethodType.Edit)
                {
                    Detail();
                    return;
                }

                UnitOfWork     unitOfWork     = new UnitOfWork();
                StaticSettings staticSettings = new StaticSettings();
                var            id             = unitOfWork.AIReportsRepo.Fetch(x => x.PurchaseRequests.OfficeId == staticSettings.OfficeId)
                                                .OrderByDescending(x => x.Id)?.FirstOrDefault();
                this.aIReports = new AIReports()
                {
                    PRId       = aIReports.PRId,
                    Date       = DateTime.Now,
                    ControlNo  = IdHelper.OfficeControlNo(id?.ControlNo, staticSettings.OfficeId, "APR", "Acceptance"),
                    PreparedBy = User.UserId,
                };
                unitOfWork.AIReportsRepo.Insert(aIReports);
                unitOfWork.Save();
                Detail();
            }
            catch (Exception e)
            {
                MessageBox.Show(e.Message, e.Message, MessageBoxButtons.OK, MessageBoxIcon.Error);
            }
        }
 void Init()
 {
     try
     {
         if (methodType == MethodType.Edit)
         {
             Details(this.documents);
             return;
         }
         UnitOfWork     unitOfWork     = new UnitOfWork(new DTSDb());
         StaticSettings staticSettings = new StaticSettings();
         var            res            = unitOfWork.DocumentsRepo.Fetch().OrderByDescending(x => x.Id).FirstOrDefault();
         this.documents = new Documents()
         {
             Date = DateTime.Now,
             CommunicationType = this.documents.CommunicationType,
             CreatedBy         = User.UserId,
             OfficeId          = staticSettings.OfficeId,
             ControlNo         = IdHelper.OfficeControlNo(res?.ControlNo, staticSettings.OfficeId, "DTS", "Documents"),
         };
         unitOfWork.DocumentsRepo.Insert(documents);
         unitOfWork.Save();
         Details(this.documents);
     }
     catch (Exception ex)
     {
         MessageBox.Show(ex.Message, ex.Message, MessageBoxButtons.OK, MessageBoxIcon.Error);
     }
 }
Beispiel #31
0
 public ReceiptModel(ApplicationDbContext dbContext, CoreService coreService, SiteContext siteContext, StaticSettings staticSettings)
 {
     DbContext      = dbContext;
     CoreService    = coreService;
     SiteContext    = siteContext;
     StaticSettings = staticSettings;
 }
Beispiel #32
0
 public StaticMiddleware(Func<IDictionary<string, object>, Task> next, StaticSettings settings)
     : base(next, settings.Cached, settings.Expires, settings.MaxAge,
         settings.CompressedContentTypes)
 {
     if (settings == null)
         throw new ArgumentNullException("settings");
     sources = settings.Sources;
     if (sources == null || sources.Length == 0)
         throw new ArgumentException("Sources count should be one or more.", "settings");
     indexFiles = ParseIndexFileString(settings.DefaultFile);
     redirectIfFolder = settings.RedirectIfFolderFound;
     include = new FileFilter(settings.Include);
     exclude = new FileFilter(settings.Exclude);
     unixHidden = new FileFilter(allowHidden ? null : @"**\.*");
     allowHidden = settings.AllowHidden;
     expires = settings.Expires;
     maxAge = settings.MaxAge;
 }
Beispiel #33
0
 /// <summary>
 /// Creates settings from the path and static settings
 /// </summary>
 /// <param name="path">Path</param>
 /// <param name="settings">Static settings</param>
 public Settings(string path, StaticSettings settings)
 {
     this.path = path;
     val = settings;
 }
Beispiel #34
0
 /// <summary>
 /// Maps the StaticMiddleware to the pipeline with custom path
 /// </summary>
 /// <param name="appBuilder">App builder</param>
 /// <param name="pathMatch">Custom path</param>
 /// <param name="settings">Static settings</param>
 /// <returns>App builder</returns>
 public static IAppBuilder MapStatic(this IAppBuilder appBuilder, string pathMatch, StaticSettings settings)
 {
     return appBuilder.Map(pathMatch, b => b.UseStatic(settings));
 }
        public static SceneCompositionRoot InstantiateComponent(
            GameObject gameObject, StaticSettings settings)
        {
            Assert.IsNull(_staticSettings);
            _staticSettings = settings;

            var result = gameObject.AddComponent<SceneCompositionRoot>();
            Assert.IsNull(_staticSettings);
            return result;
        }
        // These methods can be used for cases where you need to create the SceneCompositionRoot entirely in code
        // Necessary because the Awake() method is called immediately after InstantiateComponent<SceneCompositionRoot>
        // so there's no other way to add installers to it
        public static SceneCompositionRoot Instantiate(
            GameObject parent, StaticSettings settings)
        {
            var gameObject = new GameObject();

            if (parent != null)
            {
                gameObject.transform.SetParent(parent.transform, false);
            }

            return InstantiateComponent(gameObject, settings);
        }
Beispiel #37
0
 /// <summary>
 /// Adds the StaticMiddleware to the pipeline
 /// </summary>
 /// <param name="appBuilder">App builder</param>
 /// <param name="settings">Static settings</param>
 /// <returns>App builder</returns>
 public static IAppBuilder UseStatic(this IAppBuilder appBuilder, StaticSettings settings)
 {
     return appBuilder.Use(typeof (StaticMiddleware), settings);
 }