Example #1
0
 /// <summary>
 /// Method to Get List of Active or Inactive FeeStucture BY StudentCategory
 /// </summary>
 /// <param name="argEn">FeeStucture Entity is an Input.FeeStryctureCode,PGCode,EffectFm and Status are Input Properties</param>
 /// <returns></returns>
 public List <FeeStructEn> GetFeeStructureList(FeeStructEn argEn)
 {
     try
     {
         FeeStructDAL loDs = new FeeStructDAL();
         return(loDs.GetFeeStructureList(argEn));
     }
     catch (Exception ex)
     {
         throw ex;
     }
 }
Example #2
0
 /// <summary>
 /// Method to Get FeeStructure Entity
 /// </summary>
 /// <param name="argEn">FeeStructure Entity is an Input</param>
 /// <returns>Returns FeeStructure Entity</returns>
 public FeeStructEn GetItem(FeeStructEn argEn)
 {
     try
     {
         FeeStructDAL loDs = new FeeStructDAL();
         return(loDs.GetItem(argEn));
     }
     catch (Exception ex)
     {
         throw ex;
     }
 }
Example #3
0
 /// <summary>
 /// Method to Check Validation
 /// </summary>
 /// <param name="argEn">FeeStructure Entity is as Input.</param>
 /// <returns>Returns a Boolean</returns>
 public bool IsValid(FeeStructEn argEn)
 {
     try
     {
         if (argEn.FeeStructureCode == null || argEn.FeeStructureCode.ToString().Length <= 0)
         {
             throw new Exception("FeeStructureCode Is Required!");
         }
         return(true);
     }
     catch (Exception ex)
     {
         throw ex;
     }
 }
Example #4
0
        /// <summary>
        /// Method to Insert FeeStructure
        /// </summary>
        /// <param name="argEn">FeeStructure Entity is an Input.</param>
        /// <returns>Returns Boolean</returns>
        public bool Insert(FeeStructEn argEn)
        {
            bool flag;

            using (TransactionScope ts = new TransactionScope())
            {
                try
                {
                    FeeStructDAL loDs = new FeeStructDAL();
                    flag = loDs.Insert(argEn);
                    ts.Complete();
                }
                catch (Exception ex)
                {
                    throw ex;
                }
            }
            return(flag);
        }
