public ActionResult Create([Bind(Include = "EventLog, Number, Message, StackTrace")] EventLogError eventLogError)
        {
            Db db = new Db(DbServices.ConnectionString);

            if (ModelState.IsValid)
            {
                try
                {
                    EventLogErrorServices.Insert(CurrentUser.Id, eventLogError, db);
                    TempData["Success"] = ResourceServices.GetString(Cf.Data.Resources.ResourceBase.Culture, "UI", "InsertConfirmed");
                    return(RedirectToAction("Index"));
                }
                catch (CfException cfex)
                {
                    TempData["Failure"] = cfex.ErrorDefinition.LocalizedMessage;
                }
                catch (Exception ex)
                {
                    TempData["Failure"] = ex.Message;
                }
            }

            ViewBag.EventLogList = new SelectList(EventLogServices.List(db), "Id", "Name");
            return(View(eventLogError));
        }
Example #2
0
        public ActionResult Create([Bind(Include = "Id, InstallmentDecreaseOrder, Employee, Department, DecreaseAmount, NewInstallmentAmount, Notes")] InstallmentDecrease installmentDecrease)
        {
            Db db = new Db(DbServices.ConnectionString);

            if (ModelState.IsValid)
            {
                try
                {
                    InstallmentDecreaseServices.Insert(CurrentUser.Id, installmentDecrease, db);
                    TempData["Success"] = ResourceServices.GetString(Cf.Data.Resources.ResourceBase.Culture, "UI", "InsertConfirmed");
                    return(RedirectToAction("Index"));
                }
                catch (CfException cfex)
                {
                    TempData["Failure"] = cfex.ErrorDefinition.LocalizedMessage;
                }
                catch (Exception ex)
                {
                    TempData["Failure"] = ex.Message;
                }
            }

            ViewBag.EmployeeList = new SelectList(EmployeeServices.List(db), "Id", "FirstName");
            ViewBag.InstallmentDecreaseOrderList = new SelectList(InstallmentDecreaseOrderServices.List(db), "Id", "CersNumber");
            ViewBag.DepartmentList = new SelectList(DepartmentServices.List(db), "Id", "Name");
            return(View(installmentDecrease));
        }
        /// <summary>
        ///
        /// </summary>
        /// <param name="id"></param>
        /// <returns></returns>
        public ActionResult Details(Nullable <byte> id)
        {
            if (id == null)
            {
                return(new HttpStatusCodeResult(HttpStatusCode.BadRequest));
            }
            InsuranceTypeVwViewModel insuranceTypeVwViewModel = new InsuranceTypeVwViewModel();

            Db db = new Db(DbServices.ConnectionString);

            // insuranceTypeVwViewModel.Instance = InsuranceTypeVwServices.Get(id.Value, db);
            insuranceTypeVwViewModel.Instance = InsuranceTypeVwServices.GetChildren(id.Value, db);
            if (insuranceTypeVwViewModel.Instance == null)
            {
                return(HttpNotFound());
            }


            @ViewBag.HealthLoanDecisionFirstPaymentVwTitle = ResourceServices.GetString(Cf.Data.Resources.ResourceBase.Culture, "HealthLoanDecisionFirstPayment", "ModuleNamePlural");
            // insuranceTypeVwViewModel.HealthLoanDecisionFirstPaymentVwViewModel.List = HealthLoanDecisionFirstPaymentVwServices.GetByInsuranceTypeId(id.Value, db);
            insuranceTypeVwViewModel.HealthLoanDecisionFirstPaymentVwViewModel.List = insuranceTypeVwViewModel.Instance.HealthLoanDecisionFirstPaymentVwList;


            return(View(insuranceTypeVwViewModel));
        }
