Esempio n. 1
0
        public Int32 Save(DenominationDetails Details)
        {
            try
            {
                string SQL = "CALL procSaveDenomination(@DenominationID, @DenominationCode, @DenominationValue, @ImagePath, @CreatedOn, @LastModified);";

                MySqlCommand cmd = new MySqlCommand();
                cmd.CommandType = System.Data.CommandType.Text;
                cmd.CommandText = SQL;

                cmd.Parameters.AddWithValue("DenominationID", Details.DenominationID);
                cmd.Parameters.AddWithValue("DenominationCode", Details.DenominationCode);
                cmd.Parameters.AddWithValue("DenominationValue", Details.DenominationValue);
                cmd.Parameters.AddWithValue("ImagePath", Details.ImagePath);
                cmd.Parameters.AddWithValue("CreatedOn", Details.CreatedOn == DateTime.MinValue ? Constants.C_DATE_MIN_VALUE : Details.CreatedOn);
                cmd.Parameters.AddWithValue("LastModified", Details.LastModified == DateTime.MinValue ? Constants.C_DATE_MIN_VALUE : Details.LastModified);

                return base.ExecuteNonQuery(cmd);
            }

            catch (Exception ex)
            {
                throw base.ThrowException(ex);
            }
        }
Esempio n. 2
0
        public Int32 Save(DenominationDetails Details)
        {
            try
            {
                string SQL = "CALL procSaveDenomination(@DenominationID, @DenominationCode, @DenominationValue, @ImagePath, @CreatedOn, @LastModified);";

                MySqlCommand cmd = new MySqlCommand();
                cmd.CommandType = System.Data.CommandType.Text;
                cmd.CommandText = SQL;

                cmd.Parameters.AddWithValue("DenominationID", Details.DenominationID);
                cmd.Parameters.AddWithValue("DenominationCode", Details.DenominationCode);
                cmd.Parameters.AddWithValue("DenominationValue", Details.DenominationValue);
                cmd.Parameters.AddWithValue("ImagePath", Details.ImagePath);
                cmd.Parameters.AddWithValue("CreatedOn", Details.CreatedOn == DateTime.MinValue ? Constants.C_DATE_MIN_VALUE : Details.CreatedOn);
                cmd.Parameters.AddWithValue("LastModified", Details.LastModified == DateTime.MinValue ? Constants.C_DATE_MIN_VALUE : Details.LastModified);

                return(base.ExecuteNonQuery(cmd));
            }

            catch (Exception ex)
            {
                throw base.ThrowException(ex);
            }
        }
Esempio n. 3
0
        public System.Data.DataTable ListAsDataTable(DenominationDetails clsSearchKey, string SortField = "DenominationValue", SortOption SortOrder = SortOption.Desscending, Int32 limit = 0)
        {
            MySqlCommand cmd = new MySqlCommand();

            cmd.CommandType = System.Data.CommandType.Text;

            string SQL = SQLSelect() + "WHERE 1= 1 ";

            if (clsSearchKey.DenominationID != 0)
            {
                SQL += "AND DenominationID = @DenominationID ";
                cmd.Parameters.AddWithValue("@DenominationID", clsSearchKey.DenominationID);
            }
            if (!string.IsNullOrEmpty(clsSearchKey.DenominationCode))
            {
                SQL += "AND DenominationCode = @DenominationCode ";
                cmd.Parameters.AddWithValue("@DenominationCode", clsSearchKey.DenominationCode);
            }

            SQL += "ORDER BY " + SortField + " ";
            SQL += SortOrder == SortOption.Ascending ? "ASC " : "DESC ";
            SQL += limit == 0 ? "" : "LIMIT " + limit.ToString() + " ";

            cmd.CommandText = SQL;
            string strDataTableName = "tbl" + this.GetType().FullName.Split(new Char[] { '.' })[this.GetType().FullName.Split(new Char[] { '.' }).Length - 1]; System.Data.DataTable dt = new System.Data.DataTable(strDataTableName);

            base.MySqlDataAdapterFill(cmd, dt);

            return(dt);
        }
