Пример #1
0
        private void btnNewSocialInsurance_Click(object sender, System.EventArgs e)
        {
            frmSocialSheet frm = new frmSocialSheet();
            //			frm.DsSocialInsurance = dsInsurance;
            //			frm.SelectedRowIndex = dsInsurance.Tables[0].Rows.Count-1;
            int lastRowIndex = dsInsurance.Tables[0].Rows.Count-1;
            if(lastRowIndex >= 0)
            {
                DataRow dr = dsInsurance.Tables[0].Rows[lastRowIndex];
                frm.DtpFromDate.Value = DateTime.Parse( dr["EndPointDate"].ToString()).AddDays(1);
                frm.DtpToDate.Value = frm.DtpFromDate.Value.AddMonths(1);
            }
            else
            {
                frm.DtpFromDate.Value = new DateTime(int.Parse(cboYear.Text),1,1);
                frm.DtpToDate.Value = frm.DtpFromDate.Value.AddMonths(1);
            }

            this.Close();
            frm.MdiParent = this.frmmain;
            frm.Show();

            //			frmSocialSheet frm = new frmSocialSheet();
            //			this.Close();
            //			frm.MdiParent = this.frmmain;
            //			frm.Show();
            //			this.Close();
        }
Пример #2
0
        private void lvwListInsurance_MouseDown(object sender, System.Windows.Forms.MouseEventArgs e)
        {
            if(e.Button == MouseButtons.Left && e.Clicks== 2)
            {
                if(lvwListInsurance.SelectedIndicies.Length > 0)
                {
                    frmSocialSheet frm = new frmSocialSheet();
                    frm.DsSocialInsurance = dsInsurance;
                    frm.SelectedRowIndex = SelectedItem;
                    this.Close();
                    frm.MdiParent = this.frmmain;
                    frm.Show();

            //					PopulateListInsuranInYear();
            //					SelectedItem = -1;
            //					tableModel1.Selections.Clear();
                }
            //				frmSocialSheet frm = new frmSocialSheet();
            //				this.Close();
            //				frm.MdiParent = this.frmmain;
            //				frm.Show();
            }
        }