Example #4
0
        public ActionResult Create([Bind(Include = "Id, Employee, Month, Department, SubscriptionType, Amount, Notes, IsFixed")] Subscription subscription)
        {
            Db db = new Db(DbServices.ConnectionString);

            if (ModelState.IsValid)
            {
                try
                {
                    SubscriptionServices.Insert(CurrentUser.Id, subscription, db);
                    TempData["Success"] = ResourceServices.GetString(Cf.Data.Resources.ResourceBase.Culture, "UI", "InsertConfirmed");
                    return(RedirectToAction("Index"));
                }
                catch (CfException cfex)
                {
                    TempData["Failure"] = cfex.ErrorDefinition.LocalizedMessage;
                }
                catch (Exception ex)
                {
                    TempData["Failure"] = ex.Message;
                }
            }

            ViewBag.DepartmentList       = new SelectList(DepartmentServices.List(db), "Id", "Name");
            ViewBag.EmployeeList         = new SelectList(EmployeeServices.List(db), "Id", "FirstName");
            ViewBag.SubscriptionTypeList = new SelectList(SubscriptionTypeServices.List(db), "Id", "Name");
            return(View(subscription));
        }
        public ActionResult Create([Bind(Include = "Guarantor, GrossSalary, DeductionsAmount, NetSalary, ExceptionalIncome")] GuarantorStatement guarantorStatement)
        {
            Db db = new Db(DbServices.ConnectionString);

            if (ModelState.IsValid)
            {
                try
                {
                    GuarantorStatementServices.Insert(CurrentUser.Id, guarantorStatement, db);
                    TempData["Success"] = ResourceServices.GetString(Cf.Data.Resources.ResourceBase.Culture, "UI", "InsertConfirmed");
                    return(RedirectToAction("Index"));
                }
                catch (CfException cfex)
                {
                    TempData["Failure"] = cfex.ErrorDefinition.LocalizedMessage;
                }
                catch (Exception ex)
                {
                    TempData["Failure"] = ex.Message;
                }
            }

            ViewBag.GuarantorList = new SelectList(GuarantorServices.List(db), "Id", "Notes");
            return(View(guarantorStatement));
        }
        /// <summary>
        ///
        /// </summary>
        /// <param name="id"></param>
        /// <returns></returns>
        public ActionResult Details(Nullable <int> id)
        {
            if (id == null)
            {
                return(new HttpStatusCodeResult(HttpStatusCode.BadRequest));
            }
            SalaryWorkPlaceVwViewModel salaryWorkPlaceVwViewModel = new SalaryWorkPlaceVwViewModel();

            Db db = new Db(DbServices.ConnectionString);

            // salaryWorkPlaceVwViewModel.Instance = SalaryWorkPlaceVwServices.Get(id.Value, db);
            salaryWorkPlaceVwViewModel.Instance = SalaryWorkPlaceVwServices.GetChildren(id.Value, db);
            if (salaryWorkPlaceVwViewModel.Instance == null)
            {
                return(HttpNotFound());
            }


            @ViewBag.DepartmentVwTitle = ResourceServices.GetString(Cf.Data.Resources.ResourceBase.Culture, "Department", "ModuleNamePlural");
            // salaryWorkPlaceVwViewModel.DepartmentVwViewModel.List = DepartmentVwServices.GetBySalaryWorkPlaceId(id.Value, db);
            salaryWorkPlaceVwViewModel.DepartmentVwViewModel.List = salaryWorkPlaceVwViewModel.Instance.DepartmentVwList;


            return(View(salaryWorkPlaceVwViewModel));
        }
        public ActionResult Create([Bind(Include = "Id, GrantPaymentOrder, SubNumber, Grant, Amount, Notes")] GrantPayment grantPayment)
        {
            Db db = new Db(DbServices.ConnectionString);

            if (ModelState.IsValid)
            {
                try
                {
                    GrantPaymentServices.Insert(CurrentUser.Id, grantPayment, db);
                    TempData["Success"] = ResourceServices.GetString(Cf.Data.Resources.ResourceBase.Culture, "UI", "InsertConfirmed");
                    return(RedirectToAction("Index"));
                }
                catch (CfException cfex)
                {
                    TempData["Failure"] = cfex.ErrorDefinition.LocalizedMessage;
                }
                catch (Exception ex)
                {
                    TempData["Failure"] = ex.Message;
                }
            }

            ViewBag.GrantList             = new SelectList(GrantServices.List(db), "Product", "Name");
            ViewBag.GrantPaymentOrderList = new SelectList(GrantPaymentOrderServices.List(db), "Id", "Notes");
            return(View(grantPayment));
        }
        public ActionResult Create([Bind(Include = "Id, RefundableProduct, SubNumber, Employee, GuarantorStatus, Notes")] Guarantor guarantor)
        {
            Db db = new Db(DbServices.ConnectionString);

            if (ModelState.IsValid)
            {
                try
                {
                    GuarantorServices.Insert(CurrentUser.Id, guarantor, db);
                    TempData["Success"] = ResourceServices.GetString(Cf.Data.Resources.ResourceBase.Culture, "UI", "InsertConfirmed");
                    return(RedirectToAction("Index"));
                }
                catch (CfException cfex)
                {
                    TempData["Failure"] = cfex.ErrorDefinition.LocalizedMessage;
                }
                catch (Exception ex)
                {
                    TempData["Failure"] = ex.Message;
                }
            }

            ViewBag.EmployeeList          = new SelectList(EmployeeServices.List(db), "Id", "FirstName");
            ViewBag.GuarantorStatusList   = new SelectList(GuarantorStatusServices.List(db), "Id", "Name");
            ViewBag.RefundableProductList = new SelectList(RefundableProductServices.List(db), "Product", "Name");
            return(View(guarantor));
        }
