public Boolean InsertOnTable(String table, String column, String value)
        {
            Boolean flag = false;

            try
            {
                this.OpenConn();

                string SQL = "INSERT INTO " + this.schema + "." + table + "(" + column + ") VALUES (" + value + ")";
                // MessageBox.Show(SQL);
                NpgsqlCommand command = new NpgsqlCommand(SQL, conn);

                Int32 rowsaffected = command.ExecuteNonQuery();

                this.CloseConn();

                flag = true;
            }
            catch (Exception er)
            {
                flag = false;
                //MessageBox.Show(er.Message);
                // SAVE ERROR to \\RIGHTAPPS\RightApps\BALAI\Logs\dataToTransfer_<date><time>.txt--- appendln
                thisDatabase db = new thisDatabase();
                db.write_log(er.Message + "\n");
            }

            return(flag);
        }
Пример #2
0
        private void m_Holidays_Load(object sender, EventArgs e)
        {
            db = new thisDatabase();

            load_hol_type();
            disp_list();
        }
Пример #3
0
        public Main()
        {
            InitializeComponent();

            db = new thisDatabase();
            gm = new GlobalMethod();
        }
Пример #4
0
 private void m_Position_Load(object sender, EventArgs e)
 {
     gc = new GlobalClass();
     gm = new GlobalMethod();
     db = new thisDatabase();
     disp_list();
 }
 public EmailBlasting()
 {
     db  = new thisDatabase();
     gm  = new GlobalMethod();
     db2 = new thisDatabase2();
     InitializeComponent();
 }
Пример #6
0
 public SMS()
 {
     db       = new thisDatabase();
     gm       = new GlobalMethod();
     date     = new DateTime();
     portOpen = false;
     InitializeComponent();
 }
Пример #7
0
        private void m_Section_Load(object sender, EventArgs e)
        {
            gc = new GlobalClass();
            gm = new GlobalMethod();
            db = new thisDatabase();

            gc.load_dept(cbo_department);

            disp_list();
        }
        public BarcodePrintOut(String item1, String item2, String item3, int copies, int c1, int c2, int c3)
        {
            db = new thisDatabase();

            _item1      = item1;
            _item2      = item2;
            _item3      = item3;
            _noofcopies = copies;
            _c1         = c1;
            _c2         = c2;
            _c3         = c3;
        }
Пример #9
0
        public z_Notification()
        {
            InitializeComponent();

            db = new thisDatabase();
            gc = new GlobalClass();

            gc.load_branch(cbo_branch);

            this.Load            += z_Notification_Load;
            dtp_frm.ValueChanged += dateTimePicker1_ValueChanged;
            dtp_to.ValueChanged  += dateTimePicker2_ValueChanged;
        }
Пример #10
0
        public void load_paymenttype(ComboBox cbo)
        {
            try
            {
                DataTable    dt = new DataTable();
                thisDatabase db = new thisDatabase();

                dt                = db.QueryOnTableWithParams("m10", "mp_code, mp_desc", "", " ORDER BY mp_code ASC, mp_code ASC");
                cbo.DataSource    = dt;
                cbo.DisplayMember = "mp_desc";
                cbo.ValueMember   = "mp_code";
                cbo.SelectedIndex = -1;
            }
            catch (Exception) { }
        }
Пример #11
0
        public void load_outlet(ComboBox cbo)
        {
            try
            {
                DataTable    dt = new DataTable();
                thisDatabase db = new thisDatabase();

                dt                = db.QueryOnTableWithParams("outlet", "out_code, out_desc", "", " ORDER BY out_code ASC, out_code ASC");
                cbo.DataSource    = dt;
                cbo.DisplayMember = "out_desc";
                cbo.ValueMember   = "out_code";
                cbo.SelectedIndex = -1;
            }
            catch (Exception) { }
        }
