Beispiel #1
0
        /// <summary>
        /// Method to Get List of FeeStrDetails
        /// </summary>
        /// <param name="argEn">FeeStrDetails Entity is an Input.</param>
        /// <returns>Returns List of FeeStrDetails</returns>
        public List <FeeStrDetailsEn> GetList(FeeStrDetailsEn argEn)
        {
            List <FeeStrDetailsEn> loEnList = new List <FeeStrDetailsEn>();
            string sqlCmd = "select * from SAS_FeeStrDetails";

            try
            {
                if (!FormHelp.IsBlank(sqlCmd))
                {
                    using (IDataReader loReader = _DatabaseFactory.ExecuteReader(Helper.GetDataBaseType,
                                                                                 DataBaseConnectionString, sqlCmd).CreateDataReader())
                    {
                        while (loReader.Read())
                        {
                            FeeStrDetailsEn loItem = LoadObject(loReader);
                            loEnList.Add(loItem);
                        }
                        loReader.Close();
                    }
                }
            }
            catch (Exception ex)
            {
                throw ex;
            }
            return(loEnList);
        }
Beispiel #2
0
        /// <summary>
        /// Method to Delete FeeStrDetails
        /// </summary>
        /// <param name="argEn">FeeStrDetails Entity is an Input.</param>
        /// <returns>Returns Boolean</returns>
        public bool Delete(FeeStrDetailsEn argEn)
        {
            bool   lbRes  = false;
            string sqlCmd = "DELETE FROM SAS_FeeStrDetails WHERE SAFS_Code = @SAFS_Code";

            try
            {
                if (!FormHelp.IsBlank(sqlCmd))
                {
                    DbCommand cmd = _DatabaseFactory.GetDbCommand(Helper.GetDataBaseType, sqlCmd, DataBaseConnectionString);
                    _DatabaseFactory.AddInParameter(ref cmd, "@SAFS_Code", DbType.String, argEn.FSCode);
                    _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);
        }
Beispiel #3
0
        /// <summary>
        /// Method to Get FeeStrDetails Entity
        /// </summary>
        /// <param name="argEn">FeeStrDetails Entity is an Input</param>
        /// <returns>Returns FeeStrDetails Entity</returns>
        public FeeStrDetailsEn GetItem(FeeStrDetailsEn argEn)
        {
            FeeStrDetailsEn loItem = new FeeStrDetailsEn();
            string          sqlCmd = "Select * FROM SAS_FeeStrDetails WHERE SAFS_Code = @SAFS_Code";

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

                    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);
        }
Beispiel #4
0
 /// <summary>
 /// Method to Check Validation
 /// </summary>
 /// <param name="argEn">FeeStrDetails Entity is as Input.</param>
 /// <returns>Returns a Boolean</returns>
 public bool IsValid(FeeStrDetailsEn argEn)
 {
     try
     {
         return(true);
     }
     catch (Exception ex)
     {
         throw ex;
     }
 }
Beispiel #5
0
 /// <summary>
 /// Method to Get FeeStrDetails Entity
 /// </summary>
 /// <param name="argEn">FeeStrDetails Entity is an Input</param>
 /// <returns>Returns FeeStrDetails Entity</returns>
 public FeeStrDetailsEn GetItem(FeeStrDetailsEn argEn)
 {
     try
     {
         FeeStrDetailsDAL loDs = new FeeStrDetailsDAL();
         return(loDs.GetItem(argEn));
     }
     catch (Exception ex)
     {
         throw ex;
     }
 }
Beispiel #6
0
 /// <summary>
 /// Method to Get List of FeeStrDetails
 /// </summary>
 /// <param name="argEn">FeeStrDetails Entity is an Input.</param>
 /// <returns>Returns List of FeeStrDetails</returns>
 public List <FeeStrDetailsEn> GetList(FeeStrDetailsEn argEn)
 {
     try
     {
         FeeStrDetailsDAL loDs = new FeeStrDetailsDAL();
         return(loDs.GetList(argEn));
     }
     catch (Exception ex)
     {
         throw ex;
     }
 }
