Beispiel #1
0
        private void btnActivate_Click(object sender, RoutedEventArgs e)
        {
            _Reg.ActivationKey     = Guid.NewGuid().ToString();
            _Reg.ActivatedBy       = "Test";
            _Reg.ActivatedDtTm     = DateTime.Now;
            _Reg.ActivatedTillDtTm = txtValidUpto.SelectedDate;
            _Reg.IsActivated       = true;
            _Reg.CompanyName       = licvm.CompanyName;
            _Reg.LicenseCount      = licvm.SystemCount;
            db.RegistrationMasters.Add(_Reg);
            db.SaveChanges();
            licvm.ActivationKey      = _Reg.ActivationKey;
            licvm.ActivationDtTm     = _Reg.ActivatedDtTm;
            licvm.ActivationUptoDtTm = _Reg.ActivatedTillDtTm;
            licvm.IsActivated        = _Reg.IsActivated;
            foreach (var item in licvm.ServiceList)
            {
                RegistrationWiseSearchTypes reg = new RegistrationWiseSearchTypes();
                reg.CreatedBy      = 1;
                reg.CreatedDtTm    = DateTime.Now;
                reg.IsActive       = true;
                reg.IsActivated    = (item.IsRequired == true) ? true : false;
                reg.RegistrationID = _Reg.RegistrationID;
                reg.IsRequired     = item.IsRequired;
                reg.SearchTypeID   = item.ServiceID;
                db.RegistrationWiseSearchTypes.Add(reg);
                db.SaveChanges();
                item.IsActivated = (item.IsRequired == true) ? true : false;
            }
            MessageBox.Show("Registration has been done;");
            MailData(licvm, _Reg.RegistrationID);
            Frame MainFrame = AppUtility.FindChild <Frame>(Application.Current.MainWindow, "MainFrame");

            MainFrame.Navigate(new System.Uri("Forms/Home.xaml", UriKind.RelativeOrAbsolute));
        }
        Int64 IRegistration.FirstTimeRegistration(string CompanyName, int LicenseCount, string EmailID, string Key, string SystemName, string MacAddress, string Name, string MobileNo, List <Service> SearchTypeList)
        {
            RegistrationMaster _Reg = new RegistrationMaster();

            _Reg.CompanyName           = CompanyName;
            _Reg.LicenseCount          = Convert.ToInt32(LicenseCount);
            _Reg.CreatedBy             = 1;
            _Reg.CreatedDtTm           = DateTime.Now;
            _Reg.EmailID               = EmailID;
            _Reg.IsActive              = true;
            _Reg.Key                   = Key;
            _Reg.SystemName            = SystemName;
            _Reg.MacAddress            = MacAddress;
            _Reg.Name                  = Name;
            _Reg.MobileNo              = MobileNo;
            _Reg.IsSentForRegistration = true;
            db.RegistrationMasters.Add(_Reg);
            db.SaveChanges();
            foreach (var item in SearchTypeList)
            {
                RegistrationWiseSearchTypes reg = new RegistrationWiseSearchTypes();
                reg.CreatedBy      = 1;
                reg.CreatedDtTm    = DateTime.Now;
                reg.IsActive       = true;
                reg.RegistrationID = _Reg.RegistrationID;
                reg.IsRequired     = item.IsRequired;
                reg.SearchTypeID   = item.ServiceID;
                db.RegistrationWiseSearchTypes.Add(reg);
                db.SaveChanges();
            }
            return(_Reg.RegistrationID);
        }