Esempio n. 1
0
        private void New_Damage_Load(object sender, EventArgs e)
        {
            Purchase.database.DamageData damageData = new Purchase.database.DamageData();
            damageData.FnConn();
            DataTable dt1 = damageData.FillData("M", "", "spDamage");

            if (dt1.Rows.Count > 0)
            {
                int    slno = Convert.ToInt32(dt1.Rows[0][0].ToString()) + 1;
                string no   = slno + "";
                txtdamageno.Text = "RT-NO:" + no.PadLeft(5, '0');
            }
            dtpdate.EditValue = DateTime.Now;
            DataTable dt = new DataTable();

            dt.Columns.Add("slno", Type.GetType("System.Int32"));
            dt.Columns.Add("damageno", Type.GetType("System.String"));
            dt.Columns.Add("itemCode", Type.GetType("System.String"));
            dt.Columns.Add("itemName", Type.GetType("System.String"));
            dt.Columns.Add("brandName", Type.GetType("System.String"));
            dt.Columns.Add("category", Type.GetType("System.String"));
            dt.Columns.Add("realqty", Type.GetType("System.Double"));
            dt.Columns.Add("damageqty", Type.GetType("System.Double"));
            dt.Columns.Add("balanceqty", Type.GetType("System.Double"));
            dt.Columns.Add("po", Type.GetType("System.String"));
            dt.Columns.Add("mrr", Type.GetType("System.String"));
            dt.Columns.Add("reason", Type.GetType("System.String"));
            DataRow dr = dt.NewRow();

            dt.Rows.Add(dr);
            gridControl1.DataSource = dt;
            damageData.FnTrans();
        }
Esempio n. 2
0
        void loadData()
        {
            Purchase.database.DamageData damageData = new Purchase.database.DamageData();
            damageData.FnConn();
            DataTable dt = damageData.FillData("S", "", "spDamage");

            if (dt.Rows.Count > 0)
            {
                gridControl1.DataSource = dt;
            }
        }
Esempio n. 3
0
        private void barButtonItem1_ItemClick(object sender, DevExpress.XtraBars.ItemClickEventArgs e)
        {
            gridView1.RefreshData();
            DataTable source = gridControl1.DataSource as DataTable;
            DataTable dt     = new DataTable();

            dt.Clear();
            dt.Columns.Add("damageNo");
            dt.Columns.Add("date");
            dt.Columns.Add("remark");
            dt.Columns.Add("username");
            dt.Rows.Add(new object[] { txtdamageno.Text, dtpdate.Text, txtremark.Text, txtuserName.Text });
            Purchase.database.DamageData damageData = new Purchase.database.DamageData(source, dt);
            damageData.FnConn();
            damageData.fnTransactionData();
            damageData.FnTrans();
            MessageBox.Show("Damage list updated", "Alert", MessageBoxButtons.OK, MessageBoxIcon.Information);
        }
Esempio n. 4
0
 private void barButtonItem2_ItemClick(object sender, DevExpress.XtraBars.ItemClickEventArgs e)
 {
     try
     {
         Purchase.database.DamageData damageData = new Purchase.database.DamageData();
         damageData.FnConn();
         DataTable dt1 = damageData.FillData("M", "", "spDamage");
         damageData.FnTrans();
         if (dt1.Rows.Count > 0)
         {
             int    slno = Convert.ToInt32(dt1.Rows[0][0].ToString()) + 1;
             string no   = slno + "";
             txtdamageno.Text = "RT-NO:" + no.PadLeft(5, '0');
         }
         dtpdate.EditValue = DateTime.Now;
         txtremark.Text    = "";
         txtuserName.Text  = "";
     }
     catch (Exception ex) { }
 }
Esempio n. 5
0
 private void barButtonItem2_ItemClick(object sender, DevExpress.XtraBars.ItemClickEventArgs e)
 {
     try
     {
         DataTable source = gridControl1.DataSource as DataTable;
         source.Clear();
         gridControl1.DataSource = source;
         dtpdate.EditValue       = DateTime.Now;
         Purchase.database.DamageData damageData = new Purchase.database.DamageData();
         damageData.FnConn();
         DataTable dt1 = damageData.FillData("M", "", "spLost");
         damageData.FnTrans();
         if (dt1.Rows.Count > 0)
         {
             int    slno = Convert.ToInt32(dt1.Rows[0][0].ToString()) + 1;
             string no   = slno + "";
             txtlostno.Text = "LS" + no.PadLeft(5, '0');
         }
         txtremark.Text = "";
         txtuser.Text   = "";
     }
     catch (Exception ex) { }
 }