Пример #1
0
        public void SaveOrUpdateBidAnalysisRequest()
        {
            BidAnalysisRequest BidAnalysisRequest = CurrentBidAnalysisRequest;

            BidAnalysisRequest.PurchaseRequest = _controller.GetPurchaseRequest(View.GetPurchaseRequestId);
            BidAnalysisRequest.RequestNo       = View.GetRequestNo;
            BidAnalysisRequest.RequestDate     = Convert.ToDateTime(DateTime.Today.ToShortDateString());
            BidAnalysisRequest.AnalyzedDate    = Convert.ToDateTime(View.GetAnalysedDate.ToShortDateString());
            //  BidAnalysisRequest.Neededfor = View.GetNeededFor;
            BidAnalysisRequest.SpecialNeed = View.GetSpecialNeed;


            //  BidAnalysisRequest.Supplier.Id=View.GetSupplierId;
            BidAnalysisRequest.ReasonforSelection = View.GetReasonForSelection;
            //   BidAnalysisRequest.SelectedBy = View.GetSelectedBy;

            BidAnalysisRequest.ProgressStatus = ProgressStatus.InProgress.ToString();
            if (View.GetProjectId != 0)
            {
                BidAnalysisRequest.Project = _settingController.GetProject(View.GetProjectId);
            }
            if (View.GetGrantId != 0)
            {
                BidAnalysisRequest.Grant = _settingController.GetGrant(View.GetGrantId);
            }
            BidAnalysisRequest.AppUser = _adminController.GetUser(CurrentUser().Id);

            decimal price = 0;

            foreach (Bidder bider in CurrentBidAnalysisRequest.Bidders)
            {
                if (CurrentBidAnalysisRequest.GetBidderbyRank().Rank == 1)
                {
                    foreach (BidderItemDetail biditemdet in bider.BidderItemDetails)
                    {
                        price = price + biditemdet.TotalCost;
                    }
                }
                BidAnalysisRequest.TotalPrice = price;
                break;
            }

            SaveBidAnalysisRequestStatus();
            GetCurrentApprover();

            _controller.SaveOrUpdateEntity(BidAnalysisRequest);
            _controller.CurrentObject = null;
            if (CurrentBidAnalysisRequest.BidAnalysisRequestStatuses.Count == 0 && CurrentBidAnalysisRequest.GetBidderbyRank().Rank == 1)
            {
                foreach (Bidder bider in CurrentBidAnalysisRequest.Bidders)
                {
                    foreach (BidderItemDetail detail in bider.BidderItemDetails)
                    {
                        Totalamount = Totalamount + detail.TotalCost;
                    }
                }
            }
        }
        public void SaveOrUpdateTARequest()
        {
            TravelAdvanceRequest TravelAdvanceRequest = CurrentTravelAdvanceRequest;

            TravelAdvanceRequest.TravelAdvanceNo = View.GetRequestNo;
            TravelAdvanceRequest.RequestDate     = View.GetRequestDate;
            TravelAdvanceRequest.VisitingTeam    = View.GetVisitingTeam;
            TravelAdvanceRequest.PurposeOfTravel = View.GetPurposeOfTravel;
            TravelAdvanceRequest.Comments        = View.GetComments;
            TravelAdvanceRequest.ProgressStatus  = ProgressStatus.InProgress.ToString();
            TravelAdvanceRequest.ExportStatus    = "Not Exported";
            TravelAdvanceRequest.AppUser         = _adminController.GetUser(CurrentUser().Id);

            if (View.GetProjectId != 0)
            {
                TravelAdvanceRequest.Project = _settingController.GetProject(View.GetProjectId);
            }
            if (View.GetGrantId != 0)
            {
                TravelAdvanceRequest.Grant = _settingController.GetGrant(View.GetGrantId);
            }

            if (CurrentTravelAdvanceRequest.TravelAdvanceRequestStatuses.Count == 0)
            {
                SaveTravelAdvanceRequestStatus();
            }
            GetCurrentApprover();

            _controller.SaveOrUpdateEntity(TravelAdvanceRequest);
            _controller.CurrentObject = null;
        }
Пример #3
0
        public void SaveOrUpdateVehicleRequest()
        {
            VehicleRequest VehicleRequest = CurrentVehicleRequest;

            VehicleRequest.RequestNo     = View.GetRequestNo;
            VehicleRequest.RequestDate   = Convert.ToDateTime(DateTime.Today.ToShortDateString());
            VehicleRequest.DepartureDate = View.GetDepartureDate;
            VehicleRequest.ReturningDate = View.GetReturningDate;
            VehicleRequest.DepartureTime = View.GetDepartureTime;

            VehicleRequest.PurposeOfTravel = View.GetPurposeOfTravel;
            VehicleRequest.Destination     = View.GetDestination;
            VehicleRequest.Comment         = View.GetComment;
            VehicleRequest.NoOfPassengers  = View.GetNoOfPassengers;
            VehicleRequest.ProgressStatus  = ProgressStatus.InProgress.ToString();
            if (View.GetProjectId != 0)
            {
                VehicleRequest.Project = _settingController.GetProject(View.GetProjectId);
            }
            if (View.GetGrantId != 0)
            {
                VehicleRequest.Grant = _settingController.GetGrant(View.GetGrantId);
            }
            VehicleRequest.AppUser = _adminController.GetUser(CurrentUser().Id);

            if (CurrentVehicleRequest.VehicleRequestStatuses.Count == 0)
            {
                SaveVehicleRequestStatus();
            }
            GetCurrentApprover();

            _controller.SaveOrUpdateEntity(VehicleRequest);
            _controller.CurrentObject = null;
        }