Example #9
0
        /// <summary>
        ///
        /// </summary>
        /// <param name="id"></param>
        /// <returns></returns>
        public ActionResult Details(Nullable <int> product)
        {
            if (product == null)
            {
                return(new HttpStatusCodeResult(HttpStatusCode.BadRequest));
            }
            RefundableProductVwViewModel refundableProductVwViewModel = new RefundableProductVwViewModel();

            Db db = new Db(DbServices.ConnectionString);

            // refundableProductVwViewModel.Instance = RefundableProductVwServices.Get(product.Value, db);
            refundableProductVwViewModel.Instance = RefundableProductVwServices.GetChildren(product.Value, db);
            if (refundableProductVwViewModel.Instance == null)
            {
                return(HttpNotFound());
            }


            @ViewBag.GuarantorVwTitle = ResourceServices.GetString(Cf.Data.Resources.ResourceBase.Culture, "Guarantor", "ModuleNamePlural");
            // refundableProductVwViewModel.GuarantorVwViewModel.List = GuarantorVwServices.GetByRefundableProductId(product.Value, db);
            refundableProductVwViewModel.GuarantorVwViewModel.List = refundableProductVwViewModel.Instance.GuarantorVwList;


            @ViewBag.InstallmentVwTitle = ResourceServices.GetString(Cf.Data.Resources.ResourceBase.Culture, "Installment", "ModuleNamePlural");
            // refundableProductVwViewModel.InstallmentVwViewModel.List = InstallmentVwServices.GetByRefundableProductId(product.Value, db);
            refundableProductVwViewModel.InstallmentVwViewModel.List = refundableProductVwViewModel.Instance.InstallmentVwList;


            return(View(refundableProductVwViewModel));
        }
Example #10
0
        public ActionResult Create([Bind(Include = "Id, Number, Year, Date, DeductionStartDate, CersNumber, CersDate, Notes, LoanDecisionType, PaymentNumber, PaymentDate, IsPaidFromSalary, Reason, AdditionalClause, AdditionalIntroduction")] LoanDecision loanDecision)
        {
            Db db = new Db(DbServices.ConnectionString);

            if (ModelState.IsValid)
            {
                try
                {
                    LoanDecisionServices.Insert(CurrentUser.Id, loanDecision, db);
                    TempData["Success"] = ResourceServices.GetString(Cf.Data.Resources.ResourceBase.Culture, "UI", "InsertConfirmed");
                    return(RedirectToAction("Index"));
                }
                catch (CfException cfex)
                {
                    TempData["Failure"] = cfex.ErrorDefinition.LocalizedMessage;
                }
                catch (Exception ex)
                {
                    TempData["Failure"] = ex.Message;
                }
            }

            ViewBag.LoanDecisionTypeList = new SelectList(LoanDecisionTypeServices.List(db), "Id", "Name");
            return(View(loanDecision));
        }
Example #11
0
        /// <summary>
        ///
        /// </summary>
        /// <param name="id"></param>
        /// <returns></returns>
        public ActionResult Details(Nullable <int> id)
        {
            if (id == null)
            {
                return(new HttpStatusCodeResult(HttpStatusCode.BadRequest));
            }
            GuarantorVwViewModel guarantorVwViewModel = new GuarantorVwViewModel();

            Db db = new Db(DbServices.ConnectionString);

            // guarantorVwViewModel.Instance = GuarantorVwServices.Get(id.Value, db);
            guarantorVwViewModel.Instance = GuarantorVwServices.GetChildren(id.Value, db);
            if (guarantorVwViewModel.Instance == null)
            {
                return(HttpNotFound());
            }


            @ViewBag.GuarantorStatementVwTitle = ResourceServices.GetString(Cf.Data.Resources.ResourceBase.Culture, "GuarantorStatement", "ModuleName");
            if (guarantorVwViewModel.Instance.GuarantorStatementVw != null)
            {
                guarantorVwViewModel.GuarantorStatementVwViewModel.List.Add(guarantorVwViewModel.Instance.GuarantorStatementVw);
            }
            // guarantorVwViewModel.GuarantorStatementVwViewModel.Instance = guarantorVwViewModel.Instance.GuarantorStatementVw;

            return(View(guarantorVwViewModel));
        }
