Example #1
0
        private List <FeeStructures> fetchFeeStructures(SqlCommand cmd)
        {
            SqlConnection        con           = cmd.Connection;
            List <FeeStructures> feestructures = null;

            con.Open();
            using (con)
            {
                SqlDataReader dr = cmd.ExecuteReader();
                if (dr.HasRows)
                {
                    feestructures = new List <FeeStructures>();
                    while (dr.Read())
                    {
                        FeeStructures fs = new FeeStructures();
                        fs.db_Id       = Convert.ToString(dr["id"]);
                        fs.Name_of_lvl = Convert.ToString(dr["name_of_level"]);
                        fs.Reg_fee     = Convert.ToString(dr["reg_fee"]);
                        fs.Monthly_fee = Convert.ToString(dr["monthly_fee"]);
                        feestructures.Add(fs);
                    }
                    feestructures.TrimExcess();
                }
            }
            return(feestructures);
        }
Example #2
0
        public ActionResult Create(FeeStructure Add)
        {
            if (Session["Username"] == null && Session["Password"] == null)
            {
                return(RedirectToAction("Index", "Admin", new { area = "" }));
            }
            else
            {
                if (ModelState.IsValid)
                {
                    FeeStructures AddFeeStructure = new FeeStructures();
                    AddFeeStructure.Name_of_lvl = Add.Name_of_lvl;
                    AddFeeStructure.Reg_fee     = Add.Reg_fee;
                    AddFeeStructure.Monthly_fee = Add.Monthly_fee;
                    AddFeeStructure.Date        = DateTime.Today.ToString("dd-MM-yyyy");
                    AddFeeStructure.Month       = DateTime.Today.ToString("MMM");
                    AddFeeStructure.Year        = DateTime.Today.ToString("yyyy");
                    AddFeeStructure.Time        = DateTime.Now.ToString("HH:mm:ss");
                    new Cateloge().AddFeeStructure(AddFeeStructure);
                    TempData["Msg"] = "New Fee Structure Have Added Successfully";
                    return(RedirectToAction("Index"));
                }

                return(RedirectToAction("Index"));
            }
        }
        public string InsertFeeStructure(InsertFeeStructure obj)
        {
            string returnResult = (dynamic)null;

            try
            {
                if (obj != null)
                {
                    //[Note: insert 'states' table]
                    if (obj.FeeStructures != null)
                    {
                        DateTime sDate = DateTime.ParseExact(obj.FeeStructures.StartYear, "yyyy", null);
                        DateTime eDate = DateTime.ParseExact(obj.FeeStructures.EndYear, "yyyy", null);
                        //var FeeStructures = new InsertFeeStructure_FeeStructures()
                        var FeeStructures = new FeeStructures()
                        {
                            ClassId      = obj.FeeStructures.ClassId,
                            FeeTypeId    = obj.FeeStructures.FeeTypeId,
                            Amount       = obj.FeeStructures.Amount,
                            YearlyTermNo = obj.FeeStructures.YearlyTermNo,
                            StartingYear = sDate,
                            EndingYear   = eDate,
                            IsActive     = obj.FeeStructures.IsActive
                        };
                        _FeeStructuresRepo.Insert(FeeStructures);
                        returnResult = "Saved";
                    }
                }
            }
            catch (Exception ex)
            {
                returnResult = "ERROR102:ClassesServ/InsertClassessList - " + ex.Message;
            }
            return(returnResult);
        }
Example #4
0
        public void PublishFeeStructure(FeeStructures pfs, int id)
        {
            SqlCommand cmd = new SqlCommand("Update fee_structures Set publish=@Publish Where id = @Id", DALUtil.getConnection());

            cmd.Parameters.AddWithValue("@Id", id);
            cmd.Parameters.AddWithValue("@Publish", (pfs.Publish == null) ? Convert.DBNull : pfs.Publish);
            addfeestructure(cmd);
        }
Example #5
0
        public void UpdateFeeStructure(FeeStructures ufs, int id)
        {
            SqlCommand cmd = new SqlCommand("Update fee_structures Set name_of_level=@Name_of_lvl , reg_fee = @Reg_fee , monthly_fee=@Monthly_fee Where id=@Id", DALUtil.getConnection());

            cmd.Parameters.AddWithValue("@Id", id);
            cmd.Parameters.AddWithValue("@Name_of_lvl", (ufs.Name_of_lvl == null) ? Convert.DBNull : ufs.Name_of_lvl);
            cmd.Parameters.AddWithValue("@Reg_fee", (ufs.Reg_fee == null) ? Convert.DBNull : ufs.Reg_fee);
            cmd.Parameters.AddWithValue("@Monthly_fee", (ufs.Monthly_fee == null) ? Convert.DBNull : ufs.Monthly_fee);
            addfeestructure(cmd);
        }