Пример #4
0
        public void SaveOrUpdateReceive()
        {
            Receive receive = CurrentReceive;

            if (receive.Id <= 0)
            {
                receive.ReceiveNo = View.GetReceiveNo;
            }
            receive.ReceiveDate = Convert.ToDateTime(DateTime.Today.ToShortDateString());
            receive.DeliveredBy = View.GetDeliveredBy;
            receive.InvoiceNo   = View.GetInvoiceNo;
            receive.Program     = _settingController.GetProgram(View.GetProgram);
            receive.Project     = _settingController.GetProject(View.GetProject);
            receive.Grant       = _settingController.GetGrant(View.GetGrant);
            receive.Receiver    = _adminController.GetUser(CurrentUser().Id).Id;
            receive.Supplier    = _settingController.GetSupplier(View.GetSupplier);

            foreach (ReceiveDetail recDet in CurrentReceive.ReceiveDetails)
            {
                if (recDet.Item.ItemType == "Fixed Asset")
                {
                    for (int i = 1; i <= recDet.Quantity; i++)
                    {
                        FixedAsset fa = new FixedAsset();
                        fa.Item        = recDet.Item;
                        fa.ReceiveDate = CurrentReceive.ReceiveDate;
                        fa.Supplier    = CurrentReceive.Supplier;
                        fa.Store       = recDet.Store;
                        fa.Section     = recDet.Section;
                        fa.Shelf       = recDet.Shelf;
                        fa.ReceiveNo   = CurrentReceive.ReceiveNo;
                        fa.Custodian   = "Store";
                        fa.UnitCost    = recDet.UnitCost;
                        fa.AssetStatus = "Received";

                        FixedAssetHistory fah = new FixedAssetHistory();
                        fah.Custodian       = "Store";
                        fah.Operation       = "Receive";
                        fah.TransactionDate = DateTime.Now;

                        fa.FixedAssetHistories.Add(fah);

                        _controller.SaveOrUpdateEntity(fa);
                    }
                }
            }

            _controller.SaveOrUpdateEntity(receive);
        }
        public void SaveOrUpdateSoleVendorRequest()
        {
            SoleVendorRequest soleVendorRequest = CurrentSoleVendorRequest;

            soleVendorRequest.RequestNo              = View.GetRequestNo;
            soleVendorRequest.RequestDate            = Convert.ToDateTime(DateTime.Today);
            soleVendorRequest.ContactPersonNumber    = View.GetContactPersonNumber;
            soleVendorRequest.ProposedPurchasedPrice = View.GetProposedPurchasedPrice;
            //  if (View.GetProposedSupplier != 0)
            soleVendorRequest.Supplier = _settingController.GetSupplier(View.GetProposedSupplier);
            soleVendorRequest.SoleSourceJustificationPreparedBy = View.GetSoleSourceJustificationPreparedBy;
            soleVendorRequest.SoleVendorJustificationType       = View.GetSoleVendorJustificationType;
            soleVendorRequest.Comment        = View.GetComment;
            soleVendorRequest.ProgressStatus = ProgressStatus.InProgress.ToString();
            if (View.GetProjectId != 0)
            {
                soleVendorRequest.Project = _settingController.GetProject(View.GetProjectId);
            }
            if (View.GetGrantId != 0)
            {
                soleVendorRequest.Grant = _settingController.GetGrant(View.GetGrantId);
            }
            //_settingController.GetGrant(View.GetGrantId);
            soleVendorRequest.AppUser = _adminController.GetUser(CurrentUser().Id);

            if (CurrentSoleVendorRequest.SoleVendorRequestStatuses.Count == 0)
            {
                SaveSoleVendorRequestStatus();
            }
            GetCurrentApprover();

            soleVendorRequest.PurchaseRequest = _controller.GetPurchaseRequest(View.GetPurchaseRequestId);

            _controller.SaveOrUpdateEntity(soleVendorRequest);
            _controller.CurrentObject = null;
        }
Пример #6
0
 public Grant GetGrant(int GrantId)
 {
     return(_settingController.GetGrant(GrantId));
 }
Пример #7
0
 public Grant GetGrant(int GrantId)
 {
     return(_controller.GetGrant(GrantId));
 }
 public Grant GetGrantprojectId(int projectId)
 {
     return(_settingController.GetGrant(projectId));
 }