Beispiel #7
0
        /// <summary>
        /// Method to Load FeeStrDetails Entity
        /// </summary>
        /// <param name="argReader">IDataReader Object is an Input.</param>
        /// <returns>Returns FeeStrDetails Entity</returns>
        private FeeStrDetailsEn LoadObject(IDataReader argReader)
        {
            FeeStrDetailsEn loItem = new FeeStrDetailsEn();

            loItem.FSCode   = GetValue <string>(argReader, "SAFS_Code");
            loItem.Type     = GetValue <string>(argReader, "SAFD_Type");
            loItem.FTCode   = GetValue <string>(argReader, "SAFT_Code");
            loItem.Priority = GetValue <int>(argReader, "SAFD_Priority");
            loItem.FeeFor   = GetValue <string>(argReader, "SAFD_FeeFor");
            loItem.Sem      = GetValue <int>(argReader, "SAFD_Sem");
            loItem._TaxId   = GetValue <int>(argReader, "safs_taxmode");
            return(loItem);
        }
Beispiel #8
0
        /// <summary>
        /// Method to Upate FeeStrDetails
        /// </summary>
        /// <param name="argEn">FeeStrDetails Entity is an Input.</param>
        /// <returns>Returns Boolean</returns>
        public bool Update(FeeStrDetailsEn argEn)
        {
            bool flag;

            using (TransactionScope ts = new TransactionScope())
            {
                try
                {
                    FeeStrDetailsDAL loDs = new FeeStrDetailsDAL();
                    flag = loDs.Update(argEn);
                    ts.Complete();
                }
                catch (Exception ex)
                {
                    throw ex;
                }
            }
            return(flag);
        }
Beispiel #9
0
        /// <summary>
        /// Method to Get List of FeeStrDetails
        /// </summary>
        /// <param name="argEn">FeeStrDetails Entity is an Input.FScode is an Input Property.</param>
        /// <returns>Returns List of FeeStrDetails</returns>
        public List <FeeStrDetailsEn> GetFeeSDList(FeeStrDetailsEn argEn)
        {
            List <FeeStrDetailsEn> loEnList = new List <FeeStrDetailsEn>();
            string sqlCmd = "SELECT SAS_FeeStrDetails.*, SAS_FeeTypes.SAFT_Desc FROM SAS_FeeStrDetails " +
                            "INNER JOIN SAS_FeeTypes ON SAS_FeeStrDetails.SAFT_Code = SAS_FeeTypes.SAFT_Code Where SAS_FeeStrDetails.SAFS_Code = @SAFS_Code";


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

                    using (IDataReader loReader = _DatabaseFactory.GetIDataReader(Helper.GetDataBaseType, cmd,
                                                                                  DataBaseConnectionString, sqlCmd, _DbParameterCollection).CreateDataReader())
                    {
                        while (loReader.Read())
                        {
                            FeeStrAmountDAL loFeeSAmt   = new FeeStrAmountDAL();
                            FeeStrAmountEn  loFeeSAmtEn = new FeeStrAmountEn();
                            FeeStrDetailsEn loItem      = LoadObject(loReader);
                            loItem.FeeDesc     = GetValue <string>(loReader, "SAFT_Desc");
                            loFeeSAmtEn.FSCode = loItem.FSCode;
                            loFeeSAmtEn.Type   = loItem.Type;
                            loFeeSAmtEn.FTCode = loItem.FTCode;
                            // loFeeSAmtEn.GSTAmount = loItem.gs;
                            //Getting list of feeamounts
                            loItem.ListFeeAmount = loFeeSAmt.GetFSAmtList(loFeeSAmtEn);
                            loEnList.Add(loItem);
                        }
                        loReader.Close();
                    }
                }
            }
            catch (Exception ex)
            {
                throw ex;
            }
            return(loEnList);
        }
