protected void Page_Load(object sender, EventArgs e) { if (Session["Customer"] == null) { Response.Redirect("login.aspx?to=OrderAddr.aspx"); return; } m_Customer = (CCustomer)Session["Customer"]; if (Session["Order"] != null) { m_Order = (COrder)Session["Order"]; } string delid = Request["delid"]; if (!string.IsNullOrEmpty(delid)) { m_Order.OrderDetailMgr.Delete(new Guid(delid)); } if (!IsPostBack) { LoadProvince(); CAccount account = (CAccount)m_Customer.AccountMgr.GetFirstObj(); lbAccount.Text = account.Score.ToString(); } }
public ActionResult LogInForm(string uname, string pass) { string user_name = uname; string password = pass; CAccount temp = CAccount.GetCAccountBy_user_name_and_password(user_name, password); if (temp != null) { if (temp.is_admin == 0) { HttpContext.Session.SetInt32("uid", temp.id); return(RedirectToAction("Index", "UserDashBoard")); } else { ViewBag.Message1 = "Sorry ! Only For Users !"; return(View("LogIn")); } } else { ViewBag.Message = "UserName or Password Incorrect !"; return(View("LogIn")); } }
protected void AddAcc_Click(object sender, EventArgs e) { try { CAccount c = new CAccount(AccNametxt.Text, AccNumtxt.Text, OCreditortxt.Text, companyStxt.Text, AccTypetxt.Text, DateOpentxt.Value, AccStatustxt.Text, Pstatustxt.Text, supdatetxt.Value, Balancetxt.Text, BUpdate.Value, creditLimittxt.Text, MonthlyPaymenttxt.Text, PDAmounttxt.Text, HBalancetxt.Text, OBalancetxt.Text, Termstxt.Text, Responsibilitytxt.Text, Statmenttxt.Text, Commentstxt.Text, "Open", "0"); loan.AddAccount(c); l.CAccList.Add(c); popAccs(); AccNametxt.Text = ""; OCreditortxt.Text = ""; AccTypetxt.Text = ""; supdatetxt.Value = ""; BUpdate.Value = ""; MonthlyPaymenttxt.Text = ""; HBalancetxt.Text = ""; Responsibilitytxt.Text = ""; AccNumtxt.Text = ""; companyStxt.Text = ""; DateOpentxt.Value = ""; Pstatustxt.Text = ""; Balancetxt.Text = ""; creditLimittxt.Text = ""; PDAmounttxt.Text = ""; Termstxt.Text = ""; Statmenttxt.Text = ""; Commentstxt.Text = ""; OBalancetxt.Text = ""; AddAcc.Text = "Add"; } catch (Exception ex) { error2.Text = ex.Message.Split('@')[0]; } }
public async Task <IActionResult> AddUserForm(string fname, string uname, string email, string pass, IFormFile PIC) { string extension = Path.GetExtension(PIC.FileName).ToLower(); Random random = new Random(); int num = random.Next(); if (extension == ".jpg" || extension == ".jpeg" || extension == ".png" || extension == "gif") { string path = Path.Combine(Directory.GetCurrentDirectory(), "Content/Images", num + PIC.FileName); using (var stream = new FileStream(path, FileMode.Create)) { await PIC.CopyToAsync(stream); } CAccount temp = CAccount.GetCAccountBy_user_name(uname); string pic = num + PIC.FileName; if (temp != null) { ViewBag.Message = "User Name Already Register !"; return(View("AddUser")); } else { CAccount.Add_User_For_Admin(fname, uname, email, pass, pic); return(RedirectToAction("Index", "AdminCont")); } } else { ViewBag.Message2 = "Only Image Allowed"; return(View("AddUser")); } }
//获取账单金额 public static double get_account_money(CAccount account) { double money = 0; money += MConvert <double> .ToTypeOrDefault(account.cash, 0); money += MConvert <double> .ToTypeOrDefault(account.bankUnion, 0); money += MConvert <double> .ToTypeOrDefault(account.creditCard, 0); money += MConvert <double> .ToTypeOrDefault(account.coupon, 0); money += MConvert <double> .ToTypeOrDefault(account.groupBuy, 0); money += MConvert <double> .ToTypeOrDefault(account.zero, 0); money += MConvert <double> .ToTypeOrDefault(account.server, 0); money -= MConvert <double> .ToTypeOrDefault(account.changes, 0); money += MConvert <double> .ToTypeOrDefault(account.wipeZero, 0); return(money); }
public CDataResult <int> Add(AccountInput input) { var query = this._accountRepository.GetAll().Where(r => r.Account == input.Account); if (query.Count() > 0) { return(new CDataResult <int>() { IsSuccess = false, ErrorMessage = "电话号码已存在!", Data = 0 }); } var newAccount = new CAccount() { UserName = input.UserName, Password = input.Password, CompanyId = input.CompanyId, Account = input.Account, IMEICode = input.IMEICode, Equipments = input.Equipments, IsActivated = input.IsActivated }; var newNoticeId = this._accountRepository.InsertAndGetId(newAccount); return(new CDataResult <int>() { IsSuccess = true, ErrorMessage = null, Data = newNoticeId }); }
public IActionResult Index() { List <CAccount> users = CAccount.GetAllUsers(); ViewData["users"] = users; return(View("Index")); }
public IActionResult Profile(int id) { int user_id = id; CAccount temp = CAccount.Get_User_By_ID(id); ViewBag.pic = temp.pic; ViewBag.name = temp.fname; return(View("Profile", user_id)); }
public IActionResult CreateForm(string title, string body, int user_id) { CAccount user = CAccount.Get_User_By_ID(user_id); string name = user.fname; string pic = user.pic; Post.Create_Post(title, body, user_id, name, pic); return(RedirectToAction("Index", "UserDashBoard")); }
public void sessionCreated(TCPSession session) { CAccount a = new CAccount(); a.name = "孙克宁"; a.password = "******"; TCPUtil.sendMessage(session, a); Debug.Log("和服务器建立连接"); }
public XmlDocument GetMenuAuth(string adminId) { XmlDocument doc = new XmlDocument(); CAccount account = new CAccount(); doc.InnerXml = account.GetMenuAuth(adminId); return(doc); }
public XmlDocument GetDutyAuth(string dutyNo) { XmlDocument doc = new XmlDocument(); CAccount account = new CAccount(); doc.InnerXml = account.GetDutyAuth(dutyNo); return(doc); }
protected void Page_Load(object sender, EventArgs e) { if (Session["Customer"] == null) { Response.Redirect("login.aspx"); return; } m_Customer = (CCustomer)Session["Customer"]; m_Account = (CAccount)m_Customer.AccountMgr.GetFirstObj(); }
/* public CEmp getEmp(string emp_no, string passwd) { IDictionary<string, object> iDic = new Dictionary<string, object>(); iDic.Add("emp_no", emp_no); iDic.Add("passwd", passwd); return getEmp(iDic); } */ public void setAccount(CAccount acount) { if (acount.idx == 0) { DaoManager.Instance.Insert("ACCOUNT.insert_account", acount); } else { DaoManager.Instance.Update("ACCOUNT.update_account", acount); } }
bool CSIPProxySettings_Ok() { CAccount account = CAccounts.getInstance()[_accountIndex]; account.Period = int.Parse(_editperiod.Caption); account.Domain = _editDomain.Caption; CAccounts.getInstance()[_accountIndex] = account; CAccounts.getInstance().save(); _controller.previousPage(); return(true); }
bool CSIPProxySettings_Ok() { CAccount account = CAccounts.getInstance()[_accountIndex]; account.Username = _editUserName.Caption; account.Password = _editPassword.Caption; CAccounts.getInstance()[_accountIndex] = account; CAccounts.getInstance().save(); _controller.previousPage(); return(true); }
public void LoginProcess( CAccount emp ) { Session["idx"] = emp.idx; Session["emp_no"] = emp.emp_no; Session["name"] = emp.name; Session["id"] = emp.id; Session["email"] = emp.email; Session["reg_date"] = emp.reg_date; Session["mod_date"] = emp.mod_date; Session["is_used"] = emp.is_used; Session["is_admin"] = emp.is_admin; Session.Timeout = 240; }
bool linkNext_Softkey(int keyId) { CAccount account = CAccounts.getInstance()[_accountIndex]; account.Username = _editUserName.Caption; account.Password = _editPassword.Caption; CAccounts.getInstance()[_accountIndex] = account; CSIPProxySettings3rd page = (CSIPProxySettings3rd)_controller.getPage((int)EPages.P_SIPPROXYSETTINGS_3rd); page.setAccountIndex(_accountIndex); _controller.showPage((int)EPages.P_SIPPROXYSETTINGS_3rd); return(true); }
bool linkNext_Softkey(int keyId) { CAccount account = CAccounts.getInstance()[_accountIndex]; account.Period = int.Parse(_editperiod.Caption); account.Domain = _editDomain.Caption; CAccounts.getInstance()[_accountIndex] = account; CSIPProxySettings page = (CSIPProxySettings)_controller.getPage((int)EPages.P_SIPPROXYSETTINGS); page.setAccountIndex(_accountIndex); _controller.showPage((int)EPages.P_SIPPROXYSETTINGS); return(true); }
public IActionResult Delete(int id) { int temp = Post.Get_Post_By_User_ID(id); while (temp != 0) { Post.Delete_Post_By_UserID(id); temp--; } CAccount.Delete_User(id); //asas return(RedirectToAction("Index", "AdminCont")); }
bool CSIPProxySettings_Ok() { CAccount account = CAccounts.getInstance()[_accountIndex]; account.Address = _editProxyAddress.Caption; account.Port = int.Parse(_editProxyPort.Caption); account.Name = _editDisplayName.Caption; account.Id = _editId.Caption; CAccounts.getInstance()[_accountIndex] = account; CAccounts.getInstance().save(); _controller.previousPage(); return(true); }
public IActionResult ProfileForm(string uname, string email, string cpass, string npass, int id) { CAccount temp = CAccount.GetCAccountBy_user_name_and_password(uname, cpass); if (temp != null) { CAccount.Update_User(uname, email, npass, id); return(RedirectToAction("Index", "UserDashBoard")); } else { ViewBag.Message = "Old Password Not Correct , Please Enter Correcrt Password Else Cant Update"; return(View("Profile", id)); } }
public List <CAccount> ListOfCAcc(string loanId) { List <CAccount> l = new List <CAccount>(); //find all the caccs their clientId is id while (con.State == ConnectionState.Open) { System.Threading.Thread.Sleep(500); } con.Open(); MySqlCommand cmd = new MySqlCommand("select * from CAccount where LoansId=@id", con); cmd.Parameters.AddWithValue("@id", loanId); MySqlDataReader reader = cmd.ExecuteReader(); while (reader.Read()) { CAccount c = new CAccount(); c.Id = Convert.ToInt32(reader["Id"].ToString()); c.AccountName = reader["AccountName"].ToString(); c.AccountNum = reader["AccountNum"].ToString(); c.OriginalCreditor = reader["OriginalCreditor"].ToString(); c.CompanySold = reader["CompanySold"].ToString(); c.AccountType = reader["AccountType"].ToString(); c.DateOpened = reader["DateOpened"].ToString(); c.AccountStatus = reader["AccountStatus"].ToString(); c.PaymentStatus = reader["PaymentStatus"].ToString(); c.StatusUpdated = reader["StatusUpdated"].ToString(); c.Balance = reader["Balance"].ToString(); c.BalanceUpdated = reader["BalanceUpdated"].ToString(); c.CreditLimit = reader["CreditLimit"].ToString(); c.MonthlyPayment = reader["MonthlyPayment"].ToString(); c.PastDueAmount = reader["PastDueAmount"].ToString(); c.HighestBalance = reader["HighestBalance"].ToString(); c.Terms = reader["Terms"].ToString(); c.Responsibility = reader["Responsibility"].ToString(); c.YourStatement = reader["YourStatement"].ToString(); c.Comments = reader["Comments"].ToString(); c.Status = reader["Status"].ToString(); c.LoansId = reader["LoansId"].ToString(); c.OriginalBalance = reader["OriginalBalance"].ToString(); l.Add(c); } con.Close(); return(l); }
bool linkNext_Softkey(int keyId) { // store data CAccount account = CAccounts.getInstance()[_accountIndex]; account.Address = _editProxyAddress.Caption; account.Port = int.Parse(_editProxyPort.Caption); account.Name = _editDisplayName.Caption; account.Id = _editId.Caption; CAccounts.getInstance()[_accountIndex] = account; CSIPProxySettings2nd page = (CSIPProxySettings2nd)_controller.getPage((int)EPages.P_SIPPROXYSETTINGS_2nd); page.setAccountIndex(_accountIndex); _controller.showPage((int)EPages.P_SIPPROXYSETTINGS_2nd); return(true); }
public LoginPage() { InitializeComponent(); CurrentAccount = new CAccount(); accountsListBox.ItemsSource = new AccountEngine(Settings.Default.AccountsPath).Collection; if (accountsListBox.Items.Count > 0) { accountsListBox.SelectedIndex = 0; } else { buttonNext.Visibility = Visibility.Hidden; } }
public void CreateCAcc(CAccount c) { //insert to DataBase //check if someone already use the database and wait if necessary if (c.Id == -1) { c.Id = getId(); } while (con.State == ConnectionState.Open) { System.Threading.Thread.Sleep(500); } con.Open(); string query = "INSERT INTO CAccount (Id,AccountName,AccountNum,OriginalCreditor,CompanySold,AccountType,DateOpened,AccountStatus,PaymentStatus,StatusUpdated,Balance,BalanceUpdated,CreditLimit,MonthlyPayment,PastDueAmount,HighestBalance,OriginalBalance,Terms,Responsibility,YourStatement,Comments,Status,LoansId) VALUES (@Id,@AccountName,@AccountNum,@OriginalCreditor,@CompanySold,@AccountType,@DateOpened,@AccountStatus,@PaymentStatus,@StatusUpdated,@Balance,@BalanceUpdated,@CreditLimit,@MonthlyPayment,@PastDueAmount,@HighestBalance,@OriginalBalance,@Terms,@Responsibility,@YourStatement,@Comments,@Status,@LoansId)"; MySqlCommand cmd = new MySqlCommand(query, con); cmd.Parameters.AddWithValue("@Id", c.Id); cmd.Parameters.AddWithValue("@AccountName", c.AccountName); cmd.Parameters.AddWithValue("@AccountNum", c.AccountNum); cmd.Parameters.AddWithValue("@OriginalCreditor", c.OriginalCreditor); cmd.Parameters.AddWithValue("@CompanySold", c.CompanySold); cmd.Parameters.AddWithValue("@AccountType", c.AccountType); cmd.Parameters.AddWithValue("@DateOpened", c.DateOpened); cmd.Parameters.AddWithValue("@AccountStatus", c.AccountStatus); cmd.Parameters.AddWithValue("@PaymentStatus", c.PaymentStatus); cmd.Parameters.AddWithValue("@StatusUpdated", c.StatusUpdated); cmd.Parameters.AddWithValue("@Balance", c.Balance); cmd.Parameters.AddWithValue("@BalanceUpdated", c.BalanceUpdated); cmd.Parameters.AddWithValue("@CreditLimit", c.CreditLimit); cmd.Parameters.AddWithValue("@MonthlyPayment", c.MonthlyPayment); cmd.Parameters.AddWithValue("@PastDueAmount", c.PastDueAmount); cmd.Parameters.AddWithValue("@HighestBalance", c.HighestBalance); cmd.Parameters.AddWithValue("@Terms", c.Terms); cmd.Parameters.AddWithValue("@Responsibility", c.Responsibility); cmd.Parameters.AddWithValue("@OriginalBalance", c.OriginalBalance); cmd.Parameters.AddWithValue("@YourStatement", c.YourStatement); cmd.Parameters.AddWithValue("@Comments", c.Comments); cmd.Parameters.AddWithValue("@Status", c.Status); cmd.Parameters.AddWithValue("@LoansId", c.LoansId); cmd.ExecuteNonQuery(); con.Close(); }
void Start() { CAccount a = new CAccount(); a.name = "孙克宁"; a.password = "******"; MsgHead msghead = new MsgHead(); msghead.msgType = (uint)MsgType.CAccount; MemoryStream memStream = new MemoryStream(); Serializer.Serialize <CAccount>(memStream, a); byte[] messagebody = memStream.GetBuffer(); msghead.msgLength = (uint)memStream.Length; MemoryStream memStreamHead = new MemoryStream(); Serializer.Serialize <MsgHead>(memStreamHead, msghead); //将数据序列化后存入本地文件 using (Stream file = File.Create(PATH)) { file.Write(memStreamHead.GetBuffer(), 0, 10); file.Write(messagebody, 0, messagebody.Length); file.Close(); } //将数据从文件中读取出来,反序列化 using (FileStream file = File.OpenRead(PATH)) { BinaryReader r = new BinaryReader(file); r.BaseStream.Seek(0, SeekOrigin.Begin); //将文件指针设置到文件开 byte[] pReadByte = r.ReadBytes(10); MemoryStream msgh = new MemoryStream(pReadByte); MsgHead baseMsg = Serializer.Deserialize <MsgHead> (msgh); print(baseMsg.msgLength); print(baseMsg.msgType); r.BaseStream.Seek(10, SeekOrigin.Begin); //将文件指针设置到文件开 pReadByte = r.ReadBytes((int)baseMsg.msgLength); MemoryStream msgboddy = new MemoryStream(pReadByte); CAccount ac = Serializer.Deserialize <CAccount>(msgboddy); print(ac.name); print(ac.password); } }
public IActionResult LogInForm_Admin(string auname, string apass) { CAccount temp = CAccount.GetCAccountBy_user_name_and_password(auname, apass); if (temp != null) { if (temp.is_admin == 1) { return(RedirectToAction("Index", "AdminCont")); } else { ViewBag.Message1 = "Sorry ! Only For Admin !"; return(View("LogIn")); } } else { ViewBag.Message = "UserName or Password Incorrect !"; return(View("LogIn")); } }
public void UpdateCAcc(CAccount c) { //change while (con.State == ConnectionState.Open) { System.Threading.Thread.Sleep(500); } con.Open(); string query = "UPDATE CAccount SET (AccountName=@AccountName,AccountNum=@AccountNum,OriginalCreditor=@OriginalCreditor,CompanySold=@CompanySold,OriginalBalance=@OriginalBalance,AccountType=@AccountType,DateOpened=@DateOpened,AccountStatus=@AccountStatus,PaymentStatus=@PaymentStatus,StatusUpdated=@StatusUpdated,Balance=@Balance,BalanceUpdated=@BalanceUpdated,CreditLimit=@CreditLimit,MonthlyPayment=@MonthlyPayment,PastDueAmount=@PastDueAmount,HighestBalance=@HighestBalance,Terms=@Terms,Responsibility=@Responsibility,YourStatement=@YourStatement,Comments=@Comments,Status=@Status,LoansId=@LoansId) WHERE Id=@Id"; MySqlCommand cmd = new MySqlCommand(query, con); cmd.Parameters.AddWithValue("@Id", c.Id); cmd.Parameters.AddWithValue("@AccountName", c.AccountName); cmd.Parameters.AddWithValue("@AccountNum", c.AccountNum); cmd.Parameters.AddWithValue("@OriginalCreditor", c.OriginalCreditor); cmd.Parameters.AddWithValue("@CompanySold", c.CompanySold); cmd.Parameters.AddWithValue("@AccountType", c.AccountType); cmd.Parameters.AddWithValue("@DateOpened", c.DateOpened); cmd.Parameters.AddWithValue("@AccountStatus", c.AccountStatus); cmd.Parameters.AddWithValue("@PaymentStatus", c.PaymentStatus); cmd.Parameters.AddWithValue("@StatusUpdated", c.StatusUpdated); cmd.Parameters.AddWithValue("@Balance", c.Balance); cmd.Parameters.AddWithValue("@BalanceUpdated", c.BalanceUpdated); cmd.Parameters.AddWithValue("@CreditLimit", c.CreditLimit); cmd.Parameters.AddWithValue("@MonthlyPayment", c.MonthlyPayment); cmd.Parameters.AddWithValue("@PastDueAmount", c.PastDueAmount); cmd.Parameters.AddWithValue("@HighestBalance", c.HighestBalance); cmd.Parameters.AddWithValue("@Terms", c.Terms); cmd.Parameters.AddWithValue("@Responsibility", c.Responsibility); cmd.Parameters.AddWithValue("@YourStatement", c.YourStatement); cmd.Parameters.AddWithValue("@OriginalBalance", c.OriginalBalance); cmd.Parameters.AddWithValue("@Comments", c.Comments); cmd.Parameters.AddWithValue("@Status", c.Status); cmd.Parameters.AddWithValue("@LoansId", c.LoansId); cmd.ExecuteNonQuery(); con.Close(); }
void delete() { try { int r = dgv.CurrentCell.RowIndex; string strID = dgv.Rows[r].Cells[0].Value.ToString().Trim(); string service = dgv.Rows[r].Cells[4].Value.ToString(); if (service != "TopManager") { CAccount SA = new CAccount(); DialogResult traloi; traloi = MessageBox.Show("Bạn muốn cho người này thôi việc?", "Trả lời", MessageBoxButtons.YesNo, MessageBoxIcon.Question); if (traloi == DialogResult.Yes) { SEmploy.DeleteEmployee(Convert.ToInt32(strID), ref err); //SA.DeleteAcc(Convert.ToInt32(strID), ref err); load(); MessageBox.Show("Hoàn thành!"); } else { MessageBox.Show("Không thực hiện được! " + err); } } else { MessageBox.Show("Bạn không thể tự xóa chính bạn nếu bạn cần trợ giúp liên hệ\[email protected]", "Trợ giúp"); } } catch (SqlException) { MessageBox.Show("Không xóa được. Lỗi rồi!"); } }
public void updateChosenCacc(CAccount c)//when click update { CAccountC inter = new CAccountC(); inter.UpdateCAcc(c); }
private void AccountsListBox_OnSelectionChanged(object Sender, SelectionChangedEventArgs E) { CurrentAccount = (CAccount)accountsListBox.SelectedItem; lblIncorrect.Content = ""; }