Пример #1
0
 public FormTaxSettingDlg(ICompany icompany, TaxLevelInfo[] taxTable, double taxStart)
 {
     this.icompany = icompany;
     this.taxTale = taxTable.ToList();
     this.taxStart = taxStart;
     InitializeComponent();
     Initialize();
 }
Пример #2
0
 private void ReadPageData()
 {
     taxStart = (double)nmeStart.Value;
     taxTale.Clear();
     foreach (DataGridViewRow row in DgvTaxTable.Rows)
     {
         TaxLevelInfo info = new TaxLevelInfo();
         info.Level = Convert.ToInt32(row.Cells[0].Value);
         info.StartAmount = Convert.ToDouble(row.Cells[1].Value);
         info.EndAmount = Convert.ToDouble(row.Cells[2].Value);
         info.TaxRate = Convert.ToDouble(row.Cells[3].Value);
         info.QuickDeduct = Convert.ToDouble(row.Cells[4].Value);
         taxTale.Add(info);
     }
 }
Пример #3
0
        public int insertTaxLevelInfo(TaxLevelInfo info, string currentUser, SqlTransaction trans)
        {
            string sqlStr = dbUtil.getSqlStatement("SQL_COMP_InsertTaxLevelInfo");

            SqlParameter[] sqlParams = TaxLevelInfoToParam(info, currentUser, true);

            try
            {
                return (int)DAO.DBAccess.ExecuteNonQuery(trans, CommandType.Text, sqlStr, sqlParams);
            }
            catch (Exception ex)
            {
                throw new DAOException("E0001", ex);
            }
        }
Пример #4
0
        private SqlParameter[] TaxLevelInfoToParam(TaxLevelInfo info, string currentUser, bool isInsertOp)
        {
            List<SqlParameter> paras = new List<SqlParameter>();
            paras.Add(new SqlParameter("@TaxLevel", SqlDbType.Int));
            paras.Add(new SqlParameter("@StartAmount", SqlDbType.Float));
            paras.Add(new SqlParameter("@EndAmount", SqlDbType.Float));
            paras.Add(new SqlParameter("@TaxRate", SqlDbType.Float));
            paras.Add(new SqlParameter("@QuickDeduct", SqlDbType.Float));
            paras.Add(new SqlParameter("@UpdateUser", SqlDbType.VarChar, 20));
            if (isInsertOp)
            {
                paras.Add(new SqlParameter("@CreateUser", SqlDbType.VarChar, 20));
            }
            paras[0].Value = info.Level;
            paras[1].Value = info.StartAmount;
            paras[2].Value = info.EndAmount;
            paras[3].Value = info.TaxRate;
            paras[4].Value = info.QuickDeduct;
            paras[5].Value = currentUser;
            if (isInsertOp)
            {
                paras[6].Value = currentUser;
            }

            return paras.ToArray();
        }
Пример #5
0
        public List<TaxLevelInfo> getAlltaxLevelInfo()
        {
            List<TaxLevelInfo> taxTable = new List<TaxLevelInfo>();

            string sqlStr = dbUtil.getSqlStatement("SQL_COMP_SearchAllTaxLevelInfo");
            DataSet searchResult = null;

            try
            {
                searchResult = DAO.DBAccess.ExecuteAdapter(DAO.DBAccess.SQLConnectionString, CommandType.Text, sqlStr, null);
                foreach (DataTable dt in searchResult.Tables)
                {
                    foreach (DataRow dr in dt.Rows)
                    {
                        TaxLevelInfo tli = new TaxLevelInfo();
                        tli.Level = Convert.ToInt32(dr["Level"]);
                        tli.StartAmount = Convert.ToDouble(dr["StartAmount"]);
                        tli.EndAmount = Convert.ToDouble(dr["EndAmount"]);
                        tli.TaxRate = Convert.ToDouble(dr["TaxRate"]);
                        tli.QuickDeduct = Convert.ToDouble(dr["QuickDeduct"]);
                        taxTable.Add(tli);
                    }
                }

                return taxTable;

            }
            catch (Exception ex)
            {
                throw new DAOException("E0001", ex);
            }
        }