public ActionResult Edit([Bind(Include = "SerialNumber,BankName,AccountName,FDNumber,DateOfPurchase,Amount,RateOfInterest,MaturityDate,MaturityAmount,Status")] FixedDeposit fixedDeposit)
        {
            if (ModelState.IsValid)
            {
                int    oSerialNumber = Convert.ToInt32(Request["SerialNumber"]);
                string oBankName     = Request["BankName"].ToString();

                var services = db.FixedDeposits.Where(a => a.SerialNumber == oSerialNumber)
                               .Where(a => a.BankName == oBankName);


                foreach (var s in services)
                {
                    db.FixedDeposits.Remove(s);
                }

                db.FixedDeposits.Add(fixedDeposit);
                try
                {
                    db.SaveChanges();
                }
                catch
                {
                    return(RedirectToAction("Index"));
                }
                db.Entry(fixedDeposit).State = EntityState.Modified;
                return(RedirectToAction("Index"));
            }
            //ViewBag.DayID = new SelectList(db.Days, "DayID", "Day", schedule.DayID);
            //ViewBag.LanguageID = new SelectList(db.Languages, "LanguageID", "Language", schedule.LanguageID);
            //ViewBag.LocationID = new SelectList(db.Locations, "LocationID", "Location", schedule.LocationID);
            //ViewBag.TimeID = new SelectList(db.Times, "TimeID", "Time", schedule.TimeID);
            return(View(fixedDeposit));
        }
Ejemplo n.º 2
0
        public void Add(FixedDeposit FixedDeposit)
        {
            try
            {
                string clientName = DataBase.DBService.ExecuteCommandScalar(string.Format(SELECT_ID, FixedDeposit.Id));

                DataBase.DBService.BeginTransaction();
                DataBase.DBService.ExecuteCommandString(string.Format(INSERT_FixedDeposit,
                                                                      FixedDeposit.Pid, FixedDeposit.InvesterName, FixedDeposit.AccountNo,
                                                                      FixedDeposit.BankName, FixedDeposit.Branch,
                                                                      FixedDeposit.Balance, FixedDeposit.IntRate,
                                                                      FixedDeposit.DepositDate.ToString("yyyy-MM-dd hh:mm:ss"),
                                                                      FixedDeposit.MaturityAmt,
                                                                      FixedDeposit.MaturityDate.ToString("yyyy-MM-dd hh:mm:ss"),
                                                                      FixedDeposit.GoalId,
                                                                      FixedDeposit.CreatedOn.ToString("yyyy-MM-dd hh:mm:ss"), FixedDeposit.CreatedBy,
                                                                      FixedDeposit.UpdatedOn.ToString("yyyy-MM-dd hh:mm:ss"), FixedDeposit.UpdatedBy), true);

                Activity.ActivitiesService.Add(ActivityType.CreateFixedDeposit, EntryStatus.Success,
                                               Source.Server, FixedDeposit.UpdatedByUserName, FixedDeposit.AccountNo, FixedDeposit.MachineName);
                DataBase.DBService.CommitTransaction();
            }
            catch (Exception ex)
            {
                DataBase.DBService.RollbackTransaction();
                StackTrace st = new StackTrace();
                StackFrame sf = st.GetFrame(0);
                MethodBase currentMethodName = sf.GetMethod();
                LogDebug(currentMethodName.Name, ex);
                throw ex;
            }
        }
 public FixedDepositLedgerView()
 {
     InitializeComponent();
     data = new FixedDeposit();
     generalDepositLedger.ItemsSource = data.GetDataLedger(0, 0);
     DataContext = data;
 }
