public ServerReportAddresses()
 {
     InitializeComponent();
     oServiceTypeRep = new ServiceTypeRepository();
     oDonorRepo = new DonorRepository();
     lstServiceType = oServiceTypeRep.GetAllAsQuerable().ToList();
 }
示例#2
0
        private void btnAddData_Click(object sender, EventArgs e)
        {
            bool   checkvalidate = validation();
            string performDate   = DateTime.Now.ToString("yyyy-MM-dd");

            if (checkvalidate == false)
            {
                return;
            }

            DailyAnnaDanamModel dailyAnna = new DailyAnnaDanamModel
            {
                Name        = txtName.Text,
                PhoneNumber = txtPhoneNumber.Text,
                Gothram     = txtGothram.Text,
                VillageName = txtVillageName.Text,
                DonatedDate = performDate
            };

            TokenPrint oTokenPrint = new TokenPrint
            {
                Name        = txtName.Text,
                PhoneNumber = txtPhoneNumber.Text,
                Gothram     = txtGothram.Text,
                VillageName = txtVillageName.Text,
                DonatedDate = performDate,
                ServiceType = "Nithya Annadanam"
            };

            lstTokenPrint.Add(oTokenPrint);

            var checkIfExists = gothramRepo.checkIfGothramExists(txtGothram.Text);

            //If Gothra doesn't exist and if user has entered a Gothram
            if (checkIfExists == null && txtGothram.Text != string.Empty)
            {
                string insrtGothra = gothramRepo.insertNewGothraName(txtGothram.Text);
            }

            string strInsertStatus = dailyAnnaRepo.insertDonorInformation(dailyAnna);

            var        bindServiceType  = serviceTypeRepo.GetAllAsQuerable(10);
            List <int> serviceTypeValue = bindServiceType.Select(p => p.Cost).ToList();

            string smsMessage = "Thanks " + dailyAnna.Name + " we have recieved an amount of Rs." + serviceTypeValue[0] + "/- towards Daily Annadanam";

            if (strInsertStatus == "Success")
            {
                MessageBox.Show("Data inserted successfully.");
                oPrintHelper.PrintTokens(lstTokenPrint, this, _PrinterName, _ShowPrintPreview);
                CleareAllcontrolsRecursive();
                loadGothramAutoComplete();
                SMSHelper smsHelp = new SMSHelper();
                smsHelp.sendSMS("91" + dailyAnna.PhoneNumber, smsMessage);
                //this.Close();
            }
        }
 public DonorMasterReportUI()
 {
     InitializeComponent();
     oServiceTypeRep = new ServiceTypeRepository();
     oServiceNameRep = new ServiceNameRepository();
     oDateTypeRepository = new DateTypeRepository();
     oDonorRepository = new DonorRepository();
     oSpecialDayRepository = new SpecialDayRepository();
     oMonthsRepository = new MonthsRepository();
     oThidhiRepository = new ThidhiRepository();
     oTeluguCalendarRepository = new TeluguCalendarRepository();
     //  oPakshaRepository = new PakshaRepository();
     lstServiceType = oServiceTypeRep.GetAllAsQuerable().ToList();
     lstMonths = oMonthsRepository.GetAllAsQuerable().ToList();
     lstThidhi = oThidhiRepository.GetAllAsQuerable().ToList();
     lstDateType = oDateTypeRepository.GetAllAsQuerable().ToList();
     lstDateType.RemoveAt(0);
     lstSpecialDay = oSpecialDayRepository.GetAllAsQuerable().ToList();
     //  lstPaksha = oPakshaRepository.GetAllAsQuerable().ToList();
 }
示例#4
0
 public DonorMasterReportUI()
 {
     InitializeComponent();
     oServiceTypeRep           = new ServiceTypeRepository();
     oServiceNameRep           = new ServiceNameRepository();
     oDateTypeRepository       = new DateTypeRepository();
     oDonorRepository          = new DonorRepository();
     oSpecialDayRepository     = new SpecialDayRepository();
     oMonthsRepository         = new MonthsRepository();
     oThidhiRepository         = new ThidhiRepository();
     oTeluguCalendarRepository = new TeluguCalendarRepository();
     //  oPakshaRepository = new PakshaRepository();
     lstServiceType = oServiceTypeRep.GetAllAsQuerable().ToList();
     lstMonths      = oMonthsRepository.GetAllAsQuerable().ToList();
     lstThidhi      = oThidhiRepository.GetAllAsQuerable().ToList();
     lstDateType    = oDateTypeRepository.GetAllAsQuerable().ToList();
     lstDateType.RemoveAt(0);
     lstSpecialDay = oSpecialDayRepository.GetAllAsQuerable().ToList();
     //  lstPaksha = oPakshaRepository.GetAllAsQuerable().ToList();
 }