public string AddFeeDetails(FeeDetails feeDetails) { string FeeDetailsId = new Guid().ToString(); string connectionString = System.Configuration.ConfigurationManager. ConnectionStrings["DBConnectionString"].ConnectionString; using (SqlConnection connection = new SqlConnection(connectionString)) { string query = "insert into FeeDetails(FeeDetailsId,StudentId,TransactionId,Date,PayeeName,FathersName,DOB,PhoneNumberOffice,FeeDescription,status)values(@FeeDetailsId,@StudentId,@TransactionId,@Date,@PayeeName,@FathersName,@DOB,@PhoneNumberOffice,@FeeDescription,@status)"; SqlCommand sqlCommand = new SqlCommand(query, connection); sqlCommand.Parameters.Add("@FeeDetailsId", System.Data.SqlDbType.VarChar).Value = FeeDetailsId; sqlCommand.Parameters.Add("@TransactionId", System.Data.SqlDbType.VarChar).Value = feeDetails.TransactionId; sqlCommand.Parameters.Add("@Date", System.Data.SqlDbType.VarChar).Value = feeDetails.Date; sqlCommand.Parameters.Add("@PayeeName", System.Data.SqlDbType.DateTime).Value = feeDetails.PayeeName; sqlCommand.Parameters.Add("@FathersName", System.Data.SqlDbType.VarChar).Value = feeDetails.FathersName; sqlCommand.Parameters.Add("@DOB", System.Data.SqlDbType.DateTime).Value = feeDetails.DOB; sqlCommand.Parameters.Add("@PhoneNumberOffice", System.Data.SqlDbType.VarChar).Value = feeDetails.PhoneNumberOffice; sqlCommand.Parameters.Add("@FeeDescription", System.Data.SqlDbType.VarChar).Value = feeDetails.FeeDescription; sqlCommand.Parameters.Add("@Amount", System.Data.SqlDbType.Decimal).Value = feeDetails.Amount; if (string.IsNullOrEmpty(feeDetails.StudentId)) { sqlCommand.Parameters.AddWithValue("@StudentId", DBNull.Value); } else { sqlCommand.Parameters.Add("@StudentId", System.Data.SqlDbType.NVarChar).Value = feeDetails.StudentId; } sqlCommand.Parameters.Add("@status", System.Data.SqlDbType.Bit).Value = true; connection.Open(); sqlCommand.ExecuteNonQuery(); } return(FeeDetailsId); }
public IActionResult FeeDetails(Guid studentId, Guid classId) { try { var result = new FeeDetails(); result = _feeBusiness.FeeDetails(studentId, classId); return(Ok(result)); } catch (Exception ex) { return(BadRequest(ex)); } }
public ActionResult SaveFeeDetails(FormCollection formCollection) { FeeDetails feeDetails = new FeeDetails(); if (!string.IsNullOrEmpty(formCollection["FeeDetails.StudentId"])) { feeDetails.StudentId = formCollection["FeeDetails.StudentId"].ToString(); } if (!string.IsNullOrEmpty(formCollection["FeeDetails.TransactionId"])) { feeDetails.TransactionId = formCollection["FeeDetails.TransactionId"].ToString(); } if (!string.IsNullOrEmpty(formCollection["FeeDetails.Date"])) { feeDetails.Date = formCollection["FeeDetails.Date"].AsDateTime(); } if (!string.IsNullOrEmpty(formCollection["FeeDetails.PayeeName"])) { feeDetails.PayeeName = formCollection["FeeDetails.PayeeName"].ToString(); } if (!string.IsNullOrEmpty(formCollection["FeeDetails.FathersName"])) { feeDetails.FathersName = formCollection["FeeDetails.FathersName"].ToString(); } if (!string.IsNullOrEmpty(formCollection["FeeDetails.DOB"])) { feeDetails.DOB = formCollection["FeeDetails.DOB"].AsDateTime(); } if (!string.IsNullOrEmpty(formCollection["FeeDetails.PhoneNumberOffice"])) { feeDetails.PhoneNumberOffice = formCollection["FeeDetails.PhoneNumberOffice"].ToString(); } if (!string.IsNullOrEmpty(formCollection["FeeDetails.FeeDescription"])) { feeDetails.FeeDescription = formCollection["FeeDetails.FeeDescription"].ToString(); } if (!string.IsNullOrEmpty(formCollection["FeeDetails.Amount"])) { feeDetails.Amount = Convert.ToDecimal(formCollection["FeeDetails.Amount"]); } StudentDetailsDal studentDetailsDal = new StudentDetailsDal(); feeDetails.FeeDetailsId = studentDetailsDal.AddFeeDetails(feeDetails); return(View()); }
// GET: CMS/Transactions //[Authorize(Roles = "Admin, Employee")] public ActionResult Candidate(string TransactionId, string Status) { var userDetail = generic.GetUserDetail(User.Identity.GetUserId()); ViewData["UserProfile"] = userDetail; ViewBag.UserId = userDetail.SubscriberId; ViewData["EmpDetails"] = ems.GetEmployeeBasicDetails(userDetail.UserId).FirstOrDefault(); ViewData["CompanyLogo"] = cms.GetCompanyLogo(userDetail.SubscriberId).FirstOrDefault(); var plandetail = admin.GetUserplanDetails(userDetail.SubscriberId).Where(c => c.AddOnId == 3).FirstOrDefault(); ViewData["plandetail"] = plandetail; if (TransactionId != null && !string.IsNullOrEmpty(Status)) { FeeDetails feedetail = db.FeeDetails.Find(TransactionId); if (feedetail != null) { if (Status == "Approve") { feedetail.Status = "Approved"; } else { feedetail.Status = "Failed"; } feedetail.ApprovedBy = User.Identity.GetUserId(); feedetail.ApprovalDate = DateTime.UtcNow; db.Entry(feedetail).State = EntityState.Modified; db.SaveChanges(); return(RedirectToAction("Candidate", "Transactions", new { area = "CMS" })); } } var detials = student.GetCandidatePaymentTransaction(userDetail.SubscriberId).Where(c => c.Status != "Failed"); return(View(detials)); }
public NewOrderInfo() { order_info = new OrderInfo(); fee_details = new FeeDetails(); instructions = new Instructions(); }
public CpOrderInfo() { fee_details = new FeeDetails(); order_info = new OrderInfo(); customer = new Customer(); }
public FeeDetails FeeDetails(Guid studentId, Guid classId) { try { var feeDetails = new FeeDetails(); var currentFinancialYear = DateTime.Now.Month >= 4 ? DateTime.Now.Year + 1 : DateTime.Now.Year; var currentFinacialStartDate = new DateTime(currentFinancialYear - 1, 4, 1); var currentFinacialEndDate = new DateTime(currentFinancialYear, 3, 31); var currentList = _feeDataAccess.FeeDetails(studentId, currentFinacialStartDate, currentFinacialEndDate); if (currentList != null) { feeDetails.Current = currentList.Select(x => new Fee { Id = x.Id, StudentId = x.StudentId, Amount = x.Amount, CheckNumber = x.CheckNumber, ClearenceDate = x.ClearanceDate, Comment = x.Comment, Discount = x.Discount, FeeDate = x.FeeDate, FeeType = x.FeeType.Name, Fine = x.Fine, PaymentMode = x.PaymentMode.Name, TransactionNo = x.TransactionNo, FeeTypeId = x.FeeTypeId, }).ToList(); } //var previousFinancialYear = currentFinancialYear - 1; //var previousFinacialStartDate = new DateTime(previousFinancialYear - 1, 4, 1); //var previousFinacialEndDate = new DateTime(previousFinancialYear, 3, 31); //var previousList = _feeDataAccess.FeeDetails(studentId, previousFinacialStartDate, previousFinacialEndDate); //if (previousList != null) //{ // feeDetails.Previous = previousList.Select(x => new Fee // { // Id = x.Id, // StudentId = x.StudentId, // Amount = x.Amount, // CheckNumber = x.CheckNumber, // ClearenceDate = x.ClearanceDate, // Comment = x.Comment, // Discount = x.Discount, // FeeDate = x.FeeDate, // FeeType = x.FeeType.Name, // Fine = x.Fine, // PaymentMode = x.PaymentMode.Name, // TransactionNo = x.TransactionNo, // FeeTypeId = x.FeeTypeId, // }).ToList(); //} var baseList = FeeBaseList(studentId, classId); feeDetails.Current = FeeDetailList(feeDetails.Current, baseList); return(feeDetails); } catch (Exception ex) { throw ex; } }