private void buttonTransfer_Click(object sender, EventArgs e)
 {
     if (nHasStat == 0)
     {
         MessageBox.Show("����Ч����!", "��ʾ", MessageBoxButtons.OK, MessageBoxIcon.Hand, MessageBoxDefaultButton.Button1);
         return;
     }
     GetReasonForm f = new GetReasonForm("ת��");
     f.ShowDialog();
     if (f.ret != 0)
     {
         string sTyp = f.sTyp;
         string sDept = f.sDept;
         string sMan = f.sEmpNam;
         string sAddr = f.sAddr;
         string sReason = f.sReason;
         //List<string> listAssId = new List<string>();
         //for (int j = 0; j < listView1.Items.Count; j++)
         //{
         //    string sAssId = listView1.Items[j].SubItems[(int)MngIndex.assid].Text;
         //    listAssId.Add(sAssId);
         //}
         string sErr;
         bool bOK = AssChange(sTyp, sDept, sMan, sAddr, sReason, out sErr, "");
         if (bOK)
         {
             MessageBox.Show("�����ɹ���", "��ʾ", MessageBoxButtons.OK, MessageBoxIcon.Asterisk, MessageBoxDefaultButton.Button1);
             buttonClear_Click(null, null);
             buttonSyncDiff_Click(null, null);
         }
         else
         {
             MessageBox.Show("����ʧ�ܣ�\r\n" + sErr, "��ʾ", MessageBoxButtons.OK, MessageBoxIcon.Hand, MessageBoxDefaultButton.Button1);
         }
     }
 }
        private void CheckOpt()
        {
            CheckOptForm checkoptform = new CheckOptForm();
            if (listView2.FocusedItem == null) return;
            int nIndex = listView2.Items.IndexOf(listView2.FocusedItem);
            if (checkoptform.ShowDialog() == DialogResult.OK)
            {
                string sErr;
                bool bOK = false;
                if (checkoptform.sOptTyp == "�ֶ��̵�")
                {
                    bOK = checkAss(nIndex, checkoptform.sOptTyp, out sErr);
                    if (bOK)
                    {
                        MessageBox.Show("�����ɹ���", "��ʾ", MessageBoxButtons.OK, MessageBoxIcon.Asterisk, MessageBoxDefaultButton.Button1);
                        buttonSyncDiff_Click(null, null);
                    }
                    else
                    {
                        MessageBox.Show("����ʧ�ܣ�\r\n" + sErr, "��ʾ", MessageBoxButtons.OK, MessageBoxIcon.Hand, MessageBoxDefaultButton.Button1);
                    }
                }
                else if (checkoptform.sOptTyp == "����" || checkoptform.sOptTyp == "��ʧ")
                {
                    GetReasonForm f = new GetReasonForm(checkoptform.sOptTyp);
                    f.ShowDialog();
                    if (f.ret != 0)
                    {
                        string sTyp = f.sTyp;
                        string sDept = f.sDept;
                        string sMan = f.sEmpNam;
                        string sAddr = f.sAddr;
                        string sReason = f.sReason;
                        //List<string> listAssId = new List<string>();
                        string sPid = listView2.Items[nIndex].SubItems[ChkIndex.pid].Text;
                        //string sAssId = listView2.Items[nIndex].SubItems[ChkIndex.assid].Text;
                        //listAssId.Add(sAssId);
                        bOK = AssChange(sTyp, sDept, sMan, sAddr, sReason, out sErr, sPid);

                        if (bOK)
                        {
                            bOK = checkAss(nIndex, checkoptform.sOptTyp, out sErr);
                        }

                        if (bOK)
                        {
                            MessageBox.Show("�����ɹ���", "��ʾ", MessageBoxButtons.OK, MessageBoxIcon.Asterisk, MessageBoxDefaultButton.Button1);
                            buttonSyncDiff_Click(null, null);
                        }
                        else
                        {
                            MessageBox.Show("����ʧ�ܣ�\r\n" + sErr, "��ʾ", MessageBoxButtons.OK, MessageBoxIcon.Hand, MessageBoxDefaultButton.Button1);
                        }
                    }//GetReasonForm
                }//f.sOptTyp
            }//f.ShowDialog()
        }