protected void Page_Load(object sender, EventArgs e) { if (!IsPostBack) { System.Web.UI.HtmlControls.HtmlGenericControl Services = (System.Web.UI.HtmlControls.HtmlGenericControl)Master.FindControl("Li2"); Services.Attributes.Add("class", "active"); long ID = long.Parse(Request.QueryString["Id"]); CommonClassLibrary.CommonDataSet.OrderDetailDataTable collection = new CommonClassLibrary.CommonDataSetTableAdapters.OrderDetailTableAdapter().GetDataByTicketOrder(ID); if (collection.Rows.Count > 0) { foreach (CommonClassLibrary.CommonDataSet.OrderDetailRow item in collection) { CommonClassLibrary.CommonDataSet.UserAccountDataTable collection2 = new CommonClassLibrary.CommonDataSetTableAdapters.UserAccountTableAdapter().GetDataById(item.Customer); foreach (CommonClassLibrary.CommonDataSet.UserAccountRow item2 in collection2) { this.Customer_Label.Text = item2.FirstName + " " + item2.LastName; this.Confirmdatetime_Label.Text = item.CheckInDate.ToString(); } } } getdatarepeater(); getdatarepeater1(); GetDataPrint(); this.Ticket_Label.Text = "DGS - " + ID.ToString(); showbutton(); if (model.ConfirmPayments.Where(x => x.TicketOrder == ID).Count() > 0) { GetPaymentDetail(); } } }
public void getdatauseraccount() { DataTable dt = new DataTable(); dt.Columns.Add("Id"); dt.Columns.Add("FirstName"); dt.Columns.Add("LastName"); dt.Columns.Add("Email"); dt.Columns.Add("Password"); dt.Columns.Add("MobilePhone"); dt.Columns.Add("UserGroup"); dt.Columns.Add("Urlimage"); string urlImage = "Image/innofood.jpg"; CommonClassLibrary.CommonDataSet.UserAccountDataTable collection = new CommonClassLibrary.CommonDataSetTableAdapters.UserAccountTableAdapter().GetDataByStatus100(); foreach (CommonClassLibrary.CommonDataSet.UserAccountRow item in collection) { CommonClassLibrary.CommonDataSet.AccountGroupDataTable collection2 = new CommonClassLibrary.CommonDataSetTableAdapters.AccountGroupTableAdapter().GetDataByUserAccount(item.Id); if (collection2.Rows.Count > 1) { string usergroup = ""; foreach (CommonClassLibrary.CommonDataSet.AccountGroupRow item2 in collection2) { CommonClassLibrary.CommonDataSet.UserGroupDataTable collection3 = new CommonClassLibrary.CommonDataSetTableAdapters.UserGroupTableAdapter().GetDataByID(item2.UserGroup); foreach (CommonClassLibrary.CommonDataSet.UserGroupRow item3 in collection3) { usergroup += item3.Name + ", "; if (item.ImageUrl != null) { urlImage = "Image/" + item.ImageUrl; } } } usergroup = usergroup.Trim(); if (usergroup.EndsWith(",")) { usergroup = usergroup.Substring(0, usergroup.Length - 1); } dt.Rows.Add(item.Id, item.FirstName, item.LastName, item.Email, item.Password, item.MobilePhoneNumber, usergroup, urlImage); } else { foreach (CommonClassLibrary.CommonDataSet.AccountGroupRow item2 in collection2) { CommonClassLibrary.CommonDataSet.UserGroupDataTable collection3 = new CommonClassLibrary.CommonDataSetTableAdapters.UserGroupTableAdapter().GetDataByID(item2.UserGroup); foreach (CommonClassLibrary.CommonDataSet.UserGroupRow item3 in collection3) { if (item.ImageUrl != null) { urlImage = "Image/" + item.ImageUrl; } dt.Rows.Add(item.Id, item.FirstName, item.LastName, item.Email, item.Password, item.MobilePhoneNumber, item3.Name, urlImage); } } } } this.UserAccountRepeater.DataSource = dt; this.UserAccountRepeater.DataBind(); }
public void getdatauseraccount() { DataTable dt = new DataTable(); dt.Columns.Add("Id"); dt.Columns.Add("FirstName"); dt.Columns.Add("LastName"); dt.Columns.Add("Email"); dt.Columns.Add("Password"); dt.Columns.Add("MobilePhone"); dt.Columns.Add("Name"); dt.Columns.Add("Address"); string commentuser = ""; CommonClassLibrary.CommonDataSet.UserAccountDataTable collection = new CommonClassLibrary.CommonDataSetTableAdapters.UserAccountTableAdapter().GetData(); foreach (CommonClassLibrary.CommonDataSet.UserAccountRow item in collection) { if (inno.Comments.Where(x => x.Create_By == item.Id).Count() > 0) { commentuser = inno.Comments.Where(x => x.Create_By == item.Id).OrderByDescending(u => u.Id).FirstOrDefault().Comment1; } else { commentuser = ""; } CommonClassLibrary.CommonDataSet.AccountGroupDataTable collection2 = new CommonClassLibrary.CommonDataSetTableAdapters.AccountGroupTableAdapter().GetDataByUserAccount(item.Id); if (collection2.Rows.Count > 1) { string usergroup = ""; foreach (CommonClassLibrary.CommonDataSet.AccountGroupRow item2 in collection2) { CommonClassLibrary.CommonDataSet.UserGroupDataTable collection3 = new CommonClassLibrary.CommonDataSetTableAdapters.UserGroupTableAdapter().GetDataByID(item2.UserGroup); foreach (CommonClassLibrary.CommonDataSet.UserGroupRow item3 in collection3) { usergroup += item3.Name + ", "; } } usergroup = usergroup.Trim(); if (usergroup.EndsWith(",")) { usergroup = usergroup.Substring(0, usergroup.Length - 1); } dt.Rows.Add(item.Id, item.FirstName, item.LastName, item.Email, item.Password, item.MobilePhoneNumber, usergroup, commentuser); } else { foreach (CommonClassLibrary.CommonDataSet.AccountGroupRow item2 in collection2) { CommonClassLibrary.CommonDataSet.UserGroupDataTable collection3 = new CommonClassLibrary.CommonDataSetTableAdapters.UserGroupTableAdapter().GetDataByID(item2.UserGroup); foreach (CommonClassLibrary.CommonDataSet.UserGroupRow item3 in collection3) { dt.Rows.Add(item.Id, item.FirstName, item.LastName, item.Email, item.Password, item.MobilePhoneNumber, item3.Name, commentuser); } } } } this.UserAccountRepeater.DataSource = dt; this.UserAccountRepeater.DataBind(); }
protected void SignUpButton_Click(object sender, EventArgs e) { string Email = this.Email_TextBox.Text; if (this.Password_TextBox.Text != "") { CommonClassLibrary.CommonDataSet.UserAccountDataTable collection = new CommonClassLibrary.CommonDataSetTableAdapters.UserAccountTableAdapter().GetDataByEmail(Email); if (collection.Rows.Count == 0) { int ID = new CommonClassLibrary.CommonDataSetTableAdapters.UserAccountTableAdapter().Insert(this.Firstname_TextBox.Text, this.Lastname_TextBox.Text, this.Email_TextBox.Text, this.Password_TextBox.Text, this.Mobilephone_TextBox.Text, DateTime.Now, DateTime.Now, 1, ""); if (ID > 0) { if (new CommonClassLibrary.CommonDataSetTableAdapters.AccountGroupTableAdapter().InsertQuery(ID, 1, DateTime.Now, DateTime.Now, 1) == 1) { this.SuccessPanel.Visible = true; this.SuccessLabel.Text = "สมัครสมาชิกสำเร็จ"; this.ErrorPanel.Visible = false; } else { this.ErrorPanel.Visible = true; this.ErrorLabel.Text = "สมัครสมาชิกไม่สำเร็จ"; this.SuccessPanel.Visible = false; } } else { this.ErrorPanel.Visible = true; this.ErrorLabel.Text = "สมัครสมาชิกไม่สำเร็จ"; this.SuccessPanel.Visible = false; } } else { foreach (CommonClassLibrary.CommonDataSet.UserAccountRow item in collection) { if (item.Email == this.Email_TextBox.Text) { this.ErrorPanel.Visible = true; this.ErrorLabel.Text = "มี E-mail ในระบบแล้ว"; this.SuccessPanel.Visible = false; } } } } else { this.ErrorPanel.Visible = true; this.ErrorLabel.Text = "กรุณากรอกรหัสผ่าน"; this.SuccessPanel.Visible = false; } }
protected void Page_Load(object sender, EventArgs e) { if (!IsPostBack) { System.Web.UI.HtmlControls.HtmlGenericControl Usermanagement = (System.Web.UI.HtmlControls.HtmlGenericControl)Master.FindControl("Li7"); Usermanagement.Attributes.Add("class", "active"); System.Web.UI.HtmlControls.HtmlGenericControl Useraccount = (System.Web.UI.HtmlControls.HtmlGenericControl)Master.FindControl("Li9"); Useraccount.Attributes.Add("class", "active"); int ID = int.Parse(Request.QueryString["Id"]); this.CheckBoxList(); CommonClassLibrary.CommonDataSet.UserAccountDataTable collection = new CommonClassLibrary.CommonDataSetTableAdapters.UserAccountTableAdapter().GetDataById(ID); foreach (CommonClassLibrary.CommonDataSet.UserAccountRow item in collection) { this.FirstNameEditUserAccount_TextBox.Text = item.FirstName; this.LastNameEditUserAccount_TextBox.Text = item.LastName; this.EmailEditUserAccount_TextBox.Text = item.Email; this.PasswordEditUserAccount_TextBox.Attributes.Add("value", item.Password); this.MobilePhoneEditUserAccount_TextBox.Text = item.MobilePhoneNumber; CommonClassLibrary.CommonDataSet.AccountGroupDataTable collection2 = new CommonClassLibrary.CommonDataSetTableAdapters.AccountGroupTableAdapter().GetDataByUserAccount(item.Id); foreach (CommonClassLibrary.CommonDataSet.AccountGroupRow item2 in collection2) { for (int i = 0; i < UserGroupEditUserAccount_CheckBoxList.Items.Count; i++) { if (UserGroupEditUserAccount_CheckBoxList.Items[i].Value == item2.UserGroup.ToString()) { UserGroupEditUserAccount_CheckBoxList.Items[i].Selected = true; } } } } } }
protected void Page_Load(object sender, EventArgs e) { if (!IsPostBack) { long ID = long.Parse(Request.QueryString["Id"]); CommonClassLibrary.CommonDataSet.OrderDetailDataTable collection = new CommonClassLibrary.CommonDataSetTableAdapters.OrderDetailTableAdapter().GetDataByTicketOrder(ID); if (collection.Rows.Count > 0) { foreach (CommonClassLibrary.CommonDataSet.OrderDetailRow item in collection) { CommonClassLibrary.CommonDataSet.UserAccountDataTable collection2 = new CommonClassLibrary.CommonDataSetTableAdapters.UserAccountTableAdapter().GetDataById(item.Customer); foreach (CommonClassLibrary.CommonDataSet.UserAccountRow item2 in collection2) { this.Customer_Label.Text = item2.FirstName + " " + item2.LastName; this.Confirmdatetime_Label.Text = item.CheckInDate.ToString(); } } } getdatarepeater(); getdatarepeater1(); this.Ticket_Label.Text = "DGS - " + ID.ToString(); showbutton(); } }
protected void submitButton_Click1(object sender, EventArgs e) { if (this.UsernameTextBox.Text != "") { if (this.PasswordTextBox.Text != "") { CommonClassLibrary.CommonDataSet.UserAccountDataTable collection = new CommonClassLibrary.CommonDataSetTableAdapters.UserAccountTableAdapter().GetDataBySignIn(this.UsernameTextBox.Text, this.PasswordTextBox.Text); if (collection.Rows.Count > 0) { foreach (CommonClassLibrary.CommonDataSet.UserAccountRow item in collection) { this.SetTicket(item); break; } } else { ClientScript.RegisterStartupScript(this.GetType(), "myalert", "alert('" + "ชื่อผู้ใช้ หรือ รหัสผ่าน ไม่ถูกต้อง" + "');", true); PasswordTextBox.Focus(); return; } } else { ClientScript.RegisterStartupScript(this.GetType(), "myalert", "alert('" + "กรุณากรอก รหัสผ่าน" + "');", true); PasswordTextBox.Focus(); return; } } else { ClientScript.RegisterStartupScript(this.GetType(), "myalert", "alert('" + "กรุณากรอก ชื่อผู้ใข้" + "');", true); UsernameTextBox.Focus(); return; } }
protected void AddButton_Click(object sender, EventArgs e) { long ID = 0; if (this.UserGroupAddUserAccount_CheckBoxList.SelectedValue != "") { try { CommonClassLibrary.CommonDataSet.UserAccountDataTable dt = new CommonClassLibrary.CommonDataSetTableAdapters.UserAccountTableAdapter().GetDataByEmail(this.EmailAddUserAccount_TextBox.Text); if (dt.Rows.Count != 0) { new CommonClassLibrary.CommonDataSetTableAdapters.UserAccountTableAdapter().UpdateQuery(this.FirstNameAddUserAccount_TextBox.Text, this.LastNameAddUserAccount_TextBox.Text, this.EmailAddUserAccount_TextBox.Text, this.PasswordAddUserAccount_TextBox.Text, this.MobilePhoneAddUserAccount_TextBox.Text, 1, long.Parse(dt.Rows[0]["Id"].ToString())); if (long.Parse(dt.Rows[0]["Id"].ToString()) != 0) { for (int i = 0; i < UserGroupAddUserAccount_CheckBoxList.Items.Count; i++) { if (UserGroupAddUserAccount_CheckBoxList.Items[i].Selected == true) { if (new CommonClassLibrary.CommonDataSetTableAdapters.AccountGroupTableAdapter().InsertQuery(long.Parse(dt.Rows[0]["Id"].ToString()), i + 1, DateTime.Now, DateTime.Now, 1) == 1) { this.SuccessLabel.Text = "บันทึกข้อมูลสำเร็จ"; this.SuccessPanel.Visible = true; this.ErrorPanel.Visible = false; } else { this.SuccessPanel.Visible = false; this.ErrorPanel.Visible = true; this.ErrorLabel.Text = "บันทึกข้อมูลไม่สำเร็จ"; } } } } } ID = (long)new CommonClassLibrary.CommonDataSetTableAdapters.UserAccountTableAdapter().InsertQuery(this.FirstNameAddUserAccount_TextBox.Text, this.LastNameAddUserAccount_TextBox.Text, this.EmailAddUserAccount_TextBox.Text, this.PasswordAddUserAccount_TextBox.Text, this.MobilePhoneAddUserAccount_TextBox.Text, DateTime.Now, DateTime.Now, 1); if (ID > 0) { for (int i = 0; i < UserGroupAddUserAccount_CheckBoxList.Items.Count; i++) { if (UserGroupAddUserAccount_CheckBoxList.Items[i].Selected == true) { if (new CommonClassLibrary.CommonDataSetTableAdapters.AccountGroupTableAdapter().InsertQuery(ID, i + 1, DateTime.Now, DateTime.Now, 1) == 1) { this.SuccessLabel.Text = "บันทึกข้อมูลสำเร็จ"; this.SuccessPanel.Visible = true; this.ErrorPanel.Visible = false; } else { this.SuccessPanel.Visible = false; this.ErrorPanel.Visible = true; this.ErrorLabel.Text = "บันทึกข้อมูลไม่สำเร็จ"; } } } } } catch (Exception) { this.SuccessPanel.Visible = false; this.ErrorLabel.Text = "บันทึกข้อมูลไม่สำเร็จ"; this.ErrorPanel.Visible = true; return; } } else { this.SuccessPanel.Visible = false; this.ErrorLabel.Text = "กรุณาเลือก User-Group (อย่างน้อย 1 ประเภท)"; this.ErrorPanel.Visible = true; } }