Example #1
0
 private void BtnSelectOK_Click(object sender, EventArgs e)
 {
     if (RadioNew.Checked)
     {
         frmAppSaleManage d = new frmAppSaleManage();
         d.ShowDialog();
         if (d.DialogResult == DialogResult.OK)
         {
             ShowLvHead("");
             LvDetail.Items.Clear();
             LvWeight.Items.Clear();
         }
         BtnSelectClose_Click(sender, e);
     }
     else
     {
         String _SaleAppHeadId, dBFrom;
         if (RadioKTC.Checked)
         {
             _SaleAppHeadId = TxtSaleAppKTC.Text; TxtSaleAppKTC.Focus();
             dBFrom = "KTC";
         }
         else if (RadioShop.Checked)
         {
             _SaleAppHeadId = TxtSaleAppShop.Text; TxtSaleAppShop.Focus();
             dBFrom = "SHOP";
         }
         else
         {
             _SaleAppHeadId = TxtSaleApp7CSK.Text; TxtSaleApp7CSK.Focus();
             dBFrom = "7CSK";
         }
         frmAppSaleManage d = new frmAppSaleManage(_SaleAppHeadId, dBFrom);
         d.ShowDialog();
         if (d.DialogResult == DialogResult.OK)
         {
             ShowLvHead("");
             LvDetail.Items.Clear();
             LvWeight.Items.Clear();
             BtnSelectClose_Click(sender, e);
         }
         else if (d.DialogResult == DialogResult.No)
         {
             MessageBox.Show("ไม่พบข้อมูล !!! ", "แจ้งเตือน", MessageBoxButtons.OK, MessageBoxIcon.Information);
         }
         else
         {
             BtnSelectClose_Click(sender, e);
         }
     }
 }
Example #2
0
 private void btnEdit_Click(object sender, EventArgs e)
 {
     if (LvHead.SelectedItems.Count <= 0)
     {
         MessageBox.Show("กรุณาเลือกรายการขายที่ต้องการแก้ไข ", "การแก้ไขผิดพลาด", MessageBoxButtons.OK, MessageBoxIcon.Information);
         return;
     }
     String _SaleAppHeadId = LvHead.SelectedItems[0].SubItems[0].Text.ToString();
     if (MessageBox.Show("คุณต้องการแก้ไขข้อมูลของ " + _SaleAppHeadId, "ยืนยันการแก้ไข", MessageBoxButtons.OKCancel, MessageBoxIcon.Information) == System.Windows.Forms.DialogResult.OK)
     {
         frmAppSaleManage d = new frmAppSaleManage(_SaleAppHeadId);
         d.ShowDialog();
         if (d.DialogResult == DialogResult.OK)
         {
             ShowLvHead("");
             LvDetail.Items.Clear();
             LvWeight.Items.Clear();
         }
     }
 }