public void CreateFundAccount(DataAccess.Model.Fund fund) { CMS_DataContext context = new CMS_DataContext(); var acct = new DataAccess.Account() { Id = Guid.NewGuid(), Name = fund.Account.Name, Category = fund.Account.Category, Type = fund.Account.Type, Code = null }; var fnd = new DataAccess.Fund() { ID = Guid.NewGuid(), Parent = fund.Parent.Id, AccountId = acct.Id, FundType = fund.FundType }; context.Accounts.InsertOnSubmit(acct); if (acct.Category.ToUpper() == "FUNDACTIVITY") { context.Funds.InsertOnSubmit(fnd); } context.SubmitChanges(); }
void wzdAccount_FinishButtonClick(object sender, WizardNavigationEventArgs e) { DataAccess.Security.DAccountProfile daProfile = new DataAccess.Security.DAccountProfile(); DataAccess.Security.DAccounts daAccount = new DataAccess.Security.DAccounts(); DataAccess.AccountProfile profileEntity = new DataAccess.AccountProfile(); //Profile profileEntity.Id = Guid.NewGuid(); profileEntity.FirstName = txtFname.Text; profileEntity.LastName = txtLname.Text; profileEntity.FirstName = string.Format("{0} {1}", txtFname.Text, txtLname.Text); profileEntity.Title = txtTitle.Text; profileEntity.JobTitle = txtJobTitle.Text; profileEntity.IsMale = bool.Parse(ddlSex.SelectedValue); profileEntity.IsDeleted = false; //Account if (txtPassword.Text != txtConfirmPassword.Text) { return; } DataAccess.Account acctEntity = new DataAccess.Account(); acctEntity.Id = Guid.NewGuid(); acctEntity.UserName = txtUserName.Text; acctEntity.Email = txtEmail.Text; acctEntity.Password = txtConfirmPassword.Text; acctEntity.IsDeleted = false; acctEntity.ChangePasswordOnFirstLogon = true; acctEntity.CreatedDate = DateTime.Now; //Roles List<string> roleCode = new List<string>(); roleCode = chkRoles.Items.Cast<ListItem>().Where(x => x.Selected).Select(x => x.Value).ToList(); try { daProfile.CreateAccountProfile(profileEntity); acctEntity.ProfileId = profileEntity.Id; daAccount.CreateAccount(acctEntity); daAccount.AddRoles(acctEntity.Id, roleCode); SetMessage(MessageType.Succes, "Saving Successfull",true); } catch (System.Transactions.TransactionAbortedException ex) { SetMessage(MessageType.Error, ex.Message,true); } catch (Exception ex) { SetMessage(MessageType.Error, ex.Message, true); } RedirectToReferrerUrl(); //daProfile.DeleteAccountProfile(profId.Value, false); //throw (ex); }
public ActionResult Notification() { Business.Web.INotificationBusiness notification = new Business.Web.NotificationBusiness(); DataAccess.Account account = (DataAccess.Account)Session["Account"]; NotificationViewModel model = new NotificationViewModel(); model.NotiList = notification.GetNotiListByAccountId(account.AccountId); model.UnreadNotiAmount = notification.GetNumberOfUnreadNoticationByAccountId(account.AccountId); return(PartialView(model)); }
public ActionResult Index() { IDeviceBusiness deviveBusiness = new DeviceBusiness(); Business.Web.INotificationBusiness notification = new Business.Web.NotificationBusiness(); DataAccess.Account account = (DataAccess.Account)Session["Account"]; HomeViewModel model = new HomeViewModel(); model.DeviceList = deviveBusiness.GetDeviceListByAccountId(account.AccountId); return(View(model)); }
public Guid Create(DataAccess.Model.Bank bank) { CMS_DataContext context = new CMS_DataContext(); var acct = new DataAccess.Account() { Id = Guid.NewGuid(), Name = bank.Name, Category = "BALANCE", Type = "ASSET", Code = "BANK" }; context.Accounts.InsertOnSubmit(acct); context.SubmitChanges(); return(acct.Id); }
Account() { account = new DataAccess.Account(); }