Example #12
0
        /// <summary>
        ///
        /// </summary>
        /// <param name="id"></param>
        /// <returns></returns>
        public ActionResult Details(Nullable <int> id)
        {
            if (id == null)
            {
                return(new HttpStatusCodeResult(HttpStatusCode.BadRequest));
            }
            LoanDecisionVwViewModel loanDecisionVwViewModel = new LoanDecisionVwViewModel();

            Db db = new Db(DbServices.ConnectionString);

            // loanDecisionVwViewModel.Instance = LoanDecisionVwServices.Get(id.Value, db);
            loanDecisionVwViewModel.Instance = LoanDecisionVwServices.GetChildren(id.Value, db);
            if (loanDecisionVwViewModel.Instance == null)
            {
                return(HttpNotFound());
            }


            @ViewBag.LoanVwTitle = ResourceServices.GetString(Cf.Data.Resources.ResourceBase.Culture, "Loan", "ModuleNamePlural");
            // loanDecisionVwViewModel.LoanVwViewModel.List = LoanVwServices.GetByLoanDecisionId(id.Value, db);
            loanDecisionVwViewModel.LoanVwViewModel.List = loanDecisionVwViewModel.Instance.LoanVwList;


            @ViewBag.OutgoingLoanVwTitle = ResourceServices.GetString(Cf.Data.Resources.ResourceBase.Culture, "OutgoingLoan", "ModuleNamePlural");
            // loanDecisionVwViewModel.OutgoingLoanVwViewModel.List = OutgoingLoanVwServices.GetByLoanDecisionId(id.Value, db);
            loanDecisionVwViewModel.OutgoingLoanVwViewModel.List = loanDecisionVwViewModel.Instance.OutgoingLoanVwList;


            return(View(loanDecisionVwViewModel));
        }
        public ActionResult Edit([Bind(Include = "Id, Availability, FromYear, MaxAmount")] AvailabilityCeiling availabilityCeiling)
        {
            Db db = new Db(DbServices.ConnectionString);

            if (ModelState.IsValid)
            {
                try
                {
                    AvailabilityCeilingServices.Update(CurrentUser.Id, availabilityCeiling, db);
                    TempData["Success"] = ResourceServices.GetString(Cf.Data.Resources.ResourceBase.Culture, "UI", "UpdateConfirmed");
                    return(RedirectToAction("Index"));
                }
                catch (CfException cfex)
                {
                    TempData["Failure"] = cfex.ErrorDefinition.LocalizedMessage;
                }
                catch (Exception ex)
                {
                    TempData["Failure"] = ex.Message;
                }
            }

            ViewBag.AvailabilityList = new SelectList(AvailabilityServices.List(db), "Id", "Name", availabilityCeiling.Availability);
            return(View(availabilityCeiling));
        }
Example #14
0
        public ActionResult Edit([Bind(Include = "Product, Date, Amount, Attachment, Cost, RequestStatus, BypassStatus, Notes")] Request request)
        {
            Db db = new Db(DbServices.ConnectionString);

            if (ModelState.IsValid)
            {
                try
                {
                    RequestServices.Update(CurrentUser.Id, request, db);
                    TempData["Success"] = ResourceServices.GetString(Cf.Data.Resources.ResourceBase.Culture, "UI", "UpdateConfirmed");
                    return(RedirectToAction("Index"));
                }
                catch (CfException cfex)
                {
                    TempData["Failure"] = cfex.ErrorDefinition.LocalizedMessage;
                }
                catch (Exception ex)
                {
                    TempData["Failure"] = ex.Message;
                }
            }

            ViewBag.BypassStatusList  = new SelectList(BypassStatusServices.List(db), "Id", "Name", request.BypassStatus);
            ViewBag.ProductList       = new SelectList(ProductServices.List(db), "Id", "Notes", request.Product);
            ViewBag.RequestStatusList = new SelectList(RequestStatusServices.List(db), "Id", "Name", request.RequestStatus);
            return(View(request));
        }
        /// <summary>
        ///
        /// </summary>
        /// <param name="id"></param>
        /// <returns></returns>
        public ActionResult Details(Nullable <int> request)
        {
            if (request == null)
            {
                return(new HttpStatusCodeResult(HttpStatusCode.BadRequest));
            }
            GrantRequestVwViewModel grantRequestVwViewModel = new GrantRequestVwViewModel();

            Db db = new Db(DbServices.ConnectionString);

            // grantRequestVwViewModel.Instance = GrantRequestVwServices.Get(request.Value, db);
            grantRequestVwViewModel.Instance = GrantRequestVwServices.GetChildren(request.Value, db);
            if (grantRequestVwViewModel.Instance == null)
            {
                return(HttpNotFound());
            }


            @ViewBag.ServiceEndGrantRequestVwTitle = ResourceServices.GetString(Cf.Data.Resources.ResourceBase.Culture, "ServiceEndGrantRequest", "ModuleName");
            if (grantRequestVwViewModel.Instance.ServiceEndGrantRequestVw != null)
            {
                grantRequestVwViewModel.ServiceEndGrantRequestVwViewModel.List.Add(grantRequestVwViewModel.Instance.ServiceEndGrantRequestVw);
            }
            // grantRequestVwViewModel.ServiceEndGrantRequestVwViewModel.Instance = grantRequestVwViewModel.Instance.ServiceEndGrantRequestVw;

            return(View(grantRequestVwViewModel));
        }
