Exemple #1
0
 private void neuSpread1_ActiveSheetChanging(object sender, FarPoint.Win.Spread.ActiveSheetChangingEventArgs e)
 {
     if (e.ActivatedSheetIndex != 0)
     {
         this.neuPanel1.Enabled = false;
     }
     else
     {
         this.neuPanel1.Enabled = true;
     }
 }
        private void neuSpread1_ActiveSheetChanging(object sender, FarPoint.Win.Spread.ActiveSheetChangingEventArgs e)
        {
            acctiveSheetIndex = this.neuSpread1.ActiveSheetIndex;

            int j = 0;

            for (int i = 0; i < this.ActiveSv.Rows.Count; i++)
            {
                string Flag = string.Empty;
                try
                {
                    Flag = this.ActiveSv.Cells[i, 0].Tag.ToString();
                }
                catch (Exception)
                {
                    Flag = null;
                }

                if (Flag != null)
                {
                    j++;
                }
            }

            if (j > 0)
            {
                DialogResult dr = MessageBox.Show("信息变动,是否保存", "提示", MessageBoxButtons.YesNo);

                if (dr == DialogResult.Yes)
                {
                    int returnvalue = this.SaveDrugSpecial();

                    if (returnvalue < 0)
                    {
                        isSucc = false;
                    }
                }
                else
                {
                    isSucc = true;
                }
            }
            else
            {
                isSucc = true;
            }
        }
        private void neuSpread1_ActiveSheetChanging(object sender, FarPoint.Win.Spread.ActiveSheetChangingEventArgs e)
        {
            //每次都重新绑定可以保存数据最新,不知道对不对,速度是挺慢
            switch (e.ActivatedSheetIndex)
            {
            case 0:
                this.filterType = FilterType.P;
                this.dvPharmacy = new DataView();
                this.FillPharmacy();
                this.tbFilterValue.Text = "";
                this.tbFilterValue.Focus();
                this.GetItems("0");
                break;

            case 1:
                this.filterType   = FilterType.U;
                this.dvUndrugItem = new DataView();
                this.FillUndrugItem();
                this.tbFilterValue.Text = "";
                this.tbFilterValue.Focus();
                this.GetItems("1");
                break;

            case 2:
                this.filterType = FilterType.C;
                this.dvCombo    = new DataView();
                this.FillComboItem();
                this.tbFilterValue.Text = "";
                this.tbFilterValue.Focus();
                this.GetItems("2");
                break;

            default:
                break;
            }
        }