Пример #12
0
        /*
         * public static int ToInt(String month)
         * {
         *  try
         *  {
         *      return DateTime.ParseExact(month, "MMMM", System.Globalization.CultureInfo.InvariantCulture).Month;
         *  }
         *  catch (Exception er)
         *  {
         *      MessageBox.Show(er.Message);
         *  }
         *
         *  return 0;
         * } */

        public void load_item_asc_desc(ComboBox cbo)
        {
            try
            {
                DataTable    dt = new DataTable();
                thisDatabase db = new thisDatabase();

                dt                = db.QueryOnTableWithParams("items", "item_code, item_desc", "", " ORDER BY item_desc ASC");
                cbo.DataSource    = dt;
                cbo.DisplayMember = "item_desc";
                cbo.ValueMember   = "item_code";
                cbo.SelectedIndex = -1;
            }
            catch (Exception) { }
        }
Пример #13
0
        public void load_charge(ComboBox cbo)
        {
            try
            {
                DataTable    dt = new DataTable();
                thisDatabase db = new thisDatabase();

                dt                = db.QueryOnTableWithParams("charge", "chg_code, chg_desc", "", " ORDER BY chg_type ASC, chg_desc ASC");
                cbo.DataSource    = dt;
                cbo.DisplayMember = "chg_desc";
                cbo.ValueMember   = "chg_code";
                cbo.SelectedIndex = -1;
            }
            catch (Exception) { }
        }
Пример #14
0
        public void load_poinvoice_nonjrnlz(ComboBox cbo)
        {
            try
            {
                DataTable    dt = new DataTable();
                thisDatabase db = new thisDatabase();

                dt                = db.QueryOnTableWithParams("pinvhd", "inv_num, inv_num || ' - ' || supl_name || ' - ' || reference AS po_desc", "jrnlz!='Y' AND cancel='N'", "ORDER BY inv_num ASC");
                cbo.DataSource    = dt;
                cbo.DisplayMember = "po_desc";
                cbo.ValueMember   = "inv_num";
                cbo.SelectedIndex = -1;
            }
            catch (Exception) { }
        }
Пример #15
0
        /*
         *
         * public void load_terms(ComboBox cbo)
         * {
         *  try
         *  {
         *      DataTable dt = new DataTable();
         *      thisDatabase db = new thisDatabase();
         *
         *      dt = db.QueryOnTableWithParams("m10", "mp_code, mp_desc", "isterms='Y' AND (cancel IS NULL OR cancel!='Y')", " ORDER BY mp_desc ASC");
         *      cbo.DataSource = dt;
         *      cbo.DisplayMember = "mp_desc";
         *      cbo.ValueMember = "mp_code";
         *      cbo.SelectedIndex = -1;
         *  }
         *  catch (Exception) { }
         * }
         *
         * public void load_vat(ComboBox cbo)
         * {
         *  try
         *  {
         *      DataTable dt = new DataTable();
         *      thisDatabase db = new thisDatabase();
         *
         *      dt = db.QueryOnTableWithParams("vat", "vat_code, vat_desc", "cancel IS NULL OR cancel!='Y'", "");
         *      cbo.DataSource = dt;
         *      cbo.DisplayMember = "vat_desc";
         *      cbo.ValueMember = "vat_code";
         *      cbo.SelectedIndex = -1;
         *  }
         *  catch (Exception) { }
         * }*/
        public void load_salesclerk(ComboBox cbo)
        {
            try
            {
                DataTable    dt = new DataTable();
                thisDatabase db = new thisDatabase();

                dt                = db.get_salesrep_list_with_canc();
                cbo.DataSource    = dt;
                cbo.DisplayMember = "rep_name";
                cbo.ValueMember   = "rep_code";
                cbo.SelectedIndex = -1;
            }
            catch (Exception) { }
        }
