예제 #1
0
        public void tsbtii(string a, Form1 F, DevExpress.XtraGrid.Views.Grid.GridView view, string userid)
        {
            /*try
             * {*/
            Frm_ii m = new Frm_ii();

            m.myac = new Frm_ii.ac(F.refreshii);
            m.getactive(a);
            m.getuserid(userid);
            if (a == "1")
            {
                m.getrole(view.GetRowCellValue(view.FocusedRowHandle, "ID").ToString());
            }
            m.ShowDialog();

            /*}
             * catch { MessageBox.Show("Vui lòng chọn vật tư hàng hóa trước khi sửa."); }*/
        }
예제 #2
0
 public void checkii(string ac, DevExpress.XtraEditors.TextEdit a, DevExpress.XtraEditors.TextEdit b, string sql, Frm_ii F)
 {
     try
     {
         string kq = gen.GetString("select * from hamaco.dbo.InventoryItem where InventoryItemCode='" + a.Text + "'");
         MessageBox.Show("Mã vật tư, hàng hóa này đã tồn tại.", "HAMACO");
     }
     catch
     {
         gen.ExcuteNonquery(sql);
         gen.ExcuteNonquery("insert into hamaco_ta.dbo.InventoryItem select * from hamaco.dbo.InventoryItem where InventoryItemCode='" + a.Text + "'");
         gen.ExcuteNonquery("insert into hamaco_tn.dbo.InventoryItem select * from hamaco.dbo.InventoryItem where InventoryItemCode='" + a.Text + "'");
         gen.ExcuteNonquery("insert into hamaco_vithanh.dbo.InventoryItem select * from hamaco.dbo.InventoryItem where InventoryItemCode='" + a.Text + "'");
         gen.ExcuteNonquery("insert into hamaco_qlk.dbo.InventoryItem select * from hamaco.dbo.InventoryItem where InventoryItemCode='" + a.Text + "'");
         F.myac();
         F.Close();
     }
 }