Ejemplo n.º 4
0
        public IList <FixedDeposit> GetAll(int plannerId)
        {
            try
            {
                Logger.LogInfo("Get: FixedDeposit process start");
                IList <FixedDeposit> lstFixedDepositOption = new List <FixedDeposit>();

                DataTable dtAppConfig = DataBase.DBService.ExecuteCommand(string.Format(SELECT_ALL, plannerId));
                foreach (DataRow dr in dtAppConfig.Rows)
                {
                    FixedDeposit mf = convertToFixedDeposit(dr);
                    lstFixedDepositOption.Add(mf);
                }
                Logger.LogInfo("Get: FixedDeposit fund process completed.");
                return(lstFixedDepositOption);
            }
            catch (Exception ex)
            {
                StackTrace st = new StackTrace();
                StackFrame sf = st.GetFrame(0);
                MethodBase currentMethodName = sf.GetMethod();
                LogDebug(currentMethodName.Name, ex);
                return(null);
            }
        }
Ejemplo n.º 5
0
 public FixedDepositView()
 {
     InitializeComponent();
     GDListObj = new FixedDepositListView();
     memberData.Navigate(GDListObj);
     DataContext = new FixedDeposit();
 }
        public FixedDepositListView()
        {
            InitializeComponent();
            FixedDeposit data = new FixedDeposit();

            generalDepositlist.ItemsSource = data.GetDataList();
            DataContext = data;
        }
Ejemplo n.º 7
0
 public static void PrintInfo(FixedDeposit obj)
 {
     Console.WriteLine("Account no.: " + obj.AccName);
     Console.WriteLine("Name: " + obj.AccName);
     Console.WriteLine("Amount: " + obj.Amount);
     Console.WriteLine("Years: " + obj.Years);
     Console.WriteLine("Simple Interest: " + obj.CalculateSimpleInterest());
 }
        public ActionResult DeleteConfirmed(int?serialnumber, string bankName)
        {
            FixedDeposit fixedDeposit = db.FixedDeposits.Find(serialnumber, bankName);

            db.FixedDeposits.Remove(fixedDeposit);
            db.SaveChanges();
            return(RedirectToAction("Index"));
        }
        public void SetForEdit(string m_id)
        {
            int id = Convert.ToInt32(m_id);

            data = new FixedDeposit();
            data.GetDataDetails(id);
            DataContext = data;
        }
Ejemplo n.º 10
0
        static void Main(string[] args)
        {
            IFestivalRate dr = new DiwaliRate();
            FixedDeposit  fd = new FixedDeposit(123, "Vishal Singh", 10000, 10000, dr, 5);

            Console.WriteLine($"Name : {fd.AccountName}\nPrinciple Amount : {fd.Principle}\nRate of Intrest = {dr.GetIntrestRate()}" +
                              $"\nAmount After {fd.Years} yrs will be Rs{fd.CalculateSimpleIntrest()}/-");
            Console.ReadLine();
        }
        private void generalDepositlist_SelectionChanged(object sender, SelectionChangedEventArgs e)
        {
            FixedDeposit classObj = generalDepositlist.SelectedItem as FixedDeposit;
            int          id       = classObj.MemberId;

            GDViewObj    = new FixedDepositView();
            GDDetailsObj = new FixedDepositDetailsView();
            GDDetailsObj.SearchWithID(id);
            this.NavigationService.Navigate(GDDetailsObj);
        }
Ejemplo n.º 12
0
        static void Main(string[] args)
        {
            FixedDeposit obj = new FixedDeposit(123, "Rohan", 15000, 2, FestivalType.DIWALI);

            PrintInfo(obj);
            FixedDeposit obj1 = new FixedDeposit(124, "Ashar", 15000, 2, FestivalType.NORMAL);

            PrintInfo(obj1);
            Console.Read();
        }
