Ejemplo n.º 1
0
        /// <summary>
        /// Method to Delete FeeCharges
        /// </summary>
        /// <param name="argEn">FeeCharges Entity is an Input.</param>
        /// <returns>Returns Boolean</returns>
        public bool Delete(FeeChargesEn argEn)
        {
            bool   lbRes  = false;
            string sqlCmd = "DELETE FROM SAS_FeeCharges WHERE SAFT_Code = @SAFT_Code";

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

                    int liRowAffected = _DatabaseFactory.ExecuteNonQuery(Helper.GetDataBaseType, cmd,
                                                                         DataBaseConnectionString, sqlCmd, _DbParameterCollection);
                    if (liRowAffected > -1)
                    {
                        lbRes = true;
                    }
                    else
                    {
                        throw new Exception("Delete Failed! No Row has been updated...");
                    }
                }
            }
            catch (Exception ex)
            {
                throw ex;
            }
            return(lbRes);
        }
Ejemplo n.º 2
0
        /// <summary>
        /// Method to Get List of KokoCharges
        /// </summary>
        /// <param name="argEn">KokoCharges Entity is an Input.FTCode is an Input Property</param>
        /// <returns>Returns List of KokoCharges</returns>
        public List <FeeChargesEn> GetKokoCharges(FeeChargesEn argEn)
        {
            List <FeeChargesEn> loEnList = new List <FeeChargesEn>();
            string sqlCmd = "SELECT SAKOD_CategoryCode, SAKOD_FeeAmount, SAKO_Code,SAKOD_CategoryName FROM  SAS_KokorikulumDetails WHERE " +
                            "SAKO_Code =@SAKO_Code";

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

                    using (IDataReader loReader = _DatabaseFactory.GetIDataReader(Helper.GetDataBaseType, cmd,
                                                                                  DataBaseConnectionString, sqlCmd, _DbParameterCollection).CreateDataReader())
                    {
                        while (loReader.Read())
                        {
                            FeeChargesEn loItem = LoadObjectKoko(loReader);
                            loEnList.Add(loItem);
                        }
                        loReader.Close();
                    }
                }
            }
            catch (Exception ex)
            {
                throw ex;
            }
            return(loEnList);
        }
Ejemplo n.º 3
0
        /// <summary>
        /// Method to Get FeeCharges Entity
        /// </summary>
        /// <param name="argEn">FeeCharges Entity is an Input</param>
        /// <returns>Returns FeeCharges Entity</returns>
        public FeeChargesEn GetItem(FeeChargesEn argEn)
        {
            FeeChargesEn loItem = new FeeChargesEn();
            string       sqlCmd = "Select * FROM SAS_FeeCharges WHERE SAFT_Code = @SAFT_Code";

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

                    using (IDataReader loReader = _DatabaseFactory.GetIDataReader(Helper.GetDataBaseType, cmd,
                                                                                  DataBaseConnectionString, sqlCmd, _DbParameterCollection).CreateDataReader())
                    {
                        if (loReader != null)
                        {
                            loReader.Read();
                            loItem = LoadObject(loReader);
                        }
                        loReader.Close();
                    }
                }
            }
            catch (Exception ex)
            {
                throw ex;
            }
            return(loItem);
        }
Ejemplo n.º 4
0
        /// <summary>
        /// Method to Load FeeCharges Entity
        /// </summary>
        /// <param name="argReader">IDataReader Object is an Input.</param>
        /// <returns>Returns FeeCharges Entity</returns>
        private FeeChargesEn LoadObjectKoko(IDataReader argReader)
        {
            FeeChargesEn loItem = new FeeChargesEn();

            loItem.SCCode   = GetValue <string>(argReader, "SAKOD_CategoryCode");
            loItem.FSAmount = GetValue <double>(argReader, "SAKOD_FeeAmount");
            loItem.SCDesc   = GetValue <string>(argReader, "SAKOD_CategoryName");

            return(loItem);
        }