Example #16
0
        public ActionResult Create([Bind(Include = "Product, PaymentPeriod, Installment, NetAmount, ProfitAmount, SyrianPoundRounds")] RefundableProduct refundableProduct)
        {
            Db db = new Db(DbServices.ConnectionString);

            if (ModelState.IsValid)
            {
                try
                {
                    RefundableProductServices.Insert(CurrentUser.Id, refundableProduct, db);
                    TempData["Success"] = ResourceServices.GetString(Cf.Data.Resources.ResourceBase.Culture, "UI", "InsertConfirmed");
                    return(RedirectToAction("Index"));
                }
                catch (CfException cfex)
                {
                    TempData["Failure"] = cfex.ErrorDefinition.LocalizedMessage;
                }
                catch (Exception ex)
                {
                    TempData["Failure"] = ex.Message;
                }
            }

            ViewBag.ProductList = new SelectList(ProductServices.List(db), "Id", "Notes");
            return(View(refundableProduct));
        }
        public ActionResult Create([Bind(Include = "Request, GrantType, Description, Amount, Notes, EventDate, IsFromOtherBranch")] GrantRequest grantRequest)
        {
            Db db = new Db(DbServices.ConnectionString);

            if (ModelState.IsValid)
            {
                try
                {
                    GrantRequestServices.Insert(CurrentUser.Id, grantRequest, db);
                    TempData["Success"] = ResourceServices.GetString(Cf.Data.Resources.ResourceBase.Culture, "UI", "InsertConfirmed");
                    return(RedirectToAction("Index"));
                }
                catch (CfException cfex)
                {
                    TempData["Failure"] = cfex.ErrorDefinition.LocalizedMessage;
                }
                catch (Exception ex)
                {
                    TempData["Failure"] = ex.Message;
                }
            }

            ViewBag.GrantTypeList = new SelectList(GrantTypeServices.List(db), "Id", "Name");
            ViewBag.RequestList   = new SelectList(RequestServices.List(db), "Product", "Attachment");
            return(View(grantRequest));
        }
Example #18
0
        public ActionResult Create([Bind(Include = "Employee, Extension, HomePhone, MobilePhone, Address")] Profile profile)
        {
            Db db = new Db(DbServices.ConnectionString);

            if (ModelState.IsValid)
            {
                try
                {
                    ProfileServices.Insert(CurrentUser.Id, profile, db);
                    TempData["Success"] = ResourceServices.GetString(Cf.Data.Resources.ResourceBase.Culture, "UI", "InsertConfirmed");
                    return(RedirectToAction("Index"));
                }
                catch (CfException cfex)
                {
                    TempData["Failure"] = cfex.ErrorDefinition.LocalizedMessage;
                }
                catch (Exception ex)
                {
                    TempData["Failure"] = ex.Message;
                }
            }

            ViewBag.EmployeeList = new SelectList(EmployeeServices.List(db), "Id", "FirstName");
            return(View(profile));
        }
        public ActionResult Create([Bind(Include = "Id, Name, MainWorkPlace")] SalaryWorkPlace salaryWorkPlace)
        {
            Db db = new Db(DbServices.ConnectionString);

            if (ModelState.IsValid)
            {
                try
                {
                    SalaryWorkPlaceServices.Insert(CurrentUser.Id, salaryWorkPlace, db);
                    TempData["Success"] = ResourceServices.GetString(Cf.Data.Resources.ResourceBase.Culture, "UI", "InsertConfirmed");
                    return(RedirectToAction("Index"));
                }
                catch (CfException cfex)
                {
                    TempData["Failure"] = cfex.ErrorDefinition.LocalizedMessage;
                }
                catch (Exception ex)
                {
                    TempData["Failure"] = ex.Message;
                }
            }

            ViewBag.MainWorkPlaceList = new SelectList(MainWorkPlaceServices.List(db), "Id", "Name");
            return(View(salaryWorkPlace));
        }