Пример #16
0
        public void load_supplier(ComboBox cbo)
        {
            try
            {
                DataTable    dt = new DataTable();
                thisDatabase db = new thisDatabase();

                dt                = db.QueryOnTableWithParams("m07", "c_code, c_name", "", " ORDER BY c_name ASC");
                cbo.DataSource    = dt;
                cbo.DisplayMember = "c_name";
                cbo.ValueMember   = "c_code";
                cbo.SelectedIndex = -1;
            }
            catch (Exception) { }
        }
Пример #17
0
        public void load_userfullname(ComboBox cbo)
        {
            try
            {
                DataTable    dt = new DataTable();
                thisDatabase db = new thisDatabase();

                dt                = db.QueryOnTableWithParams("x08", "uid, opr_name", "", " ORDER BY uid ASC");
                cbo.DataSource    = dt;
                cbo.DisplayMember = "opr_name";
                cbo.ValueMember   = "uid";
                cbo.SelectedIndex = -1;
            }
            catch (Exception) { }
        }
Пример #18
0
        public void load_payee(ComboBox cbo)
        {
            try
            {
                DataTable    dt = new DataTable();
                thisDatabase db = new thisDatabase();

                dt                = db.QueryOnTableWithParams("payee", "payee", "", " ORDER BY payee ASC");
                cbo.DataSource    = dt;
                cbo.DisplayMember = "payee";
                cbo.ValueMember   = "payee";
                cbo.SelectedIndex = -1;
            }
            catch (Exception) { }
        }
Пример #19
0
        //for supplier ledger
        public void load_account_for_sup_ledger(ComboBox cbo)
        {
            try
            {
                DataTable    dt = new DataTable();
                thisDatabase db = new thisDatabase();

                dt                = db.QueryOnTableWithParams("m04", "at_code, at_desc", "dr_cr='C' AND sl='Y'", " ORDER BY at_desc ASC");
                cbo.DataSource    = dt;
                cbo.DisplayMember = "at_desc";
                cbo.ValueMember   = "at_code";
                cbo.SelectedIndex = -1;
            }
            catch (Exception) { }
        }
Пример #20
0
        public void load_unit_with_desc(ComboBox cbo)
        {
            try
            {
                DataTable    dt = new DataTable();
                thisDatabase db = new thisDatabase();

                dt                = db.QueryOnTableWithParams("itmunit", "unit_id, unit_shortcode ||' - '|| unit_desc", "", " ORDER BY unit_shortcode ASC");
                cbo.DataSource    = dt;
                cbo.DisplayMember = "unit_desc";
                cbo.ValueMember   = "unit_id";
                cbo.SelectedIndex = -1;
            }
            catch (Exception) { }
        }
Пример #21
0
        public void load_stktransfer_invoice(ComboBox cbo, String whs_code)
        {
            try
            {
                DataTable    dt = new DataTable();
                thisDatabase db = new thisDatabase();

                dt                = db.QueryOnTableWithParams("rechdr", "rec_num, rec_num || ' - ' || trnx_date || ' - ' || reference  AS rec_desc", "whs_code='" + whs_code + "' AND trn_type='T' AND (cancel!='Y' OR cancel is null)", "ORDER BY rec_num ASC");
                cbo.DataSource    = dt;
                cbo.DisplayMember = "rec_desc";
                cbo.ValueMember   = "rec_num";
                cbo.SelectedIndex = -1;
            }
            catch (Exception) { }
        }
Пример #22
0
        public void load_poinvoice_return_nonjrnlz(ComboBox cbo)
        {
            try
            {
                DataTable    dt = new DataTable();
                thisDatabase db = new thisDatabase();

                dt                = db.QueryOnTableWithParams("prethdr", "pret_num, pret_num || ' - ' || reference || ' - ' || supl_name  AS pret_desc", "(jrnlz='N' OR jrnlz is null) AND cancel is null", "ORDER BY pret_num ASC");
                cbo.DataSource    = dt;
                cbo.DisplayMember = "pret_desc";
                cbo.ValueMember   = "pret_num";
                cbo.SelectedIndex = -1;
            }
            catch (Exception) { }
        }