Beispiel #10
0
        /// <summary>
        /// Method to Insert FeeStrDetails
        /// </summary>
        /// <param name="argEn">FeeStrDetails Entity is an Input.</param>
        /// <returns>Returns Boolean</returns>
        public bool Insert(FeeStrDetailsEn argEn)
        {
            bool lbRes = false;

            try
            {
                string sqlCmd = "INSERT INTO SAS_FeeStrDetails(SAFS_Code,SAFD_Type,SAFT_Code,SAFD_Priority," +
                                "SAFD_FeeFor,SAFD_Sem,safs_taxmode) VALUES (@SAFS_Code,@SAFD_Type,@SAFT_Code,@SAFD_Priority,@SAFD_FeeFor,@SAFD_Sem,@safs_taxmode) ";

                if (!FormHelp.IsBlank(sqlCmd))
                {
                    DbCommand cmd = _DatabaseFactory.GetDbCommand(Helper.GetDataBaseType, sqlCmd, DataBaseConnectionString);
                    _DatabaseFactory.AddInParameter(ref cmd, "@SAFS_Code", DbType.String, clsGeneric.NullToString(argEn.FSCode));
                    _DatabaseFactory.AddInParameter(ref cmd, "@SAFD_Type", DbType.String, clsGeneric.NullToString(argEn.Type));
                    _DatabaseFactory.AddInParameter(ref cmd, "@SAFT_Code", DbType.String, clsGeneric.NullToString(argEn.FTCode));
                    _DatabaseFactory.AddInParameter(ref cmd, "@SAFD_Priority", DbType.Int32, clsGeneric.NullToInteger(argEn.Priority));
                    _DatabaseFactory.AddInParameter(ref cmd, "@SAFD_FeeFor", DbType.String, clsGeneric.NullToString(argEn.FeeFor));
                    _DatabaseFactory.AddInParameter(ref cmd, "@SAFD_Sem", DbType.Int32, clsGeneric.NullToInteger(argEn.Sem));
                    _DatabaseFactory.AddInParameter(ref cmd, "@safs_taxmode", DbType.Int16, clsGeneric.NullToInteger(argEn._TaxId));
                    _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);
        }
Beispiel #11
0
        /// <summary>
        /// Method to Update FeeStrDetails
        /// </summary>
        /// <param name="argEn">FeeStrDetails Entity is an Input.</param>
        /// <returns>Returns Boolean</returns>
        public bool Update(FeeStrDetailsEn argEn)
        {
            bool   lbRes  = false;
            int    iOut   = 0;
            string sqlCmd = "Select count(*) as cnt From SAS_FeeStrDetails WHERE SAFS_Code = @SAFS_Code";

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

                    using (IDataReader dr = _DatabaseFactory.GetIDataReader(Helper.GetDataBaseType, cmdSel,
                                                                            DataBaseConnectionString, sqlCmd, _DbParameterCollection).CreateDataReader())
                    {
                        if (dr.Read())
                        {
                            iOut = clsGeneric.NullToInteger(dr["cnt"]);
                        }
                        if (iOut > 0)
                        {
                            throw new Exception("Record Already Exist");
                        }
                    }
                    if (iOut == 0)
                    {
                        sqlCmd = "UPDATE SAS_FeeStrDetails SET SAFS_Code = @SAFS_Code,SAFD_Type = @SAFD_Type, SAFT_Code = @SAFT_Code, SAFD_Priority = @SAFD_Priority, SAFD_FeeFor = @SAFD_FeeFor, SAFD_Sem = @SAFD_Sem,safs_taxmode=@safs_taxmode WHERE SAFS_Code = @SAFS_Code";

                        if (!FormHelp.IsBlank(sqlCmd))
                        {
                            DbCommand cmd = _DatabaseFactory.GetDbCommand(Helper.GetDataBaseType, sqlCmd, DataBaseConnectionString);
                            _DatabaseFactory.AddInParameter(ref cmd, "@SAFS_Code", DbType.String, argEn.FSCode);
                            _DatabaseFactory.AddInParameter(ref cmd, "@SAFD_Type", DbType.String, argEn.Type);
                            _DatabaseFactory.AddInParameter(ref cmd, "@SAFT_Code", DbType.String, argEn.FTCode);
                            _DatabaseFactory.AddInParameter(ref cmd, "@SAFD_Priority", DbType.Int32, argEn.Priority);
                            _DatabaseFactory.AddInParameter(ref cmd, "@SAFD_FeeFor", DbType.String, argEn.FeeFor);
                            _DatabaseFactory.AddInParameter(ref cmd, "@SAFD_Sem", DbType.Int32, argEn.Sem);
                            _DatabaseFactory.AddInParameter(ref cmd, "@safs_taxmode", DbType.Int16, argEn._TaxId);
                            _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);
        }