Ejemplo n.º 13
0
        static void Main(string[] args)
        {
            FixedDeposit obj = new FixedDeposit(123, "Rohan", 15000, 2, new DiwaliRate());

            PrintInfo(obj);
            FixedDeposit obj1 = new FixedDeposit(124, "Ashar", 15000, 2, new NormalRate());

            PrintInfo(obj1);
            Console.Read();
        }
        public ActionResult Create([Bind(Include = "SerialNumber,BankName,AccountName,FDNumber,DateOfPurchase,Amount,RateOfInterest,MaturityDate,MaturityAmount,Status")] FixedDeposit fixedDeposit)
        {
            if (ModelState.IsValid)
            {
                db.FixedDeposits.Add(fixedDeposit);
                db.SaveChanges();
                return(RedirectToAction("Index"));
            }

            return(View(fixedDeposit));
        }
        // GET: FixedDeposits/Edit/5
        public ActionResult Edit(int?serialnumber, string bankName)
        {
            if (serialnumber == null || String.IsNullOrEmpty(bankName))
            {
                return(new HttpStatusCodeResult(HttpStatusCode.BadRequest));
            }
            FixedDeposit fixedDeposit = db.FixedDeposits.Find(serialnumber, bankName);

            if (fixedDeposit == null)
            {
                return(HttpNotFound());
            }
            return(View(fixedDeposit));
        }
        public Result Delete(FixedDeposit FixedDeposit)
        {
            var result = new Result();

            try
            {
                FixedDepositService FixedDepositService = new FixedDepositService();
                FixedDepositService.Delete(FixedDeposit);
                result.IsSuccess = true;
            }
            catch (Exception exception)
            {
                result.IsSuccess     = false;
                result.ExceptionInfo = exception;
            }
            return(result);
        }
Ejemplo n.º 17
0
 internal bool Update(FixedDeposit FixedDeposit)
 {
     try
     {
         FinancialPlanner.Common.JSONSerialization jsonSerialization = new FinancialPlanner.Common.JSONSerialization();
         string          apiurl          = Program.WebServiceUrl + "/" + UPDATE_FixedDeposit_API;
         RestAPIExecutor restApiExecutor = new RestAPIExecutor();
         var             restResult      = restApiExecutor.Execute <FixedDeposit>(apiurl, FixedDeposit, "POST");
         return(true);
     }
     catch (Exception ex)
     {
         StackTrace st = new StackTrace();
         StackFrame sf = st.GetFrame(0);
         MethodBase currentMethodName = sf.GetMethod();
         LogDebug(currentMethodName.Name, ex);
         return(false);
     }
 }
        public ActionResult RenewFD([Bind(Include = "SerialNumber,BankName,DateOfPurchase,Amount,RateOfInterest,MaturityDate,MaturityAmount,Status")] IList <FixedDeposit> fdList)
        {
            var updatedFDList = new List <FixedDeposit>();

            foreach (FixedDeposit e in fdList)
            {
                FixedDeposit fd = db.FixedDeposits.Find(e.SerialNumber, e.BankName);

                fd.DateOfPurchase = e.DateOfPurchase;
                fd.Amount         = e.Amount;
                fd.RateOfInterest = e.RateOfInterest;
                fd.MaturityDate   = e.MaturityDate;
                fd.MaturityAmount = e.MaturityAmount;

                fd.Status = e.Status;

                updatedFDList.Add(e);
            }
            db.SaveChanges();

            return(RedirectToAction("Index", new { fdview = true }));
        }
Ejemplo n.º 19
0
        public static void ValidateDepositType(ref string depositType)
        {
            var depositTypes = new string[]
            {
                SavingDeposit.GetDepositType(),
                CurrentDeposit.GetDepositType(),
                FixedDeposit.GetDepositType(),
                RecurringDeposit.GetDepositType(),
            };

            do
            {
                var iter = 0;
                Console.WriteLine("Возможные типы депозитов:");
                foreach (var dep in depositTypes)
                {
                    Console.WriteLine($"{++iter}.{dep}");
                }
                Console.Write("Введите тип депозита: ");
                depositType = Console.ReadLine();
            } while (!depositTypes.Contains(depositType));
        }
Ejemplo n.º 20
0
        public void Delete(FixedDeposit FixedDeposit)
        {
            try
            {
                string clientName = DataBase.DBService.ExecuteCommandScalar(string.Format(SELECT_ID, FixedDeposit.Id));

                DataBase.DBService.BeginTransaction();
                DataBase.DBService.ExecuteCommandString(string.Format(DELETE_FixedDeposit,
                                                                      FixedDeposit.Id), true);

                Activity.ActivitiesService.Add(ActivityType.DeleteFixedDeposit, EntryStatus.Success,
                                               Source.Server, FixedDeposit.UpdatedByUserName, FixedDeposit.AccountNo, FixedDeposit.MachineName);
                DataBase.DBService.CommitTransaction();
            }
            catch (Exception ex)
            {
                DataBase.DBService.RollbackTransaction();
                StackTrace st = new StackTrace();
                StackFrame sf = st.GetFrame(0);
                MethodBase currentMethodName = sf.GetMethod();
                LogDebug(currentMethodName.Name, ex);
                throw ex;
            }
        }