Example #6
0
        private void ListFeeStructures()
        {
            var currentDirectory = Directory.GetCurrentDirectory();
            var filePath         = Path.Combine(currentDirectory, @"Resources\FeeStructures\");
            var feeStructures    = Directory.GetFiles(filePath);

            foreach (string feeStructure in feeStructures)
            {
                string fileName = Path.GetFileName(feeStructure);
                FeeStructures.Add(fileName.Remove(fileName.Length - 4));
            }
        }
Example #7
0
        public void AddFeeStructure(FeeStructures fs)
        {
            SqlCommand cmd = new SqlCommand("INSERT into fee_structures (name_of_level,reg_fee,monthly_fee,date,month,year,time) VALUES (@Name_of_lvl,@Reg_fee,@Monthly_fee,@Date,@Month,@Year,@Time)", DALUtil.getConnection());

            cmd.Parameters.AddWithValue("@Name_of_lvl", (fs.Name_of_lvl == null) ? Convert.DBNull : fs.Name_of_lvl);
            cmd.Parameters.AddWithValue("@Reg_fee", (fs.Reg_fee == null) ? Convert.DBNull : fs.Reg_fee);
            cmd.Parameters.AddWithValue("@Monthly_fee", (fs.Monthly_fee == null) ? Convert.DBNull : fs.Monthly_fee);
            cmd.Parameters.AddWithValue("@Date", (fs.Date == null) ? Convert.DBNull : fs.Date);
            cmd.Parameters.AddWithValue("@Month", (fs.Month == null) ? Convert.DBNull : fs.Month);
            cmd.Parameters.AddWithValue("@Year", (fs.Year == null) ? Convert.DBNull : fs.Year);
            cmd.Parameters.AddWithValue("@Time", (fs.Time == null) ? Convert.DBNull : fs.Time);
            addfeestructure(cmd);
        }
Example #8
0
        public ActionResult Publish(FeeStructure pfs, int id)
        {
            if (Session["Username"] == null && Session["Password"] == null)
            {
                return(RedirectToAction("Index", "Admin", new { area = "" }));
            }
            else
            {
                if (ModelState.IsValid)
                {
                    FeeStructures PublishFeeStructures = new FeeStructures();
                    PublishFeeStructures.Publish = pfs.Publish;
                    new Cateloge().PublishFeeStructure(PublishFeeStructures, id);
                    TempData["Msg"] = "This Star Have Published Successfully";
                    return(RedirectToAction("View", new { id = id }));
                }

                return(RedirectToAction("Index"));
            }
        }
Example #9
0
 public ActionResult Edit(FeeStructure Update, int id)
 {
     if (Session["Username"] == null && Session["Password"] == null)
     {
         return(RedirectToAction("Index", "Admin", new { area = "" }));
     }
     else
     {
         if (ModelState.IsValid)
         {
             FeeStructures UpdateFeeStructure = new FeeStructures();
             UpdateFeeStructure.Name_of_lvl = Update.Name_of_lvl;
             UpdateFeeStructure.Reg_fee     = Update.Reg_fee;
             UpdateFeeStructure.Monthly_fee = Update.Monthly_fee;
             new Cateloge().UpdateFeeStructure(UpdateFeeStructure, id);
             TempData["Msg"] = "Fee Stucture Have Updated Successfully";
             return(RedirectToAction("Index"));
         }
         return(View(Update));
     }
 }
 public void PublishFeeStructure(FeeStructures pfs, int id)
 {
     new AddAndUpdtFeeStructureDAL().PublishFeeStructure(pfs, id);
 }
 public void UpdateFeeStructure(FeeStructures ufs, int id)
 {
     new AddAndUpdtFeeStructureDAL().UpdateFeeStructure(ufs, id);
 }
 public void AddFeeStructure(FeeStructures fs)
 {
     new AddAndUpdtFeeStructureDAL().AddFeeStructure(fs);
 }