示例#1
0
        public Boolean updateAccountDayBookDetail(accountdaybook adb)
        {
            Boolean status   = true;
            string  utString = "";

            try
            {
                string updateSQL = "update AccountDayBookCode set BookType='" + adb.BookType +
                                   "',Status=" + adb.status + ", CurrencyID='" + adb.currencyID + "'" +
                                   " where AccountCode='" + adb.AccountCode + "'";
                utString = utString + updateSQL + Main.QueryDelimiter;
                utString = utString +
                           ActivityLogDB.PrepareActivityLogQquerString("update", "AccountDayBookCode", "", updateSQL) +
                           Main.QueryDelimiter;
                if (!UpdateTable.UT(utString))
                {
                    status = false;
                }
            }
            catch (Exception)
            {
                MessageBox.Show(this.ToString() + "-" + System.Reflection.MethodBase.GetCurrentMethod().Name + "() : Error");
                status = false;
            }
            return(status);
        }
示例#2
0
        public List <accountdaybook> getAccountDayBookDetail()
        {
            accountdaybook        adb;
            List <accountdaybook> ADBList = new List <accountdaybook>();

            try
            {
                SqlConnection conn  = new SqlConnection(Login.connString);
                string        query = "select a.AccountCode,b.Name, a.BookType,a.status,a.CreateTime,a.CreateUser,a.CurrencyID " +
                                      "from AccountDayBookCode a , AccountCode b " +
                                      " where a.AccountCode = b.AccountCode order by AccountCode";
                SqlCommand cmd = new SqlCommand(query, conn);
                conn.Open();
                SqlDataReader reader = cmd.ExecuteReader();
                while (reader.Read())
                {
                    adb             = new accountdaybook();
                    adb.AccountCode = reader.GetString(0);
                    adb.Name        = reader.GetString(1);
                    adb.BookType    = reader.GetString(2);
                    adb.status      = reader.GetInt32(3);
                    adb.CreateTime  = reader.GetDateTime(4);
                    adb.CreateUser  = reader.GetString(5);
                    adb.currencyID  = reader.GetString(6);
                    ADBList.Add(adb);
                }
                conn.Close();
            }
            catch (Exception ex)
            {
                MessageBox.Show(this.ToString() + "-" + System.Reflection.MethodBase.GetCurrentMethod().Name + "() : Error");
            }
            return(ADBList);
        }
示例#3
0
        public Boolean validateACcountDayBookDetail(accountdaybook adb)
        {
            Boolean status = true;

            try
            {
                if (adb.AccountCode.Trim().Length == 0 || adb.AccountCode == null)
                {
                    return(false);
                }
                if (adb.BookType.Trim().Length == 0 || adb.BookType == null)
                {
                    return(false);
                }
                if (adb.status == 2)
                {
                    return(false);
                }
                if (adb.currencyID.Trim().Length == 0 || adb.currencyID == null)
                {
                    return(false);
                }
            }
            catch (Exception)
            {
                MessageBox.Show(this.ToString() + "-" + System.Reflection.MethodBase.GetCurrentMethod().Name + "() : Error");
                return(false);
            }
            return(status);
        }
示例#4
0
        public Boolean insertAccountDayBookDetail(accountdaybook adb)
        {
            Boolean status   = true;
            string  utString = "";

            try
            {
                string updateSQL = "insert into AccountDayBookCode (AccountCode,BookType,CurrencyID,Status,CreateTime,CreateUser)" +
                                   " values (" +
                                   "'" + adb.AccountCode + "'," +
                                   "'" + adb.BookType + "'," +
                                   "'" + adb.currencyID + "'," +
                                   adb.status + "," +
                                   "GETDATE()" + "," +
                                   "'" + Login.userLoggedIn + "'" + ")";
                utString = utString + updateSQL + Main.QueryDelimiter;
                utString = utString +
                           ActivityLogDB.PrepareActivityLogQquerString("insert", "AccountDayBookCode", "", updateSQL) +
                           Main.QueryDelimiter;
                if (!UpdateTable.UT(utString))
                {
                    status = false;
                }
            }
            catch (Exception)
            {
                MessageBox.Show(this.ToString() + "-" + System.Reflection.MethodBase.GetCurrentMethod().Name + "() : Error");
                status = false;
            }
            return(status);
        }
示例#5
0
 public static void fillAccountCodeComboNew(ComboBox cmb, string type)
 {
     cmb.Items.Clear();
     try
     {
         AccountDayBookCodeDB  acDB     = new AccountDayBookCodeDB();
         accountdaybook        adb      = new accountdaybook();
         List <accountdaybook> ACDEtail = acDB.getAccountDayBookDetailWRTBookType(type);
         foreach (accountdaybook accode in ACDEtail)
         {
             Structures.ComboBoxItem cbitem =
                 new Structures.ComboBoxItem(accode.Name, accode.AccountCode);
             cmb.Items.Add(cbitem);
             /////cmb.Items.Add(accode.AccountCode + "-" + accode.Name);
         }
     }
     catch (Exception ex)
     {
         MessageBox.Show(System.Reflection.MethodBase.GetCurrentMethod().Name + "() : Error");
     }
 }
示例#6
0
 public static void fillAccountCodeCombo(ComboBox cmb, string type)
 {
     cmb.Items.Clear();
     try
     {
         AccountDayBookCodeDB  acDB     = new AccountDayBookCodeDB();
         accountdaybook        adb      = new accountdaybook();
         List <accountdaybook> ACDEtail = acDB.getAccountDayBookDetail();
         foreach (accountdaybook accode in ACDEtail)
         {
             if (accode.BookType.Equals(type) && accode.status == 1)
             {
                 cmb.Items.Add(accode.AccountCode + "-" + accode.Name);
             }
         }
     }
     catch (Exception ex)
     {
         MessageBox.Show(System.Reflection.MethodBase.GetCurrentMethod().Name + "() : Error");
     }
 }