Example #20
0
        /// <summary>
        ///
        /// </summary>
        /// <param name="id"></param>
        /// <returns></returns>
        public ActionResult Details(Nullable <short> id)
        {
            if (id == null)
            {
                return(new HttpStatusCodeResult(HttpStatusCode.BadRequest));
            }
            AvailabilityVwViewModel availabilityVwViewModel = new AvailabilityVwViewModel();

            Db db = new Db(DbServices.ConnectionString);

            // availabilityVwViewModel.Instance = AvailabilityVwServices.Get(id.Value, db);
            availabilityVwViewModel.Instance = AvailabilityVwServices.GetChildren(id.Value, db);
            if (availabilityVwViewModel.Instance == null)
            {
                return(HttpNotFound());
            }


            @ViewBag.AvailabilityCeilingVwTitle = ResourceServices.GetString(Cf.Data.Resources.ResourceBase.Culture, "AvailabilityCeiling", "ModuleNamePlural");
            // availabilityVwViewModel.AvailabilityCeilingVwViewModel.List = AvailabilityCeilingVwServices.GetByAvailabilityId(id.Value, db);
            availabilityVwViewModel.AvailabilityCeilingVwViewModel.List = availabilityVwViewModel.Instance.AvailabilityCeilingVwList;


            @ViewBag.ProductTypeAvailabilityVwTitle = ResourceServices.GetString(Cf.Data.Resources.ResourceBase.Culture, "ProductTypeAvailability", "ModuleNamePlural");
            // availabilityVwViewModel.ProductTypeAvailabilityVwViewModel.List = ProductTypeAvailabilityVwServices.GetByAvailabilityId(id.Value, db);
            availabilityVwViewModel.ProductTypeAvailabilityVwViewModel.List = availabilityVwViewModel.Instance.ProductTypeAvailabilityVwList;


            return(View(availabilityVwViewModel));
        }
        public ActionResult Create([Bind(Include = "GrantRequest, AverageIncome, GrantPercentage, ServiceInMonthes")] ServiceEndGrantRequest serviceEndGrantRequest)
        {
            Db db = new Db(DbServices.ConnectionString);

            if (ModelState.IsValid)
            {
                try
                {
                    ServiceEndGrantRequestServices.Insert(CurrentUser.Id, serviceEndGrantRequest, db);
                    TempData["Success"] = ResourceServices.GetString(Cf.Data.Resources.ResourceBase.Culture, "UI", "InsertConfirmed");
                    return(RedirectToAction("Index"));
                }
                catch (CfException cfex)
                {
                    TempData["Failure"] = cfex.ErrorDefinition.LocalizedMessage;
                }
                catch (Exception ex)
                {
                    TempData["Failure"] = ex.Message;
                }
            }

            ViewBag.GrantRequestList = new SelectList(GrantRequestServices.List(db), "Request", "Description");
            return(View(serviceEndGrantRequest));
        }
Example #22
0
        public ActionResult Create([Bind(Include = "Id, Debt, Employee, IsActive, Notes")] Warrant warrant)
        {
            Db db = new Db(DbServices.ConnectionString);

            if (ModelState.IsValid)
            {
                try
                {
                    WarrantServices.Insert(CurrentUser.Id, warrant, db);
                    TempData["Success"] = ResourceServices.GetString(Cf.Data.Resources.ResourceBase.Culture, "UI", "InsertConfirmed");
                    return(RedirectToAction("Index"));
                }
                catch (CfException cfex)
                {
                    TempData["Failure"] = cfex.ErrorDefinition.LocalizedMessage;
                }
                catch (Exception ex)
                {
                    TempData["Failure"] = ex.Message;
                }
            }

            ViewBag.DebtList     = new SelectList(DebtServices.List(db), "Id", "ReferenceNumber");
            ViewBag.EmployeeList = new SelectList(EmployeeServices.List(db), "Id", "FirstName");
            return(View(warrant));
        }
        public ActionResult Create([Bind(Include = "Id, LoanType, ClosingLoanType")] LoanTypeClosure loanTypeClosure)
        {
            Db db = new Db(DbServices.ConnectionString);

            if (ModelState.IsValid)
            {
                try
                {
                    LoanTypeClosureServices.Insert(CurrentUser.Id, loanTypeClosure, db);
                    TempData["Success"] = ResourceServices.GetString(Cf.Data.Resources.ResourceBase.Culture, "UI", "InsertConfirmed");
                    return(RedirectToAction("Index"));
                }
                catch (CfException cfex)
                {
                    TempData["Failure"] = cfex.ErrorDefinition.LocalizedMessage;
                }
                catch (Exception ex)
                {
                    TempData["Failure"] = ex.Message;
                }
            }

            ViewBag.ClosingLoanTypeList = new SelectList(LoanTypeServices.List(db), "ProductType", "Name");
            ViewBag.LoanTypeList        = new SelectList(LoanTypeServices.List(db), "ProductType", "Name");
            return(View(loanTypeClosure));
        }