Пример #23
0
        public void load_accountingperiod(ComboBox cbo)
        {
            try
            {
                DataTable    dt = new DataTable();
                thisDatabase db = new thisDatabase();

                dt                = db.QueryOnTableWithParams("x04", "mo, month_desc", "", " ORDER BY mo ASC");
                cbo.DataSource    = dt;
                cbo.DisplayMember = "month_desc";
                cbo.ValueMember   = "mo";
                cbo.SelectedIndex = -1;
            }
            catch (Exception) { }
        }
Пример #24
0
        public void load_category(ComboBox cbo)
        {
            try
            {
                DataTable    dt = new DataTable();
                thisDatabase db = new thisDatabase();

                dt                = db.QueryOnTableWithParams("itmgrp", "item_grp, grp_desc", "", " ORDER BY item_grp ASC");
                cbo.DataSource    = dt;
                cbo.DisplayMember = "grp_desc";
                cbo.ValueMember   = "item_grp";
                cbo.SelectedIndex = -1;
            }
            catch (Exception) { }
        }
Пример #25
0
        public void load_customer(ComboBox cbo)
        {
            try
            {
                DataTable    dt = new DataTable();
                thisDatabase db = new thisDatabase();

                dt                = db.get_customer_list();
                cbo.DataSource    = dt;
                cbo.DisplayMember = "d_name";
                cbo.ValueMember   = "d_code";
                cbo.SelectedIndex = -1;
            }
            catch (Exception) { }
        }
Пример #26
0
        public void load_brand(ComboBox cbo)
        {
            try
            {
                DataTable    dt = new DataTable();
                thisDatabase db = new thisDatabase();

                dt                = db.QueryOnTableWithParams("brand", "brd_code, brd_name", "cancel IS NULL OR cancel!='Y'", " ORDER BY brd_name ASC");
                cbo.DataSource    = dt;
                cbo.DisplayMember = "brd_name";
                cbo.ValueMember   = "brd_code";
                cbo.SelectedIndex = -1;
            }
            catch (Exception) { }
        }
Пример #27
0
        public void load_account_title_code_asc(ComboBox cbo)
        {
            try
            {
                DataTable    dt = new DataTable();
                thisDatabase db = new thisDatabase();

                dt                = db.QueryOnTableWithParams("m04", "at_code, at_desc", "", " ORDER BY at_code ASC");
                cbo.DataSource    = dt;
                cbo.DisplayMember = "at_desc";
                cbo.ValueMember   = "at_code";
                cbo.SelectedIndex = -1;
            }
            catch (Exception) { }
        }
Пример #28
0
        public void load_whouse(ComboBox cbo)
        {
            try
            {
                DataTable    dt = new DataTable();
                thisDatabase db = new thisDatabase();

                dt                = db.QueryOnTableWithParams("whouse", "whs_code, whs_desc", "", "");
                cbo.DataSource    = dt;
                cbo.DisplayMember = "whs_desc";
                cbo.ValueMember   = "whs_code";
                cbo.SelectedIndex = -1;
            }
            catch (Exception) { }
        }
Пример #29
0
        public Login()
        {
            InitializeComponent();

            try
            {
                db = new thisDatabase();

                lbl_server.Text = thisDatabase.servers;
            }
            catch (Exception er)
            {
                MessageBox.Show("Wrong Database information. \n" + er.Message);
            }
        }
Пример #30
0
        public void load_stocklocation(ComboBox cbo)
        {
            try
            {
                DataTable    dt = new DataTable();
                thisDatabase db = new thisDatabase();

                dt                = db.get_location_list();
                cbo.DataSource    = dt;
                cbo.DisplayMember = "whs_desc";
                cbo.ValueMember   = "whs_code";
                cbo.SelectedIndex = -1;
            }
            catch (Exception) { }
        }