/// <param name="type">Type of element.</param> /// <param name="attr">Found attribute.</param> /// <param name="method">Found method.</param> /// <param name="data"></param> protected void InspectLevelB(Type type, Attribute attr, MethodInfo method, LInfo data) { if (!IsComponent(type) || (attr.GetType() != typeof(MethodAttribute) && attr.GetType() != typeof(PropertyAttribute))) { return; } IAttrDomLevelB levB = (IAttrDomLevelB)attr; string className = method.DeclaringType.FullName; NodeIdent ident = new NodeIdent(levB.Parent ?? GetComponentName(type), levB.Method, (levB.Method == null)? null : className); if (!data.ContainsKey(ident)) { data[ident] = new List <INodeInfo>(); } className = (method.Name == null)? null : className; if (attr.GetType() == typeof(PropertyAttribute)) { data[ident].Add(new NodeInfo((PropertyAttribute)attr, method.Name, className)); return; } if (attr.GetType() == typeof(MethodAttribute)) { data[ident].Add(new NodeInfo((MethodAttribute)attr, method.Name, className)); return; } }
public ActionResult ConfirmCashDeposit(int accno, int amount) { UserRepository urepo = new UserRepository(); User ur = urepo.Get(accno); if (ur.User_acc_type == "Savings") { if (amount >= 1000) { ur.User_balance = ur.User_balance + Convert.ToDouble(amount); urepo.Update(ur); ViewData["Message"] = "Deposit Successfull"; TransactionRepository trepo = new TransactionRepository(); Transaction tr = new Transaction(); tr.Tr_Amount = amount; tr.Tr_Date = DateTime.Now.ToString("yyyy-MM-dd"); tr.Tr_EmpType = "Cashier"; tr.Tr_AccName = ur.User_Name; tr.Tr_Through = Session["Name"].ToString(); tr.Tr_Type = "CashDeposit"; tr.Tr_Branch = Session["Branch"].ToString(); trepo.Insert(tr); } else { ViewData["Message"] = "Amount has to be higher that 1000Tk/Invalid"; } } else if (ur.User_acc_type == "Loan") { LoanRepository lr = new LoanRepository(); LInfo luser = lr.GetUser(ur.User_acc_no); if (amount >= 1000 && luser.Status == "Active") { luser.Loan_Amount_Paid += Convert.ToDouble(amount); lr.Update(luser, ur); if (luser.AmountTo_Pay == luser.Loan_Amount_Paid) { luser.Status = "InActive"; lr.Update(luser, ur); ViewData["Message"] = "Loan Payment Successfull, Your Loan Account Has been Deactivated, Thank You, Sir. Come Again Soon!"; } } else { ViewData["Message"] = "Amount has to be higher that 1000Tk/Invalid"; } } else { ViewData["Message"] = "Account Not Recognized"; } return(View("Empty")); }
public List <LInfo> GetAllUnapproved() { DataAccess db = new DataAccess(); string sql = "Select * from LInfoes where Status='Unapproved'"; List <LInfo> ll = new List <LInfo>(); SqlDataReader data = db.GetData(sql); while (data.Read()) { LInfo l = new LInfo(); l.Interest_Rate = Convert.ToInt32(data["Interest_Rate"]); l.Loan_Amount = Convert.ToInt32(data["Loan_Amount"]); l.Loan_Amount_Paid = Convert.ToInt32(data["Loan_Amount_Paid"]); l.AmountTo_Pay = Convert.ToInt32(data["AmountTo_Pay"]); l.Loan_Date = data["Loan_Date"].ToString(); l.Loan_Deadline = data["Loan_Deadline"].ToString(); l.Loan_Id = Convert.ToInt32(data["Loan_Id"]); l.Manager_Approval = data["Manager_Approval"].ToString(); l.MD_Approval = data["MD_Approval"].ToString(); l.Status = data["Status"].ToString(); l.User_acc_no = Convert.ToInt32(data["User_acc_no"]); l.User_Name = data["User_Name"].ToString(); ll.Add(l); } return(ll); }
public IHttpActionResult Post(LInfo lInfo) { this.trepo.Insert(lInfo); string uri = Url.Link("GetUserById", new { id = lInfo.User_acc_no }); return(Created("GetCategoryById", lInfo)); }
public List <LInfo> GetAllNoapprovalfromManager(string Manager_Branch) { DataAccess db = new DataAccess(); string sql = "Select * from LInfoes where Manager_Approval='No' AND Loan_Branch='" + Manager_Branch + "'"; List <LInfo> ll = new List <LInfo>(); SqlDataReader data = db.GetData(sql); while (data.Read()) { LInfo l = new LInfo(); l.Interest_Rate = Convert.ToInt32(data["Interest_Rate"]); l.LoanCause = data["LoanCause"].ToString(); l.Loan_Amount = Convert.ToInt32(data["Loan_Amount"]); l.Loan_Amount_Paid = Convert.ToInt32(data["Loan_Amount_Paid"]); l.AmountTo_Pay = Convert.ToInt32(data["AmountTo_Pay"]); l.Loan_Date = data["Loan_Date"].ToString(); l.Loan_Deadline = data["Loan_Deadline"].ToString(); l.Loan_Id = Convert.ToInt32(data["Loan_Id"]); l.LOfficer_Id = Convert.ToInt32(data["LOfficer_Id"]); l.Manager_Approval = data["Manager_Approval"].ToString(); l.MD_Approval = data["MD_Approval"].ToString(); l.Status = data["Status"].ToString(); l.User_acc_no = Convert.ToInt32(data["User_acc_no"]); l.Loan_Branch = data["Loan_Branch"].ToString(); ll.Add(l); } return(ll); }
/// <param name="type">Type of element.</param> /// <param name="attr">Found attribute.</param> /// <param name="data"></param> protected void InspectLevelA(Type type, Attribute attr, LInfo data) { if (!IsComponent(type) || (attr.GetType() != typeof(DefinitionAttribute) && attr.GetType() != typeof(ComponentAttribute))) { return; } IAttrDomLevelA levA = (IAttrDomLevelA)attr; NodeIdent ident = new NodeIdent(levA.Parent, null); if (!data.ContainsKey(ident)) { data[ident] = new List <INodeInfo>(); } if (attr.GetType() == typeof(DefinitionAttribute)) { data[ident].Add(new NodeInfo((DefinitionAttribute)attr)); return; } if (attr.GetType() == typeof(ComponentAttribute)) { INodeInfo node = new NodeInfo((ComponentAttribute)attr); data[ident].Add(node); AliasesToNodeLevelA(node, data[ident]); return; } }
public int MD_Approval_Update(LInfo loan) { LInfo loantoUpdate = context.Linfos.SingleOrDefault(d => d.Loan_Id == loan.Loan_Id); loantoUpdate.Status = loan.Status; return(context.SaveChanges()); }
public ActionResult ConfirmCreateLoanAccount(string User_Name, string User_password, string User_address, string User_mobile, string User_acc_type, double Loan_Amount, double Interest_Rate, int Loan_Deadline, string LoanCause) { LoginRepository lrepo = new LoginRepository(); Logininfo li = lrepo.Get(User_Name); if (li == null) { User us = new User(); us.User_acc_type = User_acc_type; us.User_address = User_address; us.User_balance = 0; us.User_mobile = User_mobile; us.User_Name = User_Name; us.User_password = User_password; us.Deadline = DateTime.Now.AddYears(Loan_Deadline).ToString("yyyy-MM-dd"); LInfo loan = new LInfo(); loan.LoanCause = LoanCause; loan.Loan_Amount = Loan_Amount; loan.Loan_Deadline = DateTime.Now.AddYears(Loan_Deadline).ToString("yyyy-MM-dd"); loan.Interest_Rate = Interest_Rate; loan.AmountTo_Pay = loan.Loan_Amount + ((loan.Loan_Amount * loan.Interest_Rate) / 100); loan.Status = "Unapproved"; loan.Loan_Amount_Paid = 0; loan.Loan_Date = DateTime.Now.ToString("yyyy-MM-dd"); loan.Manager_Approval = "No"; loan.MD_Approval = "No"; loan.LOfficer_Id = Convert.ToInt32(Session["Id"]); loan.Loan_Branch = Session["Branch"].ToString(); LoanRepository loanrepo = new LoanRepository(); loanrepo.Insert(loan, us); ViewData["Message"] = "Loan Account Successfully Created"; TransactionRepository trepo = new TransactionRepository(); Transaction tr = new Transaction(); tr.Tr_Amount = Loan_Amount; tr.Tr_Date = DateTime.Now.ToString("yyyy-MM-dd"); tr.Tr_EmpType = "LOfficer"; tr.Tr_AccName = us.User_Name; tr.Tr_Through = Session["Name"].ToString(); tr.Tr_Type = "Loan"; tr.Tr_Branch = Session["Branch"].ToString(); trepo.Insert(tr); return(View("Empty")); } else { ViewData["Message"] = "Username in User/Invalid Info"; return(View("Empty")); } }
public override void OnLoad() { map = new TMXTiledMap("assets/testmap.tmx"); LInfo info = new LInfo(300, 300); info.SetLocation(5, 0); info.PutMessage("传说中的"); Add(info); }
public int Update(LInfo loan, User User) { LInfo loantoUpdate = context.Linfos.SingleOrDefault(d => d.Loan_Id == loan.Loan_Id); User userToUpdate = context.Users.SingleOrDefault(d => d.User_acc_no == User.User_acc_no); loantoUpdate.User_acc_no = User.User_acc_no; userToUpdate.User_Name = User.User_Name; userToUpdate.User_address = User.User_address; return(context.SaveChanges()); }
public int Insert(LInfo loan) { UserRepository ur = new UserRepository(); User user = ur.Get(loan.User_Name); loan.AmountTo_Pay = Convert.ToDouble(loan.Loan_Amount + ((loan.Loan_Amount * loan.Interest_Rate) / 100)); loan.User_acc_no = user.User_acc_no; context.Linfos.Add(loan); return(context.SaveChanges()); }
public int Update(LInfo loan) { LInfo loantoUpdate = context.Linfos.SingleOrDefault(d => d.User_acc_no == loan.User_acc_no); loantoUpdate.Loan_Amount_Paid = loan.Loan_Amount_Paid; loantoUpdate.Manager_Approval = loan.Manager_Approval; loantoUpdate.MD_Approval = loan.MD_Approval; loantoUpdate.Status = loan.Status; return(context.SaveChanges()); }
//GLRenderer renderer; public override void OnLoad() { //renderer = new GLRenderer(); map = new TMXTiledMap("assets/testmap.tmx"); LInfo info = new LInfo(300, 300); info.SetLocked(true); info.SetLocation(5, 0); info.PutMessage("传说中的"); Add(info); }
public int Insert(LInfo loan, User user) { UserRepository urepo = new UserRepository(); urepo.Insert(user); loan.User_acc_no = user.User_acc_no; context.Linfos.Add(loan); return(context.SaveChanges()); }
public ActionResult Info(long id) { var user = UserSvc.GetById(UserHelper.GetUserId(HttpContext).Value); var lines = LineSvc.GetByLid(id); var linesinfo = LineInfoSvc.GetById(id); LInfo model = new LInfo(); model.Lines = lines; model.LineInfo = linesinfo; ViewBag.phonenum = user.PhoneNum; return(View(model)); }
public ActionResult ConfirmPending_Loans(int Loan_Id) { LoanRepository brepo = new LoanRepository(); LInfo br = brepo.Get(Loan_Id); br.Manager_Approval = "Yes"; brepo.Manager_Approval_Update(br); ViewData["Message"] = "Your Apporaval Is Successfully Done"; return(View("Empty")); }
public IHttpActionResult GetUser(int User_acc_no) { LInfo u = trepo.GetUser(User_acc_no); List <LInfo> ul = new List <LInfo>(); ul.Add(u); if (u == null) { return(StatusCode(HttpStatusCode.NoContent)); } else { return(Ok(ul)); } }
/// <param name="c">From</param> /// <param name="data">To</param> protected void Extract(IComponent c, LInfo data) { Type type = c.GetType(); foreach (Attribute attr in type.GetCustomAttributes(true)) { InspectLevelA(type, attr, data); } foreach (MethodInfo minf in type.GetMethods(BindingFlags.Instance | BindingFlags.Public | BindingFlags.NonPublic)) { foreach (Attribute attr in Attribute.GetCustomAttributes(minf)) { InspectLevelB(type, attr, minf, data); } } }
public IHttpActionResult Put(LInfo loan) { this.trepo.Update(loan); return(Ok(loan)); }
public IHttpActionResult Manager_Approval_Update(LInfo loan, int Loan_Id) { loan.Loan_Id = Loan_Id; this.trepo.MD_Approval_Update(loan); return(Ok(loan)); }