Esempio n. 4
0
        public DenominationDetails Details(Int32 DenominationID)
        {
            try
            {
                MySqlCommand cmd = new MySqlCommand();
                cmd.CommandType = System.Data.CommandType.Text;

                string SQL = SQLSelect() + "WHERE DenominationID = @DenominationID ";

                cmd.Parameters.AddWithValue("@DenominationID", DenominationID);

                cmd.CommandText = SQL;
                string strDataTableName = "tbl" + this.GetType().FullName.Split(new Char[] { '.' })[this.GetType().FullName.Split(new Char[] { '.' }).Length - 1]; System.Data.DataTable dt = new System.Data.DataTable(strDataTableName);
                base.MySqlDataAdapterFill(cmd, dt);

                DenominationDetails Details = new DenominationDetails();
                foreach (System.Data.DataRow dr in dt.Rows)
                {
                    Details.DenominationID    = Int32.Parse(dr["DenominationID"].ToString());
                    Details.DenominationCode  = dr["DenominationCode"].ToString();
                    Details.DenominationValue = decimal.Parse(dr["DenominationCode"].ToString());
                    Details.ImagePath         = dr["ImagePath"].ToString();
                }

                return(Details);
            }
            catch (Exception ex)
            {
                throw base.ThrowException(ex);
            }
        }
Esempio n. 5
0
		public void Update(DenominationDetails Details)
		{
			try 
			{
                Save(Details);
			}
			catch (Exception ex)
			{
				throw base.ThrowException(ex);
			}	
		}
Esempio n. 6
0
 public void Update(DenominationDetails Details)
 {
     try
     {
         Save(Details);
     }
     catch (Exception ex)
     {
         throw base.ThrowException(ex);
     }
 }
Esempio n. 7
0
		public Int32 Insert(DenominationDetails Details)
		{
			try 
			{
                Save(Details);

                return Int32.Parse(base.getLAST_INSERT_ID(this));
			}
			catch (Exception ex)
			{
				throw base.ThrowException(ex);
			}	
		}
Esempio n. 8
0
        public Int32 Insert(DenominationDetails Details)
        {
            try
            {
                Save(Details);

                return(Int32.Parse(base.getLAST_INSERT_ID(this)));
            }
            catch (Exception ex)
            {
                throw base.ThrowException(ex);
            }
        }
Esempio n. 9
0
        public System.Data.DataTable ListAsDataTable(DenominationDetails clsSearchKey, string SortField = "DenominationValue", SortOption SortOrder = SortOption.Desscending, Int32 limit = 0)
        {
            MySqlCommand cmd = new MySqlCommand();
            cmd.CommandType = System.Data.CommandType.Text;

            string SQL = SQLSelect() + "WHERE 1= 1 ";

            if (clsSearchKey.DenominationID !=0 )
            {
                SQL += "AND DenominationID = @DenominationID ";
                cmd.Parameters.AddWithValue("@DenominationID", clsSearchKey.DenominationID);
            }
            if (!string.IsNullOrEmpty(clsSearchKey.DenominationCode))
            {
                SQL += "AND DenominationCode = @DenominationCode ";
                cmd.Parameters.AddWithValue("@DenominationCode", clsSearchKey.DenominationCode);
            }

            SQL += "ORDER BY " + SortField + " ";
            SQL += SortOrder == SortOption.Ascending ? "ASC " : "DESC ";
            SQL += limit == 0 ? "" : "LIMIT " + limit.ToString() + " ";

            cmd.CommandText = SQL;
            string strDataTableName = "tbl" + this.GetType().FullName.Split(new Char[] { '.' })[this.GetType().FullName.Split(new Char[] { '.' }).Length - 1]; System.Data.DataTable dt = new System.Data.DataTable(strDataTableName);
            base.MySqlDataAdapterFill(cmd, dt);

            return dt;
        }
Esempio n. 10
0
		public DenominationDetails Details(Int32 DenominationID)
		{
			try
			{
                MySqlCommand cmd = new MySqlCommand();
                cmd.CommandType = System.Data.CommandType.Text;

                string SQL = SQLSelect() + "WHERE DenominationID = @DenominationID ";

                cmd.Parameters.AddWithValue("@DenominationID", DenominationID);

                cmd.CommandText = SQL;
                string strDataTableName = "tbl" + this.GetType().FullName.Split(new Char[] { '.' })[this.GetType().FullName.Split(new Char[] { '.' }).Length - 1]; System.Data.DataTable dt = new System.Data.DataTable(strDataTableName);
                base.MySqlDataAdapterFill(cmd, dt);

				DenominationDetails Details = new DenominationDetails();
                foreach (System.Data.DataRow dr in dt.Rows)
				{
					Details.DenominationID = Int32.Parse(dr["DenominationID"].ToString());
					Details.DenominationCode = dr["DenominationCode"].ToString();
                    Details.DenominationValue = decimal.Parse(dr["DenominationCode"].ToString());
					Details.ImagePath = dr["ImagePath"].ToString();
				}

				return Details;
			}
			catch (Exception ex)
			{
				throw base.ThrowException(ex);
			}	
		}