Example #5
0
        public List <FeeStructEn> GetFeeSDAmountList(FeeStructEn argEn)
        {
            List <FeeStructEn> loEnList = new List <FeeStructEn>();
//            string sqlCmd = @"
//                select fsd.safs_code, fsd.safd_type, fsd.safd_priority, fsd.safs_taxmode, ft.*,  local.safa_amount as local_amount, local.safa_gstamount as local_gstamount,
//                local.sasc_code as local_cateogry, nonlocal.safa_amount as nonlocal_amount, nonlocal.safa_gstamount as nonlocal_gstamount, nonlocal.sasc_code as nonlocal_cateogry,
//                fsd.safd_feefor, fsd.safd_sem
//                from sas_feestrdetails fsd
//                inner join sas_feetypes ft on ft.saft_code = fsd.saft_code
//                left join (select * from sas_feestramount fsa where fsa.sasc_code in ('Local', 'W') )as local on local.safs_code = fsd.safs_code and local.saft_code = fsd.saft_code and local.safd_type = fsd.safd_type
//                and local.safd_feefor = fsd.safd_feefor and local.safd_sem = fsd.safd_sem
//                left join (select * from sas_feestramount fsa where fsa.sasc_code in ('International', 'BW') )as nonlocal on nonlocal.safs_code = fsd.safs_code and nonlocal.saft_code = fsd.saft_code and  nonlocal.safd_type = fsd.safd_type
//                and nonlocal.safd_feefor = fsd.safd_feefor and nonlocal.safd_sem = fsd.safd_sem
//                where fsd.safs_code =  @SAFS_Code";

            string sqlCmd = @"
                select fsd.safs_code, fsd.safd_type, fsd.safd_priority, fsd.safs_taxmode, ft.*,  local.safa_amount as local_amount, local.safa_gstamount as local_gstamount, 
                local.sasc_code as local_cateogry, nonlocal.safa_amount as nonlocal_amount, nonlocal.safa_gstamount as nonlocal_gstamount, nonlocal.sasc_code as nonlocal_cateogry,
                fsd.safd_feefor, fsd.safd_sem, case when fsd.safd_type = 'T' then fs.safd_feebaseon else '-1' end as safd_feebaseon
                from SAS_FeeStruct fs inner join sas_feestrdetails fsd on fs.safs_code = fsd.safs_code
                inner join sas_feetypes ft on ft.saft_code = fsd.saft_code
                left join (select * from sas_feestramount fsa where fsa.sasc_code in ('Local', 'W') )as local on local.safs_code = fsd.safs_code and local.saft_code = fsd.saft_code and local.safd_type = fsd.safd_type
                and local.safd_feefor = fsd.safd_feefor and local.safd_sem = fsd.safd_sem
                left join (select * from sas_feestramount fsa where fsa.sasc_code in ('International', 'BW') )as nonlocal on nonlocal.safs_code = fsd.safs_code and nonlocal.saft_code = fsd.saft_code and  nonlocal.safd_type = fsd.safd_type
                and nonlocal.safd_feefor = fsd.safd_feefor and nonlocal.safd_sem = fsd.safd_sem
                where fsd.safs_code = @SAFS_Code order by fsd.safd_type";

            try
            {
                if (!FormHelp.IsBlank(sqlCmd))
                {
                    DbCommand cmd = _DatabaseFactory.GetDbCommand(Helper.GetDataBaseType, sqlCmd, DataBaseConnectionString);
                    _DatabaseFactory.AddInParameter(ref cmd, "@SAFS_Code", DbType.String, argEn.FeeStructureCode);
                    _DbParameterCollection = cmd.Parameters;

                    using (IDataReader loReader = _DatabaseFactory.GetIDataReader(Helper.GetDataBaseType, cmd,
                                                                                  DataBaseConnectionString, sqlCmd, _DbParameterCollection).CreateDataReader())
                    {
                        while (loReader.Read())
                        {
                            FeeStructEn loItem = new FeeStructEn();
                            loItem.FeeStructureCode   = GetValue <string>(loReader, "safs_code");
                            loItem.FTCode             = GetValue <string>(loReader, "saft_code");
                            loItem.Description        = GetValue <string>(loReader, "saft_desc");
                            loItem.LocalAmount        = GetValue <double>(loReader, "local_amount");
                            loItem.LocalGSTAmount     = GetValue <double>(loReader, "local_gstamount");
                            loItem.NonLocalAmount     = GetValue <double>(loReader, "nonlocal_amount");
                            loItem.NonLocalGSTAmount  = GetValue <double>(loReader, "nonlocal_gstamount");
                            loItem.TaxId              = GetValue <int>(loReader, "safs_taxmode");
                            loItem.NonLocalTempAmount = loItem.NonLocalAmount - loItem.NonLocalGSTAmount;
                            loItem.LocalTempAmount    = loItem.LocalAmount - loItem.LocalGSTAmount;
                            loItem.LocalCategory      = GetValue <string>(loReader, "local_cateogry");
                            loItem.NonLocalCategory   = GetValue <string>(loReader, "nonlocal_cateogry");
                            loItem.FeeType            = GetValue <string>(loReader, "safd_type");
                            loItem.Priority           = GetValue <int>(loReader, "safd_priority");
                            loItem.FeeFor             = GetValue <string>(loReader, "safd_feefor");
                            loItem.FeeDetailSem       = GetValue <int>(loReader, "safd_sem");
                            loItem.FeeBaseOn          = GetValue <string>(loReader, "safd_feebaseon");
                            loEnList.Add(loItem);
                        }
                        loReader.Close();
                    }
                }
            }
            catch (Exception ex)
            {
                throw ex;
            }
            return(loEnList);
        }