public void REPORTPERMISSION() { var LIST = new List<SqlParameter>(); LIST.AddSqlParameter("@USERNAME", USERNAME.ToUpper()); LIST.AddSqlParameter("@DESIGINATION", DESGINATION); LIST.AddSqlParameter("@INSERT_BY", login.u); LIST.AddSqlParameter("@INSERT_DATE", DateTime.Today.Date); string s = "INSERT INTO REPORTPERMISSIONS(USERNAME,DESIGINATION,TARIFF_POSTED_DAY,ROOMOCCUPANCY,DISCOUNT_DAY,DISCOUNT_MONTH,EXPECTED_ARRIVALS,EXPECTED_DEPARTURES,CANCELLED_RESERVATION,TODAY_ARRIVALS,CHECKOUTFORTHE_DAY,GUEST_ADVANCE,GUEST_INHOUSE,ROOM_RATELIST,RESERVATION_LIST,TRANSACTION_LIST,TAX_REPORT,FO_TRANSACTIONLIST,CHANGE_GUESTINFO,ROOM_CHANGE,OUTSTANDING_BALANCE,MONTHWISE_ROOMTARIFF,PENDINGBILL,INSERT_BY,INSERT_DATE) VALUES(@USERNAME,@DESIGINATION,1,1,1,0,1,1,1,1,1,0,1,1,1,0,0,1,1,1,0,0,1,@INSERT_BY,@INSERT_DATE)"; DbFunctions.ExecuteCommand<int>(s,LIST); }
public void OPERTIONPERMISSIONS() { var LIST = new List<SqlParameter>(); LIST.AddSqlParameter("@USERNAME", USERNAME.ToUpper()); LIST.AddSqlParameter("@DESIGINATION", DESGINATION); LIST.AddSqlParameter("@INSERT_BY", login.u); LIST.AddSqlParameter("@INSERT_DATE", DateTime.Today.Date); string s = "INSERT INTO OPERATIONPERMISSIONS(USERNAME,DESIGINATION,ENQUIRY,RESERVATION,CHECKIN,CHECKOUT,CO_COMPANY,CO_BILLONHOLD,CO_TRANSFER,ADVANCE,PENDINGBILL,PB_COMPANY,PB_BILLONHOLD,GROUP_CHECKIN,POSTCHARGES,PAIDOUTS,ROOMCHANGE,REFUND,BLOCK_ROOM,DISCOUNT,GUESTINFO,CHANGEROOMSTATUS,MISSALES,BILLSETTLE,REPRINT,DASHBOARD,INSERT_BY,INSERT_DATE) VALUES(@USERNAME,@DESIGINATION,1,1,1,1,0,0,1,1,1,0,0,1,1,1,1,1,1,1,1,1,1,1,1,1,@INSERT_BY,@INSERT_DATE)"; DbFunctions.ExecuteCommand<int>(s,LIST); }
public void MASTERPERMISSIONS() { var LIST = new List<SqlParameter>(); LIST.AddSqlParameter("@USERNAME", USERNAME.ToUpper()); LIST.AddSqlParameter("@DESIGINATION",DESGINATION); LIST.AddSqlParameter("@INSERT_BY",login.u); LIST.AddSqlParameter("@INSERT_DATE", DateTime.Today.Date); string s = "INSERT INTO MASTERPERMISSIONS(USERNAME,DESIGINATION,HOTELINFO,COMPANY,CATEGORY,PLANDEFINATION,ROOMTARRIF,AMENITIES,REVENUE,DEPARTMENT,RESET_PASSWORD,REG_USER,USERPEMISSIONS,TAX,INSERT_BY,INSERT_DATE)"+ "VALUES(@USERNAME,@DESIGINATION,0,1,0,0,0,0,0,1,0,0,0,0,@INSERT_BY,@INSERT_DATE)"; DbFunctions.ExecuteCommand<int>(s, LIST); }
private void simpleButton1_Click(object sender, EventArgs e) { if (USERNAME.Text == "") { DevExpress.XtraEditors.XtraMessageBox.Show(this, "Enter the User Name !!!", ProductName, MessageBoxButtons.OKCancel, MessageBoxIcon.Error); USERNAME.Focus(); return; } if (NEW.Text == "") { DevExpress.XtraEditors.XtraMessageBox.Show(this, "Enter the New Password !!!", ProductName, MessageBoxButtons.OKCancel, MessageBoxIcon.Error); NEW.Focus(); return; } if (OLD.Text == "") { DevExpress.XtraEditors.XtraMessageBox.Show(this, "Enter the Confirm Password !!!", ProductName, MessageBoxButtons.OKCancel, MessageBoxIcon.Error); OLD.Focus(); return; } try { //c.connopen(); //query = "select * from UserLog where UserName='******' and Password='******'"; //cmd = new SqlCommand(query, c.conn); //dr = cmd.ExecuteReader(); if (NEW.Text == OLD.Text) { c.connopen(); query = "Update UserLog set Password=@Password where UserName=@UserName"; cmd = new SqlCommand(query, c.conn); cmd.Parameters.Add("@Password", SqlDbType.NVarChar).Value = NEW.Text; cmd.Parameters.Add("@UserName", SqlDbType.NVarChar).Value = USERNAME.Text; cmd.ExecuteNonQuery(); DevExpress.XtraEditors.XtraMessageBox.Show(this, "Passoword Reset Successfully.", ProductName, MessageBoxButtons.OK, MessageBoxIcon.Information); NEW.Text = ""; OLD.Text = ""; USERNAME.Text = ""; } else { DevExpress.XtraEditors.XtraMessageBox.Show(this, "Password Mismastch !!!", ProductName, MessageBoxButtons.OK, MessageBoxIcon.Error); } } catch (Exception ex) { DevExpress.XtraEditors.XtraMessageBox.Show(this, "Error:" + ex.ToString(), ProductName, MessageBoxButtons.OK, MessageBoxIcon.Information); } finally { c.coonclose(); } }
// string time = instance.ToString("t"); public void users() { var list = new List<SqlParameter>(); list.AddSqlParameter("@USERNAME", USERNAME.ToUpper()); string time = instance.ToString("t"); SIGNIN = time; list.AddSqlParameter("@SIGNIN", time); SIGNOUT = "00:00".ToString(); list.AddSqlParameter("@SIGNOUT", SIGNOUT); INSERTDATE = Convert.ToDateTime(DateTime.Now.ToString("ddd, MMM d, yyyy")); list.AddSqlParameter("@INSERTDATE", INSERTDATE); string s = "insert into USERS (USERNAME,SIGNIN,SIGNOUT,INSERTDATE)VALUES(@USERNAME,@SIGNIN,@SIGNOUT,@INSERTDATE)"; DbFunctions.ExecuteCommand<int>(s, list); }
//重置两个框中输入的内容 private void CLEAR_Click(object sender, EventArgs e) { USERNAME.Clear(); PASSWORD.Clear(); }