Ejemplo n.º 5
0
        /// <summary>
        /// Method to Load FeeCharges Entity
        /// </summary>
        /// <param name="argReader">IDataReader Object is an Input.</param>
        /// <returns>Returns FeeCharges Entity</returns>
        private FeeChargesEn LoadObject(IDataReader argReader)
        {
            FeeChargesEn loItem = new FeeChargesEn();

            loItem.FTCode   = GetValue <string>(argReader, "SAFT_Code");
            loItem.SCCode   = GetValue <string>(argReader, "SASC_Code");
            loItem.FSAmount = GetValue <double>(argReader, "SAFS_Amount");

            return(loItem);
        }
Ejemplo n.º 6
0
 /// <summary>
 /// Method to Get FeeCharges Entity
 /// </summary>
 /// <param name="argEn">FeeCharges Entity is an Input</param>
 /// <returns>Returns FeeCharges Entity</returns>
 public FeeChargesEn GetItem(FeeChargesEn argEn)
 {
     try
     {
         FeeChargesDAL loDs = new FeeChargesDAL();
         return(loDs.GetItem(argEn));
     }
     catch (Exception ex)
     {
         throw ex;
     }
 }
Ejemplo n.º 7
0
 /// <summary>
 /// Method to Get List of FeeCharges
 /// </summary>
 /// <param name="argEn">FeeCharges Entity is an Input.FTCode is an Input Property</param>
 /// <returns>Returns List of FeeCharges</returns>
 public List <KokoEn> Getkokobaru(FeeChargesEn argEn)
 {
     try
     {
         FeeChargesDAL loDs = new FeeChargesDAL();
         return(loDs.Getkokobaru(argEn));
     }
     catch (Exception ex)
     {
         throw ex;
     }
 }
Ejemplo n.º 8
0
 /// <summary>
 /// Method to Check Validation
 /// </summary>
 /// <param name="argEn">FeeCharges Entity is as Input.</param>
 /// <returns>Returns a Boolean</returns>
 public bool IsValid(FeeChargesEn argEn)
 {
     try
     {
         if (argEn.FTCode == null || argEn.FTCode.ToString().Length <= 0)
         {
             throw new Exception("FTCode Is Required!");
         }
         return(true);
     }
     catch (Exception ex)
     {
         throw ex;
     }
 }
Ejemplo n.º 9
0
        /// <summary>
        /// Method to Insert FeeCharges
        /// </summary>
        /// <param name="argEn">FeeCharges Entity is an Input.</param>
        /// <returns>Returns Boolean</returns>
        public bool Insert(FeeChargesEn argEn)
        {
            bool flag;

            using (TransactionScope ts = new TransactionScope())
            {
                try
                {
                    FeeChargesDAL loDs = new FeeChargesDAL();
                    flag = loDs.Insert(argEn);
                    ts.Complete();
                }
                catch (Exception ex)
                {
                    throw ex;
                }
            }
            return(flag);
        }
Ejemplo n.º 10
0
        /// <summary>
        /// Method to Update FeeCharges
        /// </summary>
        /// <param name="argEn">FeeCharges Entity is an Input.</param>
        /// <returns>Returns Boolean</returns>
        public bool Update(FeeChargesEn argEn)
        {
            bool   lbRes = false;
            int    iOut  = 0;
            string sqlCmd;

            try
            {
                if (iOut == 0)
                {
                    sqlCmd = "UPDATE SAS_FeeCharges SET SAFS_Amount = @SAFS_Amount,SAFS_gstamout=@SAFS_gstamout WHERE SAFT_Code = @SAFT_Code and SASC_Code = @SASC_Code";

                    if (!FormHelp.IsBlank(sqlCmd))
                    {
                        DbCommand cmd = _DatabaseFactory.GetDbCommand(Helper.GetDataBaseType, sqlCmd, DataBaseConnectionString);
                        _DatabaseFactory.AddInParameter(ref cmd, "@SAFT_Code", DbType.String, argEn.FTCode);
                        _DatabaseFactory.AddInParameter(ref cmd, "@SASC_Code", DbType.String, argEn.SCCode);
                        _DatabaseFactory.AddInParameter(ref cmd, "@SAFS_Amount", DbType.Double, argEn.FSAmount);
                        _DatabaseFactory.AddInParameter(ref cmd, "@SAFS_gstamout", DbType.Double, argEn.GSTAmount);
                        _DbParameterCollection = cmd.Parameters;

                        int liRowAffected = _DatabaseFactory.ExecuteNonQuery(Helper.GetDataBaseType, cmd,
                                                                             DataBaseConnectionString, sqlCmd, _DbParameterCollection);

                        if (liRowAffected > -1)
                        {
                            lbRes = true;
                        }
                        else
                        {
                            throw new Exception("Update Failed! No Row has been updated...");
                        }
                    }
                    //    }
                }
            }
            catch (Exception ex)
            {
                throw ex;
            }
            return(lbRes);
        }
