protected void Page_Load() { PageInit(); account = new account(); account.Init(jt.itake("config.naccount", "cfg")); account.UserInit(); ac.cntitle(jt.itake("default.channel_title", "lng")); string tmpstr = ""; string tType = cls.getString(request.querystring("type")); switch(tType) { case "list": tmpstr = Module_List(); break; case "detail": tmpstr = Module_Detail(); break; case "release": tmpstr = Module_Release(); break; case "edit": tmpstr = Module_Edit(); break; default: tmpstr = Module_Default(); break; } PagePrint(tmpstr); PageClose(); }
protected void Page_Load() { PageInit(); ac.cntitle(jt.itake("default.channel_title", "lng")); string tnaccount = jt.itake("config.naccount", "cfg"); account = new account(); account.Init(tnaccount); account.UserInit(); string tmpstr = ""; if (!account.checkUserLogin()) tmpstr = com.webMessages(jt.itake("global." + tnaccount + ":default.manage-error-1", "lng"), cls.getActualRoute(tnaccount) + "?type=login&backurl=" + encode.base64.encodeBase64(config.nurl)); else { string tType = cls.getString(request.querystring("type")); switch(tType) { case "action": tmpstr = Module_Action(); break; case "list": tmpstr = Module_List(); break; case "mylist": tmpstr = Module_MyList(); break; case "mydetail": tmpstr = Module_MyDetail(); break; default: tmpstr = Module_List(); break; } } PagePrint(tmpstr); PageClose(); }
protected void Page_Load() { PageInit(); PageNoCache(); account = new account(); account.Init(jt.itake("config.naccount", "cfg")); account.UserInit(); string tmpstr = ""; string tType = cls.getString(request.querystring("type")); switch(tType) { case "action": tmpstr = Module_Action(); break; case "votes": tmpstr = Module_Votes(); break; case "loadreply": tmpstr = Module_LoadReply(); break; case "loadquote": tmpstr = Module_LoadQuote(); break; case "upload": tmpstr = upfiles.uploadHTML("upload-html-2"); break; } PagePrint(tmpstr); PageClose(); }
protected void Page_Load() { PageInit(); account = new account(); account.Init(); account.UserInit(); ac.cntitle(jt.itake("default.channel_title", "lng")); string tmpstr = ""; string tType = cls.getString(request.querystring("type")); switch(tType) { case "login": tmpstr = Module_Login(); break; case "lostpassword": tmpstr = Module_Lostpassword(); break; case "register": tmpstr = Module_Register(); break; case "manage": tmpstr = Module_Manage(); break; default: tmpstr = Module_Register(); break; } PagePrint(tmpstr); PageClose(); }
public account Delete_account_select(int ID) { account = account.Select(ID); Delete_Account_ID_txt_lbl.Text = Convert.ToString(account.Account_ID); Delete_Bank_ID_txt_lbl.Text = Convert.ToString(account.Bank_ID); Delete_Account_Num_txt_lbl.Text = Convert.ToString(account.Account_Num); Delete_Type_txt_lbl.Text = Convert.ToString(account.Type); return account; }
public ActionResult Edit([Bind(Include = "idAccount,name,surname,password,nick,icon,promo,age")] account account) { if (ModelState.IsValid) { db.Entry(account).State = EntityState.Modified; db.SaveChanges(); return(RedirectToAction("Index")); } ViewBag.idAccount = new SelectList(db.ban, "account_idAccount", "date", account.idAccount); return(View(account)); }
/// <summary> /// Invoked when this page is about to be displayed in a Frame. /// </summary> /// <param name="e">Event data that describes how this page was reached. /// This parameter is typically used to configure the page.</param> protected override void OnNavigatedTo(NavigationEventArgs e) { if (e.Parameter != null) { ac = (account)e.Parameter; txtmeterno.Text = ac.meterno; txtname.Text = ac.name; txtlastreading.Text = ac.reading; txtcompliance.Text = ac.compliance; } }
private void button8_Click(object sender, EventArgs e) { try { acctFrom = Convert.ToInt64(t3acct.Text); account b = acct.Find(i => i.accountID == acctFrom); b.balance -= 120.00; label11.Text = b.name + "'s \naccount balance is now " + b.balance; } catch { int a = 22; } }
public account account_insert() { account.Bank_ID = Convert.ToInt32(Insert_Bank_ID_txt.Text); account.Account_Num = Insert_Account_Num_txt.Text; account.Type = Insert_Type_txt.Text; account = account.Insert(account); Insert_account_GridView.DataBind(); Update_account_GridView.DataBind(); Delete_account_GridView.DataBind(); return account; }
public IHttpActionResult Getaccount(int id) { account account = db.accounts.Find(id); if (account == null) { return(NotFound()); } return(Ok(account)); }
public string Register(string username, string email, string password) { Hashtable Columns = new Hashtable(); Columns.Add("username", username); Columns.Add("email", email); Columns.Add("password", password); account account = new account(); return(account.SignUp("Users", Columns)); }
[Authorize] //check xem đã đăng nhập chưa public ActionResult DeleteConfirme(int id) { account account = db.accounts.Find(id); customer customer = db.customers.Find(id); db.customers.Remove(customer); db.accounts.Remove(account); db.SaveChanges(); return(RedirectToAction("Index")); }
static void Main(string[] args) { account[] a = new account[2] { new account("abhijeet", 720000), new account("omkar", 1000000) }; a[1].deposit(200000); a[0].withdraw(50000); for (int i = 0; i < 2; i++) { a[i].disp(); } }
public async Task <IHttpActionResult> Postaccount(account account) { if (!ModelState.IsValid) { return(BadRequest(ModelState)); } db.accounts.Add(account); await db.SaveChangesAsync(); return(CreatedAtRoute("DefaultApi", new { id = account.uid }, account)); }
public ActionResult Contact() { //Aquiring the current user to display his name and profile picture in the top right corner account user = accountHelper.getCurrentUser(Session["User"].ToString()); int userId = user.id; ViewBag.userName = user.name; ViewBag.imagePath = user.imagePath; ViewBag.Message = "Your contact page."; //renderring the contact page return(View()); }
protected void Page_Load(object sender, EventArgs e) { if (Session["Email"] == null) { ClientScript.RegisterStartupScript(Page.GetType(), "validation", "<script language='javascript'>alert('Please Login first')</script>"); } else { Account = this.GetAccount(); lblbalance.Text = Account.ACCOUNT_AMOUNT.ToString(); } }
public ActionResult Create([Bind(Include = "accountname,passwords,id,levels")] account account) { if (ModelState.IsValid) { db.accounts.Add(account); db.SaveChanges(); return(RedirectToAction("Index")); } ViewBag.id = new SelectList(db.customers, "id", "username", account.id); return(View(account)); }
protected void Page_Load() { PageInit(); account = new account(); account.Init(config.ngenre + "/account"); account.UserInit(); string turl = "account/?type=manage"; if (!account.checkUserLogin()) turl = "account/?type=login"; PageClose(); Response.Redirect(turl); }
public IHttpActionResult Postaccount(account account) { if (!ModelState.IsValid) { return(BadRequest(ModelState)); } db.accounts.Add(account); db.SaveChanges(); return(CreatedAtRoute("DefaultApi", new { id = account.ID }, account)); }
public ActionResult Edit([Bind(Include = "account_id,account_name,password,Dob,phone,email,address,sex,account_date,role_id,avatar,active,falcuty_id")] account account) { if (ModelState.IsValid) { db.Entry(account).State = EntityState.Modified; db.SaveChanges(); return(RedirectToAction("Index")); } ViewBag.falcuty_id = new SelectList(db.faculties, "faculty_id", "faculty_name", account.falcuty_id); ViewBag.role_id = new SelectList(db.roles, "role_id", "role_name", account.role_id); return(View(account)); }
static void Main(string[] args) { account a = new account(1, "Vaibhav", 2000); account a1 = new account(2, "ajay", 3000); a.deposit(100); a.withdraw(200); a.display(); a1.deposit(1000); a1.withdraw(2000); a1.display(); }
public ActionResult Create([Bind(Include = "accountId,username,password,createtime,lastlogintime,islogon,empolyeeid")] account account) { if (ModelState.IsValid) { account.accountId = Guid.NewGuid(); db.accounts.Add(account); db.SaveChanges(); return(RedirectToAction("Index")); } return(View(account)); }
private void pnl_Account_Click(object sender, int idAccount) { crud_modal.Visibility = Visibility.Visible; account account = new account(); account.operationMode = cntrl.Class.clsCommon.Mode.Edit; account.accountobject = entity.db.app_account.Where(x => x.id_account == idAccount).FirstOrDefault(); //app_accountViewSource.View.MoveCurrentTo(); //account.objCollectionViewSource = app_accountViewSource; //account.entity = entity; crud_modal.Children.Add(account); }
//GET: /Account/Settings public ActionResult Settings() { account acc = db.account.Find(User.Identity.GetUserId()); ChangesToProfile model = new ChangesToProfile { lastname = acc.firstname, firstname = acc.lastname, description = acc.description }; return(View(model)); }
public RoomsViewModel(account cont) { _cont = cont; actions = new RoomActions(); if (cont.userType == "Admin") { IsAdmin = "Visible"; } else { IsAdmin = "Hidden"; } }
public dailyregister CreateRegisterEntry(account Account, registercategory Category, double Amount, DateTime EntryDate, string What) { var result = new dailyregister() { account=Account, registercategory=Category, registry_amount=Amount, registry_date = EntryDate, registry_enteredby = What }; dailyregisters.InsertOnSubmit(result); return result; }
private void btnSignUp_Click(object sender, EventArgs e) { bool b = false; //code using (QuanLyBenhVienDataContext db = new QuanLyBenhVienDataContext()) { if (txbUsername.Text == String.Empty) { MessageBox.Show("Không được để trống mục username", "Thông báo"); } if (txbPassword.Text == String.Empty) { MessageBox.Show("Không được để trống mục password", "Thông báo"); } if (txbUsername.Text != String.Empty && txbPassword.Text != String.Empty) { var a = from acc in db.accounts where acc.usernamme == txbUsername.Text select acc; if (a.Count() > 0) { MessageBox.Show("Username đã được sử dụng. Xin nhập một username khác", "Thông báo"); } else { account newAcc = new account(); newAcc.usernamme = txbUsername.Text; newAcc.password = txbPassword.Text; newAcc.tenhienthi = txbDisplayName.Text; newAcc.admin = false; db.accounts.InsertOnSubmit(newAcc); db.SubmitChanges(); b = true; } } } // effect if (b) { ptbMessage.Image = global::UI_BenhVien.Properties.Resources.icons8_checkmark_filled_50; txbMessage.Text = "Thành công!"; txbMessage.ForeColor = Color.Green; } else { ptbMessage.Image = global::UI_BenhVien.Properties.Resources.icons8_no_50; txbMessage.Text = "Không thành công!"; txbMessage.ForeColor = Color.Red; } pnlMessage.Visible = true; }
/// <summary> /// 添加用户 /// danny-20150323 /// </summary> /// <param name="account"></param> /// <returns></returns> public int AddAccount(account account) { try { string sql = @" INSERT INTO account ([Password] ,[UserName] ,[LoginName] ,[Status] ,[AccountType] ,[FADateTime] ,[FAUser] ,[LCDateTime] ,[LCUser] ,[GroupId] ,[RoleId]) VALUES (@Password ,@UserName ,@LoginName ,@Status ,@AccountType ,@FADateTime ,@FAUser ,@LCDateTime ,@LCUser ,@GroupId ,@RoleId)SELECT @@IDENTITY "; var parm = DbHelper.CreateDbParameters(); parm.AddWithValue("@Password", account.Password); parm.AddWithValue("@UserName", account.UserName); parm.AddWithValue("@LoginName", account.LoginName); parm.AddWithValue("@Status", account.Status); parm.AddWithValue("@AccountType", account.AccountType); parm.AddWithValue("@FADateTime", account.FADateTime); parm.AddWithValue("@FAUser", account.FAUser); parm.AddWithValue("@LCDateTime", account.LCDateTime); parm.AddWithValue("@LCUser", account.LCUser); parm.AddWithValue("@GroupId", account.GroupId); parm.AddWithValue("@RoleId", account.RoleId); return(ParseHelper.ToInt(DbHelper.ExecuteScalar(SuperMan_Write, sql, parm))); } catch (Exception ex) { LogHelper.LogWriter("添加用户", new { ex = ex, account = account }); return(0); throw; } }
public ActionResult IndexPost(HttpPostedFileBase img) { //get properties of book string[] category_ids = Request["category"].Split(','); string title = Request["title"]; //string img = Request["img"]; string languge = Request["language"]; string des = Request["description"]; account a = (account)Session["user"]; BookDAO bd = new BookDAO(); //add book to database bd.addBook(title, des, a.Username, languge, "img"); //get id of current book int bid = bd.getLastId(); //add all the categories of book to book_categories for (int i = 0; i < category_ids.Length - 1; i++) { int cid = Int32.Parse(category_ids[i]); bd.addCforlast(cid, bid); } AuthorDAO authorDAO = new AuthorDAO(); //check if book's author is already existed if (Request["isNewAuthor"] == null) { //add a connection between book and author int aid = Int32.Parse(Request["authorid"]); authorDAO.AddAuthorForBook(aid, bid); } else { //create new author string author_name = Request["author_name"]; string lifestory = Request["lifestory"]; string nation = Request["nation"]; string dob = DateTime.Parse(Request["dob"]).ToString("yyyy-MM-dd"); authorDAO.AddAuthor(author_name, lifestory, nation, dob); //add a connection between book and new author authorDAO.AddAuthorForBook(authorDAO.getLastId(), bid); } if (img.ContentLength > 0) { var extenstion = Path.GetExtension(img.FileName); string fileName = "i" + bid + extenstion; string savedFileName = Server.MapPath("~/assets/img/book/" + fileName); img.SaveAs(savedFileName); bd.updateBook(new book(bid, des, title, des, a, languge, fileName, DateTime.Now, 0, 0)); } return(RedirectToAction("Index", "Manage")); }
private void CreateNewAccount(staff newStaff) { var newAccount = new account() { is_active = true, pass = "******", permission_id = newStaff.permission_id, staff_id = newStaff.id, username = newStaff.phone_number }; _accountRepository.Insert(newAccount); }
public account account_update(int ID) { account = account.Select(ID); account.Account_ID = Convert.ToInt32(Update_Account_ID_txt.Text); account.Bank_ID = Convert.ToInt32(Update_Bank_ID_txt.Text); account.Account_Num = Update_Account_Num_txt.Text; account.Type = Update_Type_txt.Text; account.Update(account); Insert_account_GridView.DataBind(); Update_account_GridView.DataBind(); Delete_account_GridView.DataBind(); return(account); }
bool ktkhoa(string username) { account ac = tv.accounts.Where(t => t.username == username).SingleOrDefault(); if (ac != null) { return(true); } else { return(false); } }
public OffersViewModel(account cont) { actions = new OfferActions(); _cont = cont; actions = new OfferActions(); if (cont.userType == "Admin") { IsAdmin = "Visible"; } else { IsAdmin = "Hidden"; } }
account maxoa(string username) { account ac = tv.accounts.Where(t => t.username == username).FirstOrDefault(); if (ac != null) { return(ac); } else { return(null); } }
private void btnUpdatePassword_Click(object sender, EventArgs e) { if (dgvAccounts.SelectedRows.Count == 1) { DataGridViewRow selectedRow = dgvAccounts.SelectedRows[0]; account selectedItem = (account)selectedRow.DataBoundItem; PasswordForm form = new PasswordForm(selectedItem); if (form.ShowDialog() == DialogResult.OK) { refreshAccountData(); } } }
public JsonResult GetUserAsJSON(int?id) { //If we get sent a user id that doesn't excist we send a Json response saying that the request failed if (id == null) { return(Json(new { status = "failed" }, JsonRequestBehavior.AllowGet)); } //If how ever we get a valid id we gather info from the account service passing the userId as a variable and return a Json object with all general info about the user int usrId = Convert.ToInt32(id); account usr = usrService.getSpecificUser(usrId); return(Json(new { name = usr.name, email = usr.email, password = usr.password, roleid = usr.roleId, imagePath = usr.imagePath }, JsonRequestBehavior.AllowGet)); }
public account account_update(int ID) { account = account.Select(ID); account.Account_ID = Convert.ToInt32(Update_Account_ID_txt.Text); account.Bank_ID = Convert.ToInt32(Update_Bank_ID_txt.Text); account.Account_Num = Update_Account_Num_txt.Text; account.Type = Update_Type_txt.Text; account.Update(account); Insert_account_GridView.DataBind(); Update_account_GridView.DataBind(); Delete_account_GridView.DataBind(); return account; }
//lấy tài khoản thông qa username public account getAccountByUsername(string username) { account account = new account(); accounts.ForEach(acc => { if (acc.username == username) { account = acc; } }); return(account); }
// GET: Profile public ActionResult Index() { ManageProfileViewModel currentUser = new ManageProfileViewModel { currentUser = accountHelper.getCurrentUser(Session["User"].ToString()) }; account user = accountHelper.getCurrentUser(Session["User"].ToString()); int userId = user.id; ViewBag.userName = user.name; ViewBag.imagePath = user.imagePath; return(View(currentUser)); }
protected void Page_Load() { PageInit(); PageNoCache(); account = new account(); account.Init(jt.itake("config.naccount", "cfg")); account.UserInit(); string tmpstr = ""; string tType = cls.getString(request.querystring("type")); if (tType == "action") tmpstr = Module_Action(); PagePrint(tmpstr); PageClose(); }
protected void Page_Load() { PageInit(); PageNoCache(); account = new account(); account.Init(); account.UserInit(); string tmpstr = ""; string tType = cls.getString(request.querystring("type")); switch(tType) { case "action": tmpstr = Module_Action(); break; } PagePrint(tmpstr); PageClose(); }
protected void Page_Load() { PageInit(); PageNoCache(); admin = new admin(); admin.Init(); account = new account(); account.Init(jt.itake("config.naccount", "cfg")); if (admin.ckLogin()) { string tmpstr = ""; string tType = cls.getString(request.querystring("type")); switch(tType) { case "action": tmpstr = Module_Action(); break; case "add": tmpstr = Module_Add(); break; case "edit": tmpstr = Module_Edit(); break; case "list": tmpstr = Module_List(); break; default: tmpstr = Module_List(); break; } PagePrint(tmpstr); } PageClose(); }
public void UpdateSelectedRow(account pAccountDetail) { if (ValidationUtility.TryParseInt(gvCampaignList.GetRowCellValue(gvCampaignList.FocusedRowHandle, "account_id").ToString()) != pAccountDetail.id) return; if (gvCampaignList.RowCount < 1) return; gvCampaignList.SetRowCellValue(gvCampaignList.FocusedRowHandle, "Company_Name", pAccountDetail.company_name); gvCampaignList.SetRowCellValue(gvCampaignList.FocusedRowHandle, "Company_Telephone", pAccountDetail.telephone); gvCampaignList.SetRowCellValue(gvCampaignList.FocusedRowHandle, "Company_Employees_Total_1", pAccountDetail.employees_total); gvCampaignList.SetRowCellValue(gvCampaignList.FocusedRowHandle, "Company_Employees_Total_2", pAccountDetail.employees_total_2); gvCampaignList.SetRowCellValue(gvCampaignList.FocusedRowHandle, "Company_Employees_Total_3", pAccountDetail.employees_total_3); gvCampaignList.SetRowCellValue(gvCampaignList.FocusedRowHandle, "Company_Site", pAccountDetail.www); gvCampaignList.SetRowCellValue(gvCampaignList.FocusedRowHandle, "Company_Org_No", pAccountDetail.org_no); gvCampaignList.SetRowCellValue(gvCampaignList.FocusedRowHandle, "Company_Box_Address", pAccountDetail.box_address); gvCampaignList.SetRowCellValue(gvCampaignList.FocusedRowHandle, "Company_Street_Address", pAccountDetail.street_address); gvCampaignList.SetRowCellValue(gvCampaignList.FocusedRowHandle, "Company_Zipcode", pAccountDetail.zipcode); gvCampaignList.SetRowCellValue(gvCampaignList.FocusedRowHandle, "Company_Municipality", pAccountDetail.municipality); gvCampaignList.SetRowCellValue(gvCampaignList.FocusedRowHandle, "Company_City", pAccountDetail.city); gvCampaignList.SetRowCellValue(gvCampaignList.FocusedRowHandle, "Company_Country", pAccountDetail.country); gvCampaignList.SetRowCellValue(gvCampaignList.FocusedRowHandle, "Company_Telefax", pAccountDetail.telefax); gvCampaignList.SetRowCellValue(gvCampaignList.FocusedRowHandle, "Company_Year_Established", pAccountDetail.year_established); gvCampaignList.SetRowCellValue(gvCampaignList.FocusedRowHandle, "Parent_Company", pAccountDetail.parent_company); gvCampaignList.SetRowCellValue(gvCampaignList.FocusedRowHandle, "Company_Activity_Code", pAccountDetail.activity_code); gvCampaignList.SetRowCellValue(gvCampaignList.FocusedRowHandle, "Company_Activity_Code_2", pAccountDetail.activity_code_2); gvCampaignList.SetRowCellValue(gvCampaignList.FocusedRowHandle, "Company_Currency", pAccountDetail.currency); gvCampaignList.SetRowCellValue(gvCampaignList.FocusedRowHandle, "Company_Fiscal_1", pAccountDetail.fiscal); gvCampaignList.SetRowCellValue(gvCampaignList.FocusedRowHandle, "Company_Fiscal_2", pAccountDetail.fiscal_2); gvCampaignList.SetRowCellValue(gvCampaignList.FocusedRowHandle, "Company_Fiscal_3", pAccountDetail.fiscal_3); gvCampaignList.SetRowCellValue(gvCampaignList.FocusedRowHandle, "Company_Turnover_1", pAccountDetail.turnover); gvCampaignList.SetRowCellValue(gvCampaignList.FocusedRowHandle, "Company_Turnover_2", pAccountDetail.turnover_2); gvCampaignList.SetRowCellValue(gvCampaignList.FocusedRowHandle, "Company_Turnover_3", pAccountDetail.turnover_3); gvCampaignList.SetRowCellValue(gvCampaignList.FocusedRowHandle, "Company_Export_1", pAccountDetail.export); gvCampaignList.SetRowCellValue(gvCampaignList.FocusedRowHandle, "Company_Export_2", pAccountDetail.export_2); gvCampaignList.SetRowCellValue(gvCampaignList.FocusedRowHandle, "Company_Export_3", pAccountDetail.export_3); gvCampaignList.SetRowCellValue(gvCampaignList.FocusedRowHandle, "Company_Result_1", pAccountDetail.result); gvCampaignList.SetRowCellValue(gvCampaignList.FocusedRowHandle, "Company_Result_2", pAccountDetail.result_2); gvCampaignList.SetRowCellValue(gvCampaignList.FocusedRowHandle, "Company_Result_3", pAccountDetail.result_3); gvCampaignList.SetRowCellValue(gvCampaignList.FocusedRowHandle, "Company_Sales_Aborad_1", pAccountDetail.sales_abroad); gvCampaignList.SetRowCellValue(gvCampaignList.FocusedRowHandle, "Company_Sales_Aborad_2", pAccountDetail.sales_abroad_2); gvCampaignList.SetRowCellValue(gvCampaignList.FocusedRowHandle, "Company_Sales_Aborad_3", pAccountDetail.sales_abroad_3); gvCampaignList.SetRowCellValue(gvCampaignList.FocusedRowHandle, "Company_Category", pAccountDetail.category); gvCampaignList.SetRowCellValue(gvCampaignList.FocusedRowHandle, "Company_County", pAccountDetail.county); gvCampaignList.SetRowCellValue(gvCampaignList.FocusedRowHandle, "Company_BV Source", pAccountDetail.bv_source); gvCampaignList.SetRowCellValue(gvCampaignList.FocusedRowHandle, "Company_Regions", pAccountDetail.regions); gvCampaignList.SetRowCellValue(gvCampaignList.FocusedRowHandle, "Company_Modified", DateTime.Now.ToString("yyyy-MM-dd") + " by " + UserSession.CurrentUser.UserFullName); }
protected void UPDATE(object sender, EventArgs e) { account = account_update(Convert.ToInt32(Update_account_GridView.SelectedValue)); }
protected void Insert_Select_Record(object sender, EventArgs e) { account = Insert_account_select(Convert.ToInt32(Insert_account_GridView.SelectedValue)); }
protected void INSERT(object sender, EventArgs e) { account = account_insert(); }
protected void Update_Select_Record(object sender, EventArgs e) { account = Update_account_select(Convert.ToInt32(Update_account_GridView.SelectedValue)); }
public account Insert_account_select(int ID) { account = account.Select(ID); Insert_Bank_ID_txt.Text = Convert.ToString(account.Bank_ID); Insert_Account_Num_txt.Text = Convert.ToString(account.Account_Num); Insert_Type_txt.Text = Convert.ToString(account.Type); return account; }
/// <summary> /// Logic to save customer record /// </summary> private void SaveCompany() { var BPContext = new BrightPlatformEntities(UserSession.EntityConnection); BPContext.CommandTimeout = 0; var objAccount = new account { company_name = !string.IsNullOrEmpty(txtName.Text.Trim()) ? txtName.Text.Trim() : null, org_no = !string.IsNullOrEmpty(txtOrgNo.Text.Trim()) ? txtOrgNo.Text.Trim() : null, box_address = !string.IsNullOrEmpty(txtBoxAddress.Text.Trim()) ? txtBoxAddress.Text.Trim() : null, street_address = !string.IsNullOrEmpty(txtStreetAddress.Text.Trim()) ? txtStreetAddress.Text.Trim() : null, zipcode = !string.IsNullOrEmpty(txtZipcode.Text.Trim()) ? txtZipcode.Text.Trim() : null, country = !string.IsNullOrEmpty(txtCountry.Text.Trim()) ? txtCountry.Text.Trim() : null, county = !string.IsNullOrEmpty(txtCounty.Text.Trim()) ? txtCounty.Text.Trim() : null, municipality = !string.IsNullOrEmpty(txtMunicipality.Text.Trim()) ? txtMunicipality.Text.Trim() : null, city = !string.IsNullOrEmpty(txtCity.Text.Trim()) ? txtCity.Text.Trim() : null, telephone = !string.IsNullOrEmpty(txtTelephone.Text.Trim()) ? txtTelephone.Text.Trim() : null, telefax = !string.IsNullOrEmpty(txtTelefax.Text.Trim()) ? txtTelefax.Text.Trim() : null, www = !string.IsNullOrEmpty(txtSite.Text.Trim()) ? txtSite.Text.Trim() : null, parent_company = !string.IsNullOrEmpty(txtParentCompany.Text.Trim()) ? txtParentCompany.Text.Trim() : null, year_established = !string.IsNullOrEmpty(txtYearEstablished.Text.Trim()) ? txtYearEstablished.Text.Trim() : null, activity_code = !string.IsNullOrEmpty(txtActivityCode.Text.Trim()) ? txtActivityCode.Text.Trim() : null, activity_code_2 = !string.IsNullOrEmpty(txtActivityCode2.Text.Trim()) ? txtActivityCode2.Text.Trim() : null, currency = !string.IsNullOrEmpty(txtCurrency.Text.Trim()) ? txtCurrency.Text.Trim() : null, fiscal = !string.IsNullOrEmpty(txtFiscal1.Text.Trim()) ? txtFiscal1.Text.Trim() : null, turnover = !string.IsNullOrEmpty(txtTurnover1.Text.Trim()) ? decimal.Parse(txtTurnover1.Text.Trim()) : (decimal?) null, export = !string.IsNullOrEmpty(txtExport1.Text.Trim()) ? decimal.Parse(txtExport1.Text.Trim()) : (decimal?) null, result = !string.IsNullOrEmpty(txtResult1.Text.Trim()) ? decimal.Parse(txtResult1.Text.Trim()) : (decimal?) null, sales_abroad = !string.IsNullOrEmpty(txtSalesAbroad1.Text.Trim()) ? decimal.Parse(txtSalesAbroad1.Text.Trim()) : (decimal?)null, employees_total = !string.IsNullOrEmpty(txtEmpTotal1.Text.Trim()) ? int.Parse(txtEmpTotal1.Text.Trim()) : (int?)null, employees_abroad = !string.IsNullOrEmpty(txtEmpAbroad1.Text.Trim()) ? int.Parse(txtEmpAbroad1.Text.Trim()) : (int?)null, fiscal_2 = !string.IsNullOrEmpty(txtFiscal2.Text.Trim()) ? txtFiscal2.Text.Trim() : null, turnover_2 = !string.IsNullOrEmpty(txtTurnover2.Text.Trim()) ? decimal.Parse(txtTurnover2.Text.Trim()) : (decimal?)null, export_2 = !string.IsNullOrEmpty(txtExport2.Text.Trim()) ? decimal.Parse(txtExport2.Text.Trim()) : (decimal?)null, result_2 = !string.IsNullOrEmpty(txtResult2.Text.Trim()) ? decimal.Parse(txtResult2.Text.Trim()) : (decimal?)null, sales_abroad_2 = !string.IsNullOrEmpty(txtSalesAbroad2.Text.Trim()) ? decimal.Parse(txtSalesAbroad2.Text.Trim()) : (decimal?)null, employees_total_2 = !string.IsNullOrEmpty(txtEmpTotal2.Text.Trim()) ? int.Parse(txtEmpTotal2.Text.Trim()) : (int?)null, employees_abroad_2 = !string.IsNullOrEmpty(txtEmpAbroad2.Text.Trim()) ? int.Parse(txtEmpAbroad2.Text.Trim()) : (int?)null, fiscal_3 = !string.IsNullOrEmpty(txtFiscal3.Text.Trim()) ? txtFiscal3.Text.Trim() : null, turnover_3 = !string.IsNullOrEmpty(txtTurnover3.Text.Trim()) ? decimal.Parse(txtTurnover3.Text.Trim()) : (decimal?)null, export_3 = !string.IsNullOrEmpty(txtExport3.Text.Trim()) ? decimal.Parse(txtExport3.Text.Trim()) : (decimal?)null, result_3 = !string.IsNullOrEmpty(txtResult3.Text.Trim()) ? decimal.Parse(txtResult3.Text.Trim()) : (decimal?)null, sales_abroad_3 = !string.IsNullOrEmpty(txtSalesAbroad3.Text.Trim()) ? decimal.Parse(txtSalesAbroad3.Text.Trim()) : (decimal?)null, employees_total_3 = !string.IsNullOrEmpty(txtEmpTotal3.Text.Trim()) ? int.Parse(txtEmpTotal3.Text.Trim()) : (int?)null, employees_abroad_3 = !string.IsNullOrEmpty(txtEmpAbroad3.Text.Trim()) ? int.Parse(txtEmpAbroad3.Text.Trim()) : (int?)null, created_date = DateTime.Now, created_by = UserSession.CurrentUser.UserId, modified_date = DateTime.Now, active = true, last_modified_machine = UserSession.CurrentUser.ComputerName, last_modified_source = BrightVision.EventLog.Business.FacadeEventLog.Source_Bright_Manager_Add_Company }; BPContext.accounts.AddObject(objAccount); BPContext.SaveChanges(); //m_objParentControl.PopulateCompanyView(null, 1); m_objParentControl.PopulateCompanyView(objAccount.company_name, 1, true); this.ParentForm.Close(); }
/// <summary> /// Saves the company records /// </summary> public static void SaveCompany(CompanyInstance objParams) { BrightPlatformEntities m_objBrightPlatformEntity = new BrightPlatformEntities(UserSession.EntityConnection); account objCompany = new account() { company_name = objParams.company_name, org_no = objParams.org_no, box_address = objParams.box_address, street_address = objParams.street_address, zipcode = objParams.zip_code, city = objParams.city, country = objParams.country, telephone = objParams.telephone, telefax = objParams.telefax, www = objParams.site, year_established = objParams.year_established, parent_company = objParams.parent_company, activity_code = objParams.activity_code, //activity_code_description = objParams.activity_code_description, activity_code_2 = objParams.activity_code_2, //activity_code2_description = objParams.activity_code_2_description, currency = objParams.currency, fiscal = objParams.fiscal, //consolidated_figures = objParams.consolidated_figures, turnover = objParams.turnover, export = objParams.export, result = objParams.result, sales_abroad = objParams.sales_abroad, employees_abroad = objParams.employees_abroad, employees_total = objParams.employees_total, //net_interest_incom = objParams.net_interest_income, //gross_premiums = objParams.gross_premiums, validated = true, created_date = DateTime.Now, created_by = UserSession.CurrentUser.UserId }; m_objBrightPlatformEntity.accounts.AddObject(objCompany); m_objBrightPlatformEntity.SaveChanges(); //if (objParams.activity_code.Length > 0) // SaveActivityCode(objParams.activity_code, objParams.activity_code_description); }