Example #24
0
        public ActionResult Create([Bind(Include = "Id, Employee, Date, PaymentGroup, Amount, Notes, PaymentStatus, CollectOrder")] Payment payment)
        {
            Db db = new Db(DbServices.ConnectionString);

            if (ModelState.IsValid)
            {
                try
                {
                    PaymentServices.Insert(CurrentUser.Id, payment, db);
                    TempData["Success"] = ResourceServices.GetString(Cf.Data.Resources.ResourceBase.Culture, "UI", "InsertConfirmed");
                    return(RedirectToAction("Index"));
                }
                catch (CfException cfex)
                {
                    TempData["Failure"] = cfex.ErrorDefinition.LocalizedMessage;
                }
                catch (Exception ex)
                {
                    TempData["Failure"] = ex.Message;
                }
            }

            ViewBag.CollectOrderList  = new SelectList(CollectOrderServices.List(db), "Id", "Name");
            ViewBag.EmployeeList      = new SelectList(EmployeeServices.List(db), "Id", "FirstName");
            ViewBag.PaymentGroupList  = new SelectList(PaymentGroupServices.List(db), "Id", "Name");
            ViewBag.PaymentStatusList = new SelectList(PaymentStatusServices.List(db), "Id", "Name");
            return(View(payment));
        }
Example #25
0
        public ActionResult Edit([Bind(Include = "Id, Employee, ProductType, Amount, Notes")] Product product)
        {
            Db db = new Db(DbServices.ConnectionString);

            if (ModelState.IsValid)
            {
                try
                {
                    ProductServices.Update(CurrentUser.Id, product, db);
                    TempData["Success"] = ResourceServices.GetString(Cf.Data.Resources.ResourceBase.Culture, "UI", "UpdateConfirmed");
                    return(RedirectToAction("Index"));
                }
                catch (CfException cfex)
                {
                    TempData["Failure"] = cfex.ErrorDefinition.LocalizedMessage;
                }
                catch (Exception ex)
                {
                    TempData["Failure"] = ex.Message;
                }
            }

            ViewBag.EmployeeList    = new SelectList(EmployeeServices.List(db), "Id", "FirstName", product.Employee);
            ViewBag.ProductTypeList = new SelectList(ProductTypeServices.List(db), "Id", "Name", product.ProductType);
            return(View(product));
        }
        public ActionResult Edit([Bind(Include = "Payment, Department, Balance")] SalaryPayment salaryPayment)
        {
            Db db = new Db(DbServices.ConnectionString);

            if (ModelState.IsValid)
            {
                try
                {
                    SalaryPaymentServices.Update(CurrentUser.Id, salaryPayment, db);
                    TempData["Success"] = ResourceServices.GetString(Cf.Data.Resources.ResourceBase.Culture, "UI", "UpdateConfirmed");
                    return(RedirectToAction("Index"));
                }
                catch (CfException cfex)
                {
                    TempData["Failure"] = cfex.ErrorDefinition.LocalizedMessage;
                }
                catch (Exception ex)
                {
                    TempData["Failure"] = ex.Message;
                }
            }

            ViewBag.PaymentList    = new SelectList(PaymentServices.List(db), "Id", "Notes", salaryPayment.Payment);
            ViewBag.DepartmentList = new SelectList(DepartmentServices.List(db), "Id", "Name", salaryPayment.Department);
            return(View(salaryPayment));
        }
        public ActionResult editExceptionalAmount(ExceptionalAmount model)
        {
            Db db = new Db(DbServices.ConnectionString);

            if (ModelState.IsValid)
            {
                try
                {
                    ExceptionalAmountServices.Update(CurrentUser.Id, model, db);
                    TempData["Success"] = ResourceServices.GetString(Cf.Data.Resources.ResourceBase.Culture, "UI", "UpdateConfirmed");
                    return(RedirectToAction("Details", new { id = model.LoanRequest }));
                }
                catch (CfException cfex)
                {
                    TempData["Failure"] = cfex.ErrorDefinition.LocalizedMessage;
                }
                catch (Exception ex)
                {
                    TempData["Failure"] = ex.Message;
                }
                return(RedirectToAction("Details", new { id = model.LoanRequest }));
            }

            ViewBag.ExceptionalAmountTypeList = new SelectList(ExceptionalAmountTypeServices.List(db), "Id", "Name", model.ExceptionalAmountType);

            ViewBag.ModuleName = moduleName;
            ViewBag.Action     = update;
            ViewBag.Update     = update;
            ViewBag.Save       = save;
            ViewBag.Back       = back;
            return(View("Details", new { id = model.LoanRequest }));
        }
