示例#1
0
        private static async Task XretriveProduct()
        {
            await Conopen();

            Strsql                   = "Select * from tbl_Transaction_Detail where Inv_Num='" + TranNum + "'";
            Sqlcmd.CommandText       = Strsql;
            Sqlcmd.Connection        = Cnn;
            Sqladapter.SelectCommand = Sqlcmd;
            Sqlreader                = Sqlcmd.ExecuteReader();
            DataTable dt = new DataTable();

            dt.Load(Sqlreader);
            for (int i = 0; i < dt.Rows.Count; i++)
            {
                prdid  = dt.Rows[i]["Prod_Number"].ToString();
                prdqty = Convert.ToInt32(dt.Rows[i]["qty"].ToString());
                await Xupdateproduct();
            }
            Sqlcmd.Dispose();
            Sqlreader.Close();
            Cnn.Close();
            Strsql = "";
        }
示例#2
0
        private async Task XLoadMailinfo()
        {
            Sqlcmd.Parameters.Clear();
            await Conopen();

            Strsql                   = "Select * from tbl_email_settings";
            Sqlcmd.CommandText       = Strsql;
            Sqlcmd.Connection        = Cnn;
            Sqladapter.SelectCommand = Sqlcmd;
            Sqlreader                = Sqlcmd.ExecuteReader();
            //metroComboBox1.Items.Clear();
            if (Sqlreader.Read())
            {
                _mymail     = Sqlreader.GetValue(0).ToString();
                _mypassword = Sqlreader.GetValue(1).ToString();
                _subject    = Sqlreader.GetValue(2).ToString();
                _mailmsg    = Sqlreader.GetValue(3).ToString();
            }
            Sqlcmd.Dispose();
            Sqlreader.Close();
            Cnn.Close();
            Strsql = "";
        }
示例#3
0
        private async Task XLoadLogs()
        {
            await Conopen();

            Strsql                   = "Select * from tbl_logs where u_name='" + username + "'";
            Sqlcmd.CommandText       = Strsql;
            Sqlcmd.Connection        = Cnn;
            Sqladapter.SelectCommand = Sqlcmd;
            Sqlreader                = Sqlcmd.ExecuteReader();
            listView1.Items.Clear();
            while (Sqlreader.Read())
            {
                var lvi = listView1.Items.Add(Sqlreader.GetValue(0).ToString());
                lvi.SubItems.Add(Sqlreader.GetValue(2).ToString());
                lvi.SubItems.Add(Sqlreader.GetValue(3).ToString());
                lvi.SubItems.Add(Sqlreader.GetValue(4).ToString());
                lvi.SubItems.Add(Sqlreader.GetValue(5).ToString());
            }
            Sqlcmd.Dispose();
            Sqlreader.Close();
            Cnn.Close();
            Strsql = "";
            bunifuDatepicker1.Value = Today;
        }