Пример #1
0
        private void butAddQuarterly_Click(object sender, EventArgs e)
        {
            FormEhrQuarterlyKeyEditCust formK = new FormEhrQuarterlyKeyEditCust();

            formK.KeyCur        = new EhrQuarterlyKey();
            formK.KeyCur.PatNum = Guarantor;
            if (listKeysQuart.Count == 0)
            {
                formK.KeyCur.YearValue = DateTime.Today.Year - 2000;
                int quarter = 1;
                if (DateTime.Today.Month >= 4 && DateTime.Today.Month <= 6)
                {
                    quarter = 2;
                }
                if (DateTime.Today.Month >= 7 && DateTime.Today.Month <= 9)
                {
                    quarter = 3;
                }
                if (DateTime.Today.Month >= 10)
                {
                    quarter = 4;
                }
                formK.KeyCur.QuarterValue = quarter;
            }
            else
            {
                formK.KeyCur.PracticeName = listKeysQuart[listKeysQuart.Count - 1].PracticeName;
                formK.KeyCur.YearValue    = listKeysQuart[listKeysQuart.Count - 1].YearValue;
                formK.KeyCur.QuarterValue = listKeysQuart[listKeysQuart.Count - 1].QuarterValue + 1;
                if (formK.KeyCur.QuarterValue == 5)
                {
                    formK.KeyCur.QuarterValue = 1;
                    formK.KeyCur.YearValue++;
                }
                int monthOfQuarter = 1;
                if (formK.KeyCur.QuarterValue == 2)
                {
                    monthOfQuarter = 4;
                }
                if (formK.KeyCur.QuarterValue == 3)
                {
                    monthOfQuarter = 7;
                }
                if (formK.KeyCur.QuarterValue == 4)
                {
                    monthOfQuarter = 10;
                }
                DateTime firstDayOfQuarter   = new DateTime(2000 + formK.KeyCur.YearValue, monthOfQuarter, 1);
                DateTime earliestReleaseDate = firstDayOfQuarter.AddMonths(-1);
                if (DateTime.Today < earliestReleaseDate)
                {
                    MessageBox.Show("Warning!  Quarterly keys cannot be released more than one month in advance.");
                }
            }
            formK.KeyCur.IsNew = true;
            formK.ShowDialog();
            SecurityLogs.MakeLogEntry(Permissions.EhrKeyAdd, Guarantor, "Added quarterly key.");
            FillGridQ();
        }
Пример #2
0
        private void gridQ_CellDoubleClick(object sender, UI.ODGridClickEventArgs e)
        {
            FormEhrQuarterlyKeyEditCust formK = new FormEhrQuarterlyKeyEditCust();

            formK.KeyCur = listKeysQuart[e.Row];
            formK.ShowDialog();
            FillGridQ();
        }
Пример #3
0
 private void butAddQuarterly_Click(object sender,EventArgs e)
 {
     if(!Security.IsAuthorized(Permissions.EhrKeyAdd)){
         return;
     }
     FormEhrQuarterlyKeyEditCust formK=new FormEhrQuarterlyKeyEditCust();
     formK.KeyCur=new EhrQuarterlyKey();
     formK.KeyCur.PatNum=Guarantor;
     if(listKeysQuart.Count==0){
         formK.KeyCur.YearValue=DateTime.Today.Year-2000;
         int quarter=1;
         if(DateTime.Today.Month>=4 && DateTime.Today.Month<=6){
             quarter=2;
         }
         if(DateTime.Today.Month>=7 && DateTime.Today.Month<=9){
             quarter=3;
         }
         if(DateTime.Today.Month>=10){
             quarter=4;
         }
         formK.KeyCur.QuarterValue=quarter;
     }
     else{
         formK.KeyCur.PracticeName=listKeysQuart[listKeysQuart.Count-1].PracticeName;
         formK.KeyCur.YearValue=listKeysQuart[listKeysQuart.Count-1].YearValue;
         formK.KeyCur.QuarterValue=listKeysQuart[listKeysQuart.Count-1].QuarterValue+1;
         if(formK.KeyCur.QuarterValue==5){
             formK.KeyCur.QuarterValue=1;
             formK.KeyCur.YearValue++;
         }
         int monthOfQuarter=1;
         if(formK.KeyCur.QuarterValue==2){
             monthOfQuarter=4;
         }
         if(formK.KeyCur.QuarterValue==3){
             monthOfQuarter=7;
         }
         if(formK.KeyCur.QuarterValue==4){
             monthOfQuarter=10;
         }
         DateTime firstDayOfQuarter=new DateTime(2000+formK.KeyCur.YearValue,monthOfQuarter,1);
         DateTime earliestReleaseDate=firstDayOfQuarter.AddMonths(-1);
         if(DateTime.Today<earliestReleaseDate){
             MessageBox.Show("Warning!  Quarterly keys cannot be released more than one month in advance.");
         }
     }
     formK.KeyCur.IsNew=true;
     formK.ShowDialog();
     SecurityLogs.MakeLogEntry(Permissions.EhrKeyAdd,Guarantor,"Added quarterly key.");
     FillGridQ();
 }
Пример #4
0
		private void gridQ_CellDoubleClick(object sender,UI.ODGridClickEventArgs e) {
			FormEhrQuarterlyKeyEditCust formK=new FormEhrQuarterlyKeyEditCust();
			formK.KeyCur=listKeysQuart[e.Row];
			formK.ShowDialog();
			FillGridQ();
		}