Ejemplo n.º 21
0
        public FixedDeposit Get(int id)
        {
            try
            {
                Logger.LogInfo("Get: FixedDeposit by id process start");
                FixedDeposit FixedDeposit = new FixedDeposit();

                DataTable dtAppConfig = DataBase.DBService.ExecuteCommand(string.Format(SELECT_ID, id));
                foreach (DataRow dr in dtAppConfig.Rows)
                {
                    FixedDeposit = convertToFixedDeposit(dr);
                }
                Logger.LogInfo("Get: FixedDeposit by id process completed");
                return(FixedDeposit);
            }
            catch (Exception ex)
            {
                StackTrace st = new StackTrace();
                StackFrame sf = st.GetFrame(0);
                MethodBase currentMethodName = sf.GetMethod();
                LogDebug(currentMethodName.Name, ex);
                return(null);
            }
        }
Ejemplo n.º 22
0
        private FixedDeposit convertToFixedDeposit(DataRow dr)
        {
            FixedDeposit FixedDeposit = new FixedDeposit();

            FixedDeposit.Id                = dr.Field <int>("ID");
            FixedDeposit.Pid               = dr.Field <int>("PID");
            FixedDeposit.InvesterName      = dr.Field <string>("InvesterName");
            FixedDeposit.AccountNo         = dr.Field <string>("AccountNo");
            FixedDeposit.BankName          = dr.Field <string>("BankName");
            FixedDeposit.Branch            = dr.Field <string>("Branch");
            FixedDeposit.Balance           = Double.Parse(dr["Balance"].ToString());
            FixedDeposit.IntRate           = float.Parse(dr["IntRate"].ToString());
            FixedDeposit.DepositDate       = dr.Field <DateTime>("DepositDate");
            FixedDeposit.MaturityAmt       = Double.Parse(dr["MaturityAmt"].ToString());
            FixedDeposit.MaturityDate      = dr.Field <DateTime>("MaturityDate");
            FixedDeposit.GoalId            = dr.Field <int>("GoalId");
            FixedDeposit.UpdatedBy         = dr.Field <int>("UpdatedBy");
            FixedDeposit.UpdatedOn         = dr.Field <DateTime>("UpdatedOn");
            FixedDeposit.UpdatedByUserName = dr.Field <string>("UpdatedByUserName");
            FixedDeposit.UpdatedBy         = dr.Field <int>("UpdatedBy");
            FixedDeposit.UpdatedOn         = dr.Field <DateTime>("UpdatedOn");
            FixedDeposit.UpdatedByUserName = dr.Field <string>("UpdatedByUserName");
            return(FixedDeposit);
        }
 public FixedDepositEntryView()
 {
     InitializeComponent();
     data        = new FixedDeposit();
     DataContext = data;
 }
Ejemplo n.º 24
0
 public IActionResult Edit(FixedDeposit deposit)
 {
     fixedDepositRepository.Update(deposit);
     return(RedirectToAction("List"));
 }
Ejemplo n.º 25
0
 public IActionResult Add(FixedDeposit deposit)
 {
     fixedDepositRepository.Add(deposit);
     return(RedirectToAction("List"));
 }
Ejemplo n.º 26
0
 private extern static double GetMaturityValue(ref FixedDeposit fd, Scheme policy);
Ejemplo n.º 27
0
 private extern static int InitFixedDeposit(double amount, int period, out FixedDeposit fd);
 public FixedDepositDetailsView()
 {
     InitializeComponent();
     Object      = new FixedDeposit();
     DataContext = Object;
 }