Example #28
0
        public ActionResult Details(Nullable <int> product)
        {
            if (product == null)
            {
                return(new HttpStatusCodeResult(HttpStatusCode.BadRequest));
            }
            GrantVwViewModel grantVwViewModel = new GrantVwViewModel();

            Db db = new Db(DbServices.ConnectionString);

            // grantVwViewModel.Instance = GrantVwServices.Get(product.Value, db);
            grantVwViewModel.Instance = GrantVwServices.GetChildren(product.Value, db);
            if (grantVwViewModel.Instance == null)
            {
                return(HttpNotFound());
            }


            @ViewBag.GrantDeductionVwTitle = ResourceServices.GetString(Cf.Data.Resources.ResourceBase.Culture, "GrantDeduction", "ModuleName");
            //if (grantVwViewModel.Instance.GrantDeductionVw != null)
            //    grantVwViewModel.GrantDeductionVwViewModel.List.Add(grantVwViewModel.Instance.GrantDeductionVw);

            @ViewBag.GrantPaymentVwTitle = ResourceServices.GetString(Cf.Data.Resources.ResourceBase.Culture, "GrantPayment", "ModuleNamePlural");
            //grantVwViewModel.GrantPaymentVwViewModel.List = grantVwViewModel.Instance.GrantPaymentVwList;


            return(View(grantVwViewModel));
        }
Example #29
0
        public ActionResult Create([Bind(Include = "Id, ProductType, Availability")] ProductTypeAvailability productTypeAvailability)
        {
            Db db = new Db(DbServices.ConnectionString);

            if (ModelState.IsValid)
            {
                try
                {
                    ProductTypeAvailabilityServices.Insert(CurrentUser.Id, productTypeAvailability, db);
                    TempData["Success"] = ResourceServices.GetString(Cf.Data.Resources.ResourceBase.Culture, "UI", "InsertConfirmed");
                    return(RedirectToAction("Index"));
                }
                catch (CfException cfex)
                {
                    TempData["Failure"] = cfex.ErrorDefinition.LocalizedMessage;
                }
                catch (Exception ex)
                {
                    TempData["Failure"] = ex.Message;
                }
            }

            ViewBag.AvailabilityList = new SelectList(AvailabilityServices.List(db), "Id", "Name");
            ViewBag.ProductTypeList  = new SelectList(ProductTypeServices.List(db), "Id", "Name");
            return(View(productTypeAvailability));
        }
Example #30
0
        /// <summary>
        ///
        /// </summary>
        /// <param name="id"></param>
        /// <returns></returns>
        public ActionResult Details(Nullable <short> productType)
        {
            if (productType == null)
            {
                return(new HttpStatusCodeResult(HttpStatusCode.BadRequest));
            }
            LoanTypeVwViewModel loanTypeVwViewModel = new LoanTypeVwViewModel();

            Db db = new Db(DbServices.ConnectionString);

            // loanTypeVwViewModel.Instance = LoanTypeVwServices.Get(productType.Value, db);
            loanTypeVwViewModel.Instance = LoanTypeVwServices.GetChildren(productType.Value, db);
            if (loanTypeVwViewModel.Instance == null)
            {
                return(HttpNotFound());
            }


            @ViewBag.ClosingLoanTypeClosureVwTitle = ResourceServices.GetString(Cf.Data.Resources.ResourceBase.Culture, "LoanTypeClosure", "ModuleNamePlural");
            // loanTypeVwViewModel.ClosingLoanTypeClosureVwViewModel.List = LoanTypeClosureVwServices.GetByLoanTypeId(productType.Value, db);
            loanTypeVwViewModel.ClosingLoanTypeClosureVwViewModel.List = loanTypeVwViewModel.Instance.ClosingLoanTypeClosureVwList;


            @ViewBag.LoanTypeClosureVwTitle = ResourceServices.GetString(Cf.Data.Resources.ResourceBase.Culture, "LoanTypeClosure", "ModuleNamePlural");
            // loanTypeVwViewModel.LoanTypeClosureVwViewModel.List = LoanTypeClosureVwServices.GetByLoanTypeId(productType.Value, db);
            loanTypeVwViewModel.LoanTypeClosureVwViewModel.List = loanTypeVwViewModel.Instance.LoanTypeClosureVwList;


            return(View(loanTypeVwViewModel));
        }