Ejemplo n.º 11
0
        ///// <summary>
        ///// Method to Insert KokoCharges
        ///// </summary>
        ///// <param name="argEn">KokoCharges Entity is an Input.</param>
        ///// <returns>Returns Boolean</returns>
        public bool InsertKokoCharges(FeeChargesEn argEn)
        {
            bool   lbRes = false;
            int    iOut  = 0;
            string sqlCmd;

            try
            {
                if (iOut == 0)
                {
                    sqlCmd = "INSERT INTO SAS_KokorikulumDetails(SAKO_Code,SAKOD_CategoryCode,SAKOD_FeeAmount,SAKOD_CategoryName) VALUES (@SAKO_Code,@SAKOD_CategoryCode,@SAKOD_FeeAmount,@SAKOD_CategoryName) ";

                    if (!FormHelp.IsBlank(sqlCmd))
                    {
                        DbCommand cmd = _DatabaseFactory.GetDbCommand(Helper.GetDataBaseType, sqlCmd, DataBaseConnectionString);
                        _DatabaseFactory.AddInParameter(ref cmd, "@SAKO_Code", DbType.String, argEn.FTCode);
                        _DatabaseFactory.AddInParameter(ref cmd, "@SAKOD_CategoryCode", DbType.String, argEn.SCCode);
                        _DatabaseFactory.AddInParameter(ref cmd, "@SAKOD_FeeAmount", DbType.Double, argEn.FSAmount);
                        _DatabaseFactory.AddInParameter(ref cmd, "@SAKOD_CategoryName", DbType.String, argEn.SCDesc);
                        _DbParameterCollection = cmd.Parameters;

                        int liRowAffected = _DatabaseFactory.ExecuteNonQuery(Helper.GetDataBaseType, cmd,
                                                                             DataBaseConnectionString, sqlCmd, _DbParameterCollection);

                        if (liRowAffected > -1)
                        {
                            lbRes = true;
                        }
                        else
                        {
                            throw new Exception("Insertion Failed! No Row has been updated...");
                        }
                    }
                }
            }

            catch (Exception ex)
            {
                throw ex;
            }
            return(lbRes);
        }
Ejemplo n.º 12
0
        /// <summary>
        /// Method to Get List of FeeCharges
        /// </summary>
        /// <param name="argEn">FeeCharges Entity is an Input.FTCode is an Input Property</param>
        /// <returns>Returns List of FeeCharges</returns>
        public List <FeeChargesEn> GetFeeCharges(FeeChargesEn argEn)
        {
            List <FeeChargesEn> loEnList = new List <FeeChargesEn>();
            string sqlCmd = "SELECT SAS_FeeCharges.SAFT_Code, SAS_FeeCharges.SASC_Code, SAS_FeeCharges.SAFS_Amount,SAS_FeeCharges.safs_gstamout, SAS_StudentCategory.SASC_Desc " +
                            " FROM SAS_StudentCategory INNER JOIN SAS_FeeCharges ON SAS_StudentCategory.SASC_Code = SAS_FeeCharges.SASC_Code " +
                            " WHERE SAS_FeeCharges.SAFT_Code =@SAFT_Code";


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

                    using (IDataReader loReader = _DatabaseFactory.GetIDataReader(Helper.GetDataBaseType, cmd,
                                                                                  DataBaseConnectionString, sqlCmd, _DbParameterCollection).CreateDataReader())
                    {
                        while (loReader.Read())
                        {
                            FeeChargesEn loItem = LoadObject(loReader);
                            loItem.FTCode    = GetValue <string>(loReader, "SAFT_Code");
                            loItem.SCDesc    = GetValue <string>(loReader, "SASC_Desc");
                            loItem.GSTAmount = GetValue <double>(loReader, "safs_gstamout");
                            loItem.FSAmount  = GetValue <double>(loReader, "SAFS_Amount");
                            loEnList.Add(loItem);
                        }
                        loReader.Close();
                    }
                }
            }
            catch (Exception ex)
            {
                throw ex;
            }
            return(loEnList);
        }
Ejemplo n.º 13
0
        /// <summary>
        /// Method to Get List of KokoCharges
        /// </summary>
        /// <param name="argEn">KokoCharges Entity is an Input.FTCode is an Input Property</param>
        /// <returns>Returns List of KokoCharges</returns>
        public List <KokoEn> Getkokobaru(FeeChargesEn argEn)
        {
            List <KokoEn> loEnList = new List <KokoEn>();
            string        sqlCmd   = "select distinct kk.sako_code , kk.sako_description, kk.sako_status," +
                                     " local.sakod_feeamount as sakodfeeamountlocalin,local.sakod_gstin as sakodgstamountlocalin, local.sakod_feeamountout as sakodfeeamountlocalout," +
                                     " local.sakod_gstout as sakodfeegstamountlocalout, nonlocal.sakod_feeamount as sakodfeeamountinterin, nonlocal.sakod_gstin as sakodgstamountinterin, " +
                                     " nonlocal.sakod_feeamountout as sakodfeeamountinterout,nonlocal.sakod_gstout as sakodgstamountinterout, local.sakod_categorycode as LocalCategory," +
                                     " nonlocal.sakod_categorycode as NonLocalCategory,local.saft_code as saft_code,local.saft_taxmode as saft_taxmode from  sas_kokorikulum kk inner join sas_feetypes ft on ft.saft_code = saft_code left join (select saft_code,sako_code,sakod_feeamount,  sakod_feeamountout, sakod_gstin, sakod_gstout, " +
                                     " safd_type,sakod_categorycode,saft_taxmode from sas_kokorikulumdetails where sas_kokorikulumdetails.sakod_categorycode in ('W')  )as local on local.sako_code = kk.sako_code and local.saft_code = ft.saft_code" +
                                     " left join (select saft_code,sako_code,sakod_feeamount,  sakod_feeamountout, sakod_gstin, sakod_gstout,safd_type, sakod_categorycode,saft_taxmode from sas_kokorikulumdetails " +
                                     " where sas_kokorikulumdetails.sakod_categorycode in ('BW')  )as nonlocal on nonlocal.sako_code = kk.sako_code and nonlocal.saft_code = ft.saft_code WHERE kk.sako_code = @SAKO_Code";

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

                    using (IDataReader loReader = _DatabaseFactory.GetIDataReader(Helper.GetDataBaseType, cmd,
                                                                                  DataBaseConnectionString, sqlCmd, _DbParameterCollection).CreateDataReader())
                    {
                        while (loReader.Read())
                        {
                            KokoEn      loItem = new KokoEn();
                            FeeTypesDAL loDs   = new FeeTypesDAL();
                            FeeTypesEn  loEn   = new FeeTypesEn();
                            loItem.sakod_idkoko     = GetValue <int>(loReader, "saft_taxmode");
                            loItem.Code             = GetValue <string>(loReader, "sako_code");
                            loItem.Saftcode         = GetValue <string>(loReader, "saft_code");
                            loItem.LocalCategory    = GetValue <string>(loReader, "LocalCategory");
                            loItem.NonLocalCategory = GetValue <string>(loReader, "NonLocalCategory");
                            int Tax = loItem.sakod_idkoko;
                            loItem.taxmode = (GetGstMode(Tax));


                            if (loItem.taxmode == 2)
                            {
                                loItem.sakodfeeamountlocalin     = GetValue <double>(loReader, "sakodfeeamountlocalin");
                                loItem.sakodfeeamountlocalout    = GetValue <double>(loReader, "sakodfeeamountlocalout");
                                loItem.sakodgstamountlocalin     = GetValue <double>(loReader, "sakodgstamountlocalin");
                                loItem.sakodfeegstamountlocalout = GetValue <double>(loReader, "sakodfeegstamountlocalout");
                                loItem.sakodfeeamountinterin     = GetValue <double>(loReader, "sakodfeeamountinterin");
                                loItem.sakodfeeamountinterout    = GetValue <double>(loReader, "sakodfeeamountinterout");
                                loItem.sakodgstamountinterin     = GetValue <double>(loReader, "sakodgstamountinterin");
                                loItem.sakodgstamountinterout    = GetValue <double>(loReader, "sakodgstamountinterout");
                                loItem.Local_TempAmount          = loItem.sakodfeeamountlocalin - loItem.sakodgstamountlocalin;
                                loItem.LocalTempAmount           = loItem.sakodfeeamountlocalout - loItem.sakodfeegstamountlocalout;
                                loItem.Inter_TempAmount          = loItem.sakodfeeamountinterin - loItem.sakodgstamountinterin;
                                loItem.NonLocalTempAmount        = loItem.sakodfeeamountinterout - loItem.sakodgstamountinterout;
                                loItem.totalfeelocalin           = loItem.sakodfeeamountlocalin;
                                loItem.totalfeelocalout          = loItem.sakodfeeamountlocalout;
                                loItem.totalfeeinterin           = loItem.sakodfeeamountinterin;
                                loItem.totalfeeinterout          = loItem.sakodfeeamountinterout;
                            }
                            else if (loItem.taxmode == 1)
                            {
                                loItem.sakodgstamountlocalin     = GetValue <double>(loReader, "sakodgstamountlocalin");
                                loItem.sakodfeegstamountlocalout = GetValue <double>(loReader, "sakodfeegstamountlocalout");
                                loItem.sakodgstamountinterin     = GetValue <double>(loReader, "sakodgstamountinterin");
                                loItem.sakodgstamountinterout    = GetValue <double>(loReader, "sakodgstamountinterout");
                                loItem.totalfeelocalin           = GetValue <double>(loReader, "sakodfeeamountlocalin");
                                loItem.totalfeelocalout          = GetValue <double>(loReader, "sakodfeeamountlocalout");
                                loItem.totalfeeinterin           = GetValue <double>(loReader, "sakodfeeamountinterin");
                                loItem.totalfeeinterout          = GetValue <double>(loReader, "sakodfeeamountinterout");
                                loItem.sakodfeeamountlocalin     = loItem.totalfeelocalin - loItem.sakodgstamountlocalin;
                                loItem.sakodfeeamountlocalout    = loItem.totalfeelocalout - loItem.sakodfeegstamountlocalout;
                                loItem.sakodfeeamountinterin     = loItem.totalfeeinterin - loItem.sakodgstamountinterin;
                                loItem.sakodfeeamountinterout    = loItem.totalfeeinterout - loItem.sakodgstamountinterout;
                                loItem.Local_TempAmount          = loItem.totalfeelocalin - loItem.sakodgstamountlocalin;
                                loItem.LocalTempAmount           = loItem.totalfeelocalout - loItem.sakodfeegstamountlocalout;
                                loItem.Inter_TempAmount          = loItem.totalfeeinterin - loItem.sakodgstamountinterin;
                                loItem.NonLocalTempAmount        = loItem.totalfeeinterout - loItem.sakodgstamountinterout;
                            }



                            if (loItem.Saftcode != null)
                            {
                                loEnList.Add(loItem);
                            }
                        }
                        loReader.Close();
                    }
                }
            }
            catch (Exception ex)
            {
                throw ex;
            }
            return(loEnList);
        }