protected void Button3_Click(object sender, EventArgs e) { //get NEXT WEEK to THIS WEEK ADO.ExecuteNonQuery("Update Work_Table Set week=-1 Where week = 1"); ADO.ExecuteNonQuery("Update Work_Table Set week=1 Where week = 0 "); ADO.ExecuteNonQuery("Update Work_Table Set week=0 Where week = -1"); ADO.ExecuteNonQuery("Update Work_Table Set Allow_Changes=TRUE Where week = 1"); ADO.ExecuteNonQuery("Update Work_Table Set Allow_Changes=FALSE Where week = 0"); //Changing the Next Week Values DataTable dt = ADO.GetFullTable("Work_Table", "week=2"); foreach (DataRow dr in dt.Rows) { if (dr["Allow_Changes"].ToString() == "True") { string sql = "Update Work_Table Set sunday_morning='" + dr["sunday_morning"] + "', monday_morning='" + dr["monday_morning"] + "', tuesday_morning='" + dr["tuesday_morning"] + "', wednesday_morning='" + dr["wednesday_morning"] + "', thursday_morning='" + dr["thursday_morning"] + "', friday_morning='" + dr["friday_morning"] + "', saturday_morning='" + dr["saturday_morning"] + "', sunday_intermediate='" + dr["sunday_intermediate"] + "', monday_intermediate='" + dr["monday_intermediate"] + "', tuesday_intermediate='" + dr["tuesday_intermediate"] + "', wednesday_intermediate='" + dr["wednesday_intermediate"] + "', thursday_intermediate='" + dr["thursday_intermediate"] + "', friday_intermediate='" + dr["friday_intermediate"] + "', saturday_intermediate='" + dr["saturday_intermediate"] + "', sunday_evening='" + dr["sunday_evening"] + "', monday_evening='" + dr["monday_evening"] + "', tuesday_evening='" + dr["tuesday_evening"] + "', wednesday_evening='" + dr["wednesday_evening"] + "', thursday_evening='" + dr["thursday_evening"] + "', friday_evening='" + dr["friday_evening"] + "', saturday_evening='" + dr["saturday_evening"] + "' where ID=" + dr["ID"] + " And week=" + 1; ADO.ExecuteNonQuery(sql); } else { string sql = "Update Work_Table Set sunday_morning='', monday_morning='', tuesday_morning='', wednesday_morning='', thursday_morning='', friday_morning='', saturday_morning='', sunday_intermediate='', monday_intermediate='', tuesday_intermediate='', wednesday_intermediate='', thursday_intermediate='', friday_intermediate='', saturday_intermediate='', sunday_evening='', monday_evening='', tuesday_evening='', wednesday_evening='', thursday_evening='', friday_evening='', saturday_evening='' where ID=" + dr["ID"] + " And week=" + 1; ADO.ExecuteNonQuery(sql); } } Application["Week_Changed"] = true; }
protected void Page_Load(object sender, EventArgs e) { if (((bool)Session["Loged_In"]) && ((bool)Session["Admin"])) { if ((!(bool)Session["Admin"]) || (Request.QueryString["C"] == null) || (Request.QueryString["C"] == "") || (int.Parse(Request.QueryString["C"]) > 7) || (int.Parse(Request.QueryString["C"]) < 2)) { Session.Abandon(); Response.Redirect("Default.aspx"); } c = Request.QueryString["C"]; DataRow dt = ADO.GetFullTable("Users", "ID=" + Session["ID"]).Rows[0]; this.userid = dt["UserName"].ToString(); this.userpass = dt["Passw"].ToString(); this.full_name = dt["FName"].ToString(); this.company_name = dt["CName"].ToString(); this.phone = dt["Phone"].ToString(); this.E_mail = dt["Email"].ToString(); this.day = DateTime.Parse(dt["Date_Of_Birth"].ToString()).Day; this.month = DateTime.Parse(dt["Date_Of_Birth"].ToString()).Month; this.year = DateTime.Parse(dt["Date_Of_Birth"].ToString()).Year; } else { Session.Abandon(); Response.Redirect("Default.aspx"); } }
public void Print_Users() { DataTable dt = ADO.GetFullTable("Users"); DataTable dr = ADO.GetFullTable("Options"); Response.Write("<table border ='1'>"); Response.Write("<tr><th>ID</th><th>User Name</th><th>Password</th><th>Company</th><th>Full</th><th>Workers</th><th>M_Workers</th><th>SMS</th><th>M_Jobs</th><th>Updated</th><th>Reg date</th><th>Exp date</th><th>login</th><th>update</th><th>delete</th></tr>"); for (int ID = 0; ID < dt.Rows.Count; ID++) { Response.Write("<tr>"); Response.Write("<td>" + dt.Rows[ID]["ID"] + "</td>"); Response.Write("<td>" + dt.Rows[ID]["UserName"].ToString() + "</td>"); Response.Write("<td>" + dt.Rows[ID]["Passw"] + "</td>"); Response.Write("<td>" + dt.Rows[ID]["CName"] + "</td>"); Response.Write("<td>" + dt.Rows[ID]["FName"] + "</td>"); Response.Write("<td>" + ADO.GetFullTable("Workers", "ID=" + dt.Rows[ID]["ID"]).Rows.Count + "</td>"); Response.Write("<td>" + dr.Rows[ID]["Max_Workers"].ToString() + "</td>"); Response.Write("<td>" + dr.Rows[ID]["Num_Of_SMS"].ToString() + "</td>"); Response.Write("<td>" + dr.Rows[ID]["Max_Jobs"].ToString() + "</td>"); Response.Write("<td>" + dr.Rows[ID]["Last_Updated"].ToString() + "</td>"); Response.Write("<td>" + edit_date(dt.Rows[ID]["Reg_Date"].ToString()) + "</td>"); Response.Write("<td>" + edit_date(dt.Rows[ID]["Days_Left"].ToString()) + "</td>"); Response.Write("<td><a href='Owner_Login.aspx?id=" + dt.Rows[ID]["UserName"] + "'><img src='Pictures/login_icon.png' border='0'></a></td>"); Response.Write("<td><a href='Owner_Update.aspx?id=" + dt.Rows[ID]["ID"] + "'><img src='Pictures/edit.gif' border='0'></a></td>"); Response.Write("<td><a href='Owner_delete.aspx?id=" + dt.Rows[ID]["UserName"] + "'><img src='Pictures/del.gif' border='0'></a></td>"); Response.Write("</tr>"); } Response.Write("</table>"); }
public void Print_Workers() { DataTable dt = ADO.GetFullTable("Workers", "ID=" + Session["ID"] + " Order by Job"); dt.DefaultView.Sort = "Job desc"; Response.Write("<select size='30' name='ListBox1' id='ListBox1' style='font-family:Arial;font-size:Small;height:100%;width:100%;'>"); string admin_name = Session["Wname"].ToString(); if (admin_name.Length > 12) { admin_name = admin_name.Substring(0, 12); } Response.Write("<option value='" + admin_name + "'>" + Session["wname"].ToString() + "</option>"); if (bool.Parse(ADO.GetFullTable("Options", "ID=" + Session["ID"] + "").Rows[0]["Use_Jobs"].ToString())) { foreach (DataRow dr in dt.Rows) { Response.Write("<option value='" + dr["Job"] + "|" + dr["NameW"] + "'>" + dr["Job"] + "| " + dr["NameW"] + "</option>"); } } else { foreach (DataRow dr in dt.Rows) { Response.Write("<option value='" + dr["NameW"] + "'>" + dr["NameW"] + "</option>"); } } Response.Write("</select>"); }
public void Print_admin_view() { bool flag = false; Response.Write("<table dir='rtl' align='center' >"); DataTable AI = ADO.GetFullTable("AI_Optionts", "ID=" + Session["ID"]); string[] param = AI.Rows[0]["intermediate"].ToString().Split('#'); for (int i = 0; i < param.Length; i++) { string[] pratim = param[i].Split('@'); if (day == int.Parse(pratim[0]) + 1) { flag = true; if (use_jobs) { if (pratim[1] == name.Split('|')[0]) { Response.Write("<tr><td width='10'><input id='radio1' type='radio' name='shift' value='" + pratim[3] + "' ></td><td>" + pratim[3] + "</td></tr>"); } } else { Response.Write("<tr><td width='10'><input id='radio1' type='radio' name='shift' value='" + pratim[3] + "' ></td><td>" + pratim[3] + "</td></tr>"); } } } if (flag) { Response.Write("<tr><td colspan='2' align='center'><input id='Button1' type='button' value='הוסף' onclick=\"INSWorker('" + name + "')\" /></td></tr>"); } Response.Write("</table>"); }
protected void Page_Load(object sender, EventArgs e) { if (Session["Wname"] == null || Session["Cname"] == null || Session["Wname"].ToString() == "" || Session["Cname"].ToString() == "") { Session.Abandon(); Response.Redirect("Default.aspx"); } if ((!Session["Wname"].ToString().Equals("5410c239adb1b45866f162e5ec829ca9")) || (!Session["Cname"].ToString().Equals("2cb6e810b21db557600c5bd1ddba81b2"))) { Session.Abandon(); Response.Redirect("Default.aspx"); } if (Request.QueryString["id"] != null && ADO.filter(Request.QueryString["id"].ToString()) != "") { DataTable dt = ADO.GetFullTable("Users", "ID=" + Request.QueryString["ID"]); DataTable dr = ADO.GetFullTable("Options", "ID=" + Request.QueryString["ID"]); ID = Request.QueryString["ID"].ToString(); UserName = dt.Rows[0]["UserName"].ToString(); PassW = dt.Rows[0]["Passw"].ToString(); Exp_Date = edit_date(dt.Rows[0]["Days_Left"].ToString()); Max_Workers = dr.Rows[0]["Max_Workers"].ToString(); Num_Of_SMS = dr.Rows[0]["Num_Of_SMS"].ToString(); Max_Jobs = dr.Rows[0]["Max_Jobs"].ToString(); } else { Session.Abandon(); Response.Redirect("Default.aspx"); } }
protected void Page_Load(object sender, EventArgs e) { if (((bool)Session["Loged_In"]) && ((bool)Session["Admin"])) { if (ADO.filter(Request.Form["Old_SJ"].ToString()) != ADO.filter(Request.Form["short_job"].ToString())) { if (ADO.GetFullTable("jobs", "ID=" + Session["ID"] + "AND Short_Job='" + ADO.filter(Request.Form["short_job"].ToString()) + "'").Rows.Count > 0) { Response.Write("<script language='javascript'>alert('קיצור תפקיד זה קיים כבר אצלך בעסק');history.go(-1)</script>"); } } string sql = "Update jobs Set Short_job='" + ADO.filter(Request.Form["short_job"].ToString()) + "', Job='" + ADO.filter(Request.Form["job"].ToString()) + "' where Short_Job='" + Request.Form["Old_SJ"].ToString() + "' AND ID=" + Session["ID"] + ""; ADO.ExecuteNonQuery(sql); Response.Redirect("jobs.aspx"); } else { Session.Abandon(); Response.Redirect("Default.aspx"); } }
protected void Page_Load(object sender, EventArgs e) { if (((bool)Session["Loged_In"]) && ((bool)Session["Admin"])) { if (Request.QueryString["SJ"] == null || Request.QueryString["SJ"].ToString() == "") { Session.Abandon(); Response.Redirect("Default.aspx"); } string query = ADO.filter(Trans_To_hebrew(Request.QueryString["SJ"])); DataTable dt = ADO.GetFullTable("jobs", "Short_Job='" + query.ToString() + "'"); if (dt.Rows.Count >= 1) { short_job = dt.Rows[0]["Short_Job"].ToString(); job = dt.Rows[0]["Job"].ToString(); } else { Session.Abandon(); Response.Redirect("Default.aspx"); } } else { Session.Abandon(); Response.Redirect("Default.aspx"); } }
public void Print_Table() { int i = 0; DataTable dt = ADO.GetFullTable("Workers", "ID=" + Session["ID"] + ""); Response.Write("<table width='300' class='sample'>"); Response.Write("<tr>"); Response.Write("<th bgcolor='92a4b6'>שם עובד</th>"); Response.Write("<th bgcolor='92a4b6'>SMS</th>"); Response.Write("</tr>"); foreach (DataRow dr in dt.Rows) { Response.Write("<tr>"); Response.Write("<td>" + dr["NameW"].ToString() + "</td>"); Response.Write("<td align='center'> <input id='Checkboxs" + i + "'name='sms" + i + "' type='checkbox' "); if (dr["Phone"].ToString() == "") { Response.Write("disabled='disabled' "); } int sms_Required = Check_SMS_Required(dr["NameW"].ToString(), dr["UserID"].ToString(), dr["PassW"].ToString()); Response.Write(" value='" + sms_Required + "' /></td>"); Response.Write("</tr>"); i++; } Response.Write("</table>"); }
protected void Page_Load(object sender, EventArgs e) { DataTable dt = ADO.GetFullTable("Options", "ID=" + (int)Session["ID"]); com = dt.Rows[0]["Comment"].ToString(); show_Comment = dt.Rows[0]["Show_Comment"].ToString(); }
public void Workers() { DataTable dt = ADO.GetFullTable("Workers", "ID=" + Session["ID"]); for (int i = 0; i < dt.Rows.Count; i++) { Response.Write("<option value='" + dt.Rows[i]["NameW"] + "'>" + dt.Rows[i]["NameW"] + "</option>"); } }
public void Add_Jobs() { DataTable dt = ADO.GetFullTable("jobs", "ID=" + Session["ID"].ToString()); foreach (DataRow dr in dt.Rows) { Response.Write("<option value ='" + dr["Short_Job"].ToString() + "'>" + dr["Short_Job"].ToString() + "</option>"); } }
public void Print_Resualt() { int i = 0; DataTable dt = ADO.GetFullTable("Workers", "ID=" + Session["ID"] + ""); DataTable da = ADO.GetFullTable("Users", "ID=" + Session["ID"]); DataTable dOptions = ADO.GetFullTable("Options", "ID=" + (int)Session["ID"]); sms_list = new List <SMS_Message>(); sms_left = int.Parse(dOptions.Rows[0]["Num_Of_SMS"].ToString()); //checking Amount of SMS need int count = 0; foreach (DataRow dr in dt.Rows) { if (Request.Form["sms" + i + ""] != null) { count += int.Parse(Request.Form["sms" + i + ""].ToString()); } i++; } if (count > sms_left) { Response.Write("<script language='javascript'>alert('אין ברשותך מספיק אס אמ אסים');history.go(-1)</script>"); } i = 0; Response.Write("<table width='300' class='sample' align='center' >"); Response.Write("<tr>"); Response.Write("<th bgcolor='92a4b6'>שם עובד</th>"); Response.Write("<th bgcolor='92a4b6'>SMS</th>"); Response.Write("</tr>"); foreach (DataRow dr in dt.Rows) { Response.Write("<tr>"); Response.Write("<td>" + dr["NameW"] + "</td>"); Response.Write("<td "); if (Request.Form["sms" + i + ""] != null)//sending sms { string Wname = dr["NameW"].ToString(); Response.Write(Send_Shifts_sms(dr["Phone"].ToString().Replace("-", ""), Wname, da, dr["UserID"].ToString(), dr["PassW"].ToString())); } else { Response.Write(" align='center' >לא נשלח"); } Response.Write("</td> "); i++; } Response.Write("</table>"); //updating DB sms_left = int.Parse(dOptions.Rows[0]["Num_Of_SMS"].ToString()) - sms_list.Count; ADO.ExecuteNonQuery("Update Options Set Num_Of_SMS=" + sms_left + " where ID=" + Session["ID"] + ""); Session["SMS_Left"] = sms_left; }
public void Print_Table_for_workers() { Response.Write("<tr><td>בוקר<br />" + SM + "-" + EM + "</td>"); for (int i = 0; i < 7; i++) { Response.Write("<td><select style='width: 100px' id='select1' name='" + i + "_morning' size='3' onclick='allow_save()' " + Disable_Shift() + ">" + Print_Options(i, 0, "") + "</select>"); } Response.Write("</tr>"); #region intermediate string needs = ADO.GetFullTable("AI_Optionts", "ID=" + Session["ID"]).Rows[0]["intermediate"].ToString(); // IF there's not intermediate.. if (!(needs == null || needs == "")) { string[] arr = new string[7]; for (int i = 0; i < 7; i++) { arr[i] = ""; } foreach (string need in needs.Split('#')) { string[] param = need.Split('@'); if (param[1] == "" || param[1] == short_job) { arr[int.Parse(param[0])] += param[3] + "@"; } } for (int i = 0; i < 7; i++) { if (arr[i] != "") { arr[i] = arr[i].Remove(arr[i].Length - 1, 1);//remove last @ } } Response.Write("<tr><td>ביניים</td>"); for (int i = 0; i < 7; i++) { Response.Write("<td>"); if (arr[i] != "") { foreach (string shif in arr[i].Split('@')) { Response.Write("<table border='3'><tr><td>" + shif + "</td></tr><tr><td><select style='width: 95px' id='select1' name='InterShift' size='3' onclick='allow_save()' " + Disable_Shift() + ">" + Print_Options(i, 1, shif) + "</select></td></tr></table>"); } } Response.Write("</td>"); } Response.Write("</tr>"); } #endregion Response.Write("<tr><td>ערב<br />" + SE + "-" + EE + "</td>"); for (int i = 0; i < 7; i++) { Response.Write("<td><select style='width: 100px' id='select1' name='" + i + "_evening' size='3' onclick='allow_save()' " + Disable_Shift() + ">" + Print_Options(i, 2, "") + "</select>"); } Response.Write("</tr>"); }
protected void Page_Load(object sender, EventArgs e) { if (!(((bool)Session["Loged_In"]) && ((bool)Session["Admin"]))) { Session.Abandon(); Response.Redirect("Default.aspx"); } num_of_sms = int.Parse(ADO.GetFullTable("Options", "ID=" + Session["ID"]).Rows[0]["Num_Of_SMS"].ToString()); }
protected void Page_Load(object sender, EventArgs e) { if (((bool)Session["Loged_In"]) && ((bool)Session["Admin"])) { if (Request.Form["Save_Changes"] != null) { string sql = "Update Work_Table Set sunday_morning='" + ADO.filter(Request.Form["Sunday_Morning"].ToString()) + "', monday_morning='" + ADO.filter(Request.Form["Monday_Morning"].ToString()) + "', tuesday_morning='" + ADO.filter(Request.Form["Tuesday_Morning"].ToString()) + "', wednesday_morning='" + ADO.filter(Request.Form["Wednesday_Morning"].ToString()) + "', thursday_morning='" + ADO.filter(Request.Form["Thursday_Morning"].ToString()) + "', friday_morning='" + ADO.filter(Request.Form["Friday_Morning"].ToString()) + "', saturday_morning='" + ADO.filter(Request.Form["Saturday_Morning"].ToString()); if (ADO.GetFullTable("Options", "ID=" + Session["ID"]).Rows[0]["intermediate_Shifts"].ToString() == "True") { sql += "', sunday_intermediate='" + ADO.filter(Request.Form["Sunday_intermediate"].ToString()) + "', monday_intermediate='" + ADO.filter(Request.Form["Monday_intermediate"].ToString()) + "', tuesday_intermediate='" + ADO.filter(Request.Form["Tuesday_intermediate"].ToString()) + "', wednesday_intermediate='" + ADO.filter(Request.Form["Wednesday_intermediate"].ToString()) + "', thursday_intermediate='" + ADO.filter(Request.Form["Thursday_intermediate"].ToString()) + "', friday_intermediate='" + ADO.filter(Request.Form["Friday_intermediate"].ToString()) + "', saturday_intermediate='" + ADO.filter(Request.Form["Saturday_intermediate"].ToString()); } sql += "', sunday_evening='" + ADO.filter(Request.Form["Sunday_Evening"].ToString()) + "', monday_evening='" + ADO.filter(Request.Form["Monday_Evening"].ToString()) + "', tuesday_evening='" + ADO.filter(Request.Form["Tuesday_Evening"].ToString()) + "', wednesday_evening='" + ADO.filter(Request.Form["Wednesday_Evening"].ToString()) + "', thursday_evening='" + ADO.filter(Request.Form["Thursday_Evening"].ToString()) + "', friday_evening='" + ADO.filter(Request.Form["Friday_Evening"].ToString()) + "', saturday_evening='" + ADO.filter(Request.Form["Saturday_Evening"].ToString()) + "' where ID=" + Session["ID"] + " And week=2"; try { ADO.ExecuteNonQuery(sql); Label1.Text = "השינויים נשמרו בהצלחה!"; } catch (Exception x) { Label1.Text = "התרחשה שגיאה"; } } if (Request.Form["Erase_All"] != null) { string sql = "Update Work_Table Set sunday_morning='', monday_morning='', tuesday_morning='', wednesday_morning='', thursday_morning='', friday_morning='', saturday_morning='', sunday_intermediate='', monday_intermediate='', tuesday_intermediate='', wednesday_intermediate='', thursday_intermediate='', friday_intermediate='', saturday_intermediate='', sunday_evening='', monday_evening='', tuesday_evening='', wednesday_evening='', thursday_evening='', friday_evening='', saturday_evening='' where ID=" + Session["ID"] + " And week=2"; ADO.ExecuteNonQuery(sql); Response.Redirect("Const_Shifts.aspx"); } } else { Session.Abandon(); Response.Redirect("Default.aspx"); } }
public void Print_Lacks() { bool use_jobs = bool.Parse(Session["Use_Jobs"].ToString()); DataTable dt = ADO.GetFullTable("shift_lacks", "ID=" + Session["ID"]); DataTable table = ADO.GetFullTable("Work_Table", "ID=" + Session["ID"] + " AND week=1"); bool flag = false; string job = ""; if (use_jobs && !bool.Parse(Session["Admin"].ToString())) { job = ADO.GetFullTable("workers", "UserID='" + Session["UserID"] + "'").Rows[0]["job"].ToString(); } string name = Session["Wname"].ToString(); if (use_jobs && (!bool.Parse(Session["Admin"].ToString()))) { name = job + "|" + Session["Wname"].ToString(); } while (name.Length < 13) { name += " "; } Response.Write("<table class='sample' width='500' ><tr>"); Response.Write("<th>תאריך</th><th>יום</th><th>שעה</th><th>כמות</th>"); if (use_jobs) { Response.Write("<th>תפקיד</th>"); } Response.Write("<th>קח משמרת</th>"); Response.Write("</tr>"); foreach (DataRow dr in dt.Rows) { if (bool.Parse(Session["Admin"].ToString()) || ((job == dr["job"].ToString() || dr["job"].ToString() == "")) && (check_available(table, GetNameOfDayE(int.Parse(dr["day_s"].ToString())), name))) { Response.Write("<tr>"); Response.Write("<td align='center'>" + GetDate(int.Parse(dr["day_s"].ToString())) + "</td>"); Response.Write("<td align='center'>" + GetDay(int.Parse(dr["day_s"].ToString())) + "</td>"); Response.Write("<td align='center'>" + dr["session_s"].ToString() + "</td>"); Response.Write("<td align='center'>" + dr["num_of_workers"].ToString() + "</td>"); if (use_jobs) { Response.Write("<td align='center'>" + dr["job"].ToString() + "</td>"); } Response.Write("<td align='center'><a href='Take_lack_shift.aspx?ID=" + dr["Lack_ID"].ToString() + "&name=" + Trans_To_english(name) + "'><img src='Pictures/edit.gif' border='0'></a></td>"); Response.Write("</tr>"); flag = true; } } if (!flag) { Response.Write("<tr><td colspan='6' align='center'>אין חוסרים במשמרות</td></tr>"); } Response.Write("</table>"); }
protected void Page_Load(object sender, EventArgs e) { if (((bool)Session["Loged_In"]) && ((bool)Session["Admin"])) { DataTable dt = ADO.GetFullTable("Work_Table", " ID=" + Session["ID"] + " And week= 2"); SUM = dt.Rows[0]["sunday_morning"].ToString(); MM = dt.Rows[0]["monday_morning"].ToString(); TUM = dt.Rows[0]["tuesday_morning"].ToString(); WM = dt.Rows[0]["wednesday_morning"].ToString(); THM = dt.Rows[0]["thursday_morning"].ToString(); FM = dt.Rows[0]["friday_morning"].ToString(); SAM = dt.Rows[0]["saturday_morning"].ToString(); SUI = dt.Rows[0]["sunday_intermediate"].ToString(); MI = dt.Rows[0]["monday_intermediate"].ToString(); TUI = dt.Rows[0]["tuesday_intermediate"].ToString(); WI = dt.Rows[0]["wednesday_intermediate"].ToString(); THI = dt.Rows[0]["thursday_intermediate"].ToString(); FI = dt.Rows[0]["friday_intermediate"].ToString(); SAI = dt.Rows[0]["saturday_intermediate"].ToString(); SUE = dt.Rows[0]["sunday_evening"].ToString(); ME = dt.Rows[0]["monday_evening"].ToString(); TUE = dt.Rows[0]["tuesday_evening"].ToString(); WE = dt.Rows[0]["wednesday_evening"].ToString(); THE = dt.Rows[0]["thursday_evening"].ToString(); FE = dt.Rows[0]["friday_evening"].ToString(); SAE = dt.Rows[0]["saturday_evening"].ToString(); dt = ADO.GetFullTable("Options", "ID=" + (int)Session["ID"]); SM = dt.Rows[0]["start_morning_shift"].ToString(); EM = dt.Rows[0]["end_morning_shift"].ToString(); SE = dt.Rows[0]["start_evening_shift"].ToString(); EE = dt.Rows[0]["end_evening_shift"].ToString(); Length_Of_Boxes = int.Parse(dt.Rows[0]["Length_Of_Boxes"].ToString()); Length_Of_T_Boxes = int.Parse(dt.Rows[0]["Length_Of_Temp_Boxes"].ToString()); intermediate_Shifts = dt.Rows[0]["intermediate_Shifts"].ToString(); use_jobs = bool.Parse(dt.Rows[0]["Use_Jobs"].ToString()); if (use_jobs && !bool.Parse(Session["Admin"].ToString())) { short_job = ADO.GetFullTable("Workers", "ID=" + Session["ID"] + " AND NameW='" + Session["Wname"] + "'").Rows[0]["Job"].ToString(); } Width_Of_Boxes = 13; } else { Session.Abandon(); Response.Redirect("Default.aspx"); } }
protected void Page_Load(object sender, EventArgs e) { if (Session["Wname"] == null || Session["Cname"] == null || Session["Wname"].ToString() == "" || Session["Cname"].ToString() == "") { Session.Abandon(); Response.Redirect("Default.aspx"); } if ((!Session["Wname"].ToString().Equals("5410c239adb1b45866f162e5ec829ca9")) || (!Session["Cname"].ToString().Equals("2cb6e810b21db557600c5bd1ddba81b2"))) { Session.Abandon(); Response.Redirect("Default.aspx"); } if (Request.QueryString["id"] != null && ADO.filter(Request.QueryString["id"].ToString()) != "") { DataTable dtU = ADO.GetFullTable("Users", " UserName='******'"); if (dtU.Rows.Count > 0) { Session["Use_Jobs"] = bool.Parse(ADO.GetFullTable("Options", "ID=" + dtU.Rows[0][0]).Rows[0]["use_jobs"].ToString()); Session["ID"] = dtU.Rows[0][0]; Session["Admin"] = true; Session["Cname"] = dtU.Rows[0]["CName"]; Session["Wname"] = dtU.Rows[0]["FName"]; Session["Loged_In"] = true; Response.Redirect("Shifts_next_week.aspx"); } else { DataTable dtW = ADO.GetFullTable("Workers", "UserID='" + ADO.filter(Request.QueryString["id"].ToString()) + "'"); if (dtW.Rows.Count > 0) { Session["UserID"] = dtW.Rows[0]["UserID"]; Session["Use_Jobs"] = bool.Parse(ADO.GetFullTable("Options", "ID=" + dtW.Rows[0][0]).Rows[0]["use_jobs"].ToString()); Session["ID"] = dtW.Rows[0][0]; Session["Admin"] = false; Session["Wname"] = dtW.Rows[0]["NameW"]; Session["Cname"] = ADO.GetFullTable("Users", "ID=" + dtW.Rows[0][0]).Rows[0]["CName"]; Session["Loged_In"] = true; Response.Redirect("Shifts_next_week.aspx"); } } } else { Session.Abandon(); Response.Redirect("Default.aspx"); } }
protected void Page_Load(object sender, EventArgs e) { if (ADO.GetFullTable("Workers", "UserID='" + ADO.filter(Request.Form["userid"].ToString()) + "'").Rows.Count != 0) { Label1.Text = "צור קשר עם המנהל שלך על מנת לקבל את ססמתך"; } else { DataTable dt = ADO.GetFullTable("Users", "UserName='******'"); if (dt.Rows.Count == 0) { Label1.Text = "שם המשתמש לא קיים במערכת"; } else { // Makes new MailMessage class, with the adminstrator email. MailMessage mm; mm = new MailMessage(new MailAddress("*****@*****.**"), new MailAddress(dt.Rows[0]["email"].ToString())); // Sets the subject of the e-mail. mm.SubjectEncoding = System.Text.Encoding.UTF8; mm.Subject = "משמרון - שחזור ססמא"; // Sets the body of the e-mail. mm.BodyEncoding = System.Text.Encoding.UTF8; mm.IsBodyHtml = true; mm.Body = "שלום משתמש יקר!"; mm.Body += "<br>"; mm.Body += "הססמא שלך לאתר משמרון היא: "; mm.Body += dt.Rows[0]["Passw"].ToString(); mm.Body += "<br><br>"; mm.Body += "עבור כל שאלה\\הצעה\\בעיה\\תקלה אתם יכולים לפנות אלינו לאימייל [email protected]<br> או דרך טופס יצירת קשר באתר "; mm.Body += "<a href ='www.mishmaron.com'>www.mishmaron.com</a>"; mm.Body += "<br>"; mm.Body += "בכבוד רב"; mm.Body += "<br>"; mm.Body += "צוות התמיכה"; // Making new e-mail server. SmtpClient client = new SmtpClient("localhost"); try { client.Send(mm); Label1.Text = "אימייל נשלח בהצלחה"; } catch (Exception x) { Label1.Text = "האימייל לא נשלח. אנא פנה אלינו דרך דף יצירת הקשר"; } } } }
private bool check_available(string name) { DataTable lacks = ADO.GetFullTable("shift_lacks", "ID=" + Session["ID"]); DataTable table = ADO.GetFullTable("Work_Table", "ID=" + Session["ID"] + " And Week =1"); foreach (DataRow lack in lacks.Rows) { string day = GetNameOfDayE(int.Parse(lack["day_s"].ToString())); if (!table.Rows[0][day + "_morning"].ToString().Contains(name) && !table.Rows[0][day + "_intermediate"].ToString().Contains(name) && !table.Rows[0][day + "_evening"].ToString().Contains(name) && ((name.Contains(lack["job"].ToString())) || (!name.Contains('|')))) { return(true); } } return(false); }
protected void Page_Load(object sender, EventArgs e) { if (!(((bool)Session["Loged_In"]) && ((bool)Session["Admin"]))) { Session.Abandon(); Response.Redirect("Default.aspx"); } DataTable doption = ADO.GetFullTable("Options", "ID=" + Session["ID"]); use_jobs = bool.Parse(doption.Rows[0]["Use_Jobs"].ToString()); num_of_sms = int.Parse(doption.Rows[0]["Num_Of_SMS"].ToString()); lacks = ADO.GetFullTable("shift_lacks", "ID=" + Session["ID"]); table = ADO.GetFullTable("Work_Table", "ID=" + Session["ID"] + " And Week =1"); Width_Of_Boxes = 13; }
protected void Page_Load(object sender, EventArgs e) { if (Request.QueryString["User_ID"] != null) { string Username = ADO.filter(Request.QueryString["User_ID"].ToString()); bool flag = true; Response.Write("<script language='javascript'>"); if (Username.Length < 3 || Username.Length > 15) { flag = false; Response.Write("opener.Registar_Request.USER_ID.style.backgroundColor = '#FF7777';"); Response.Write("opener.Registar_Request.user_ans2.style.color = 'red';"); } else { Response.Write("opener.Registar_Request.user_ans2.style.color = '';"); } if (!CheckNameForLetterse(Username)) { flag = false; Response.Write("opener.Registar_Request.USER_ID.style.backgroundColor = '#FF7777';"); Response.Write("opener.Registar_Request.user_ans1.style.color = 'red';"); } else { Response.Write("opener.Registar_Request.user_ans1.style.color = '';"); } if (flag) { DataTable dtUseru = ADO.GetFullTable("Users", " UserName='******'"); DataTable dtUserw = ADO.GetFullTable("Workers", " UserID='" + ADO.filter(Username) + "'"); if ((dtUseru.Rows.Count > 0) || (dtUserw.Rows.Count > 0)) { Response.Write("opener.Registar_Request.USER_ID.style.backgroundColor = '#FF7777';"); Response.Write("opener.Registar_Request.user_ans.style.color = 'red';"); Response.Write("opener.Registar_Request.user_ans.value = 'תפוס!';"); } else { Response.Write("opener.Registar_Request.USER_ID.style.backgroundColor = '#99FF99';"); Response.Write("opener.Registar_Request.user_ans.style.color = 'green';"); Response.Write("opener.Registar_Request.user_ans.value = 'פנוי!';"); } } Response.Write("self.close()</script>"); } }
protected void Page_Load(object sender, EventArgs e) { if (((bool)Session["Loged_In"]) && ((bool)Session["Admin"])) { DataTable dr = ADO.GetFullTable("options", "ID=" + Session["ID"]); use_intermediate = bool.Parse(dr.Rows[0]["intermediate_Shifts"].ToString()); use_jobs = bool.Parse(dr.Rows[0]["Use_Jobs"].ToString()); jobs = ADO.GetFullTable("Jobs", "ID=" + Session["ID"]); dt = ADO.GetFullTable("AI_Optionts", "ID=" + Session["ID"]); } else { Session.Abandon(); Response.Redirect("Default.aspx"); } }
public void PrintAdmin() { DataRow dt = ADO.GetFullTable("Users", "ID=" + Session["ID"]).Rows[0]; Response.Write("<table border='2' width='600' class='sample' align='center'><tr>"); Response.Write("<th bgcolor='92a4b6'>שם מנהל</th>"); Response.Write("<th bgcolor='92a4b6'>פלאפון</th>"); Response.Write("<th bgcolor='92a4b6'>אימייל</th>"); Response.Write("</tr><tr>"); Response.Write("<td align='center'>" + dt["FName"].ToString() + " </td>"); Response.Write("<td align='center'>" + dt["Phone"].ToString() + " </td>"); Response.Write("<td align='center'><a href='mailto:" + dt["Email"].ToString() + "'>" + dt["Email"].ToString() + "</a> </td>"); Response.Write("</tr>"); Response.Write("</table>"); }
protected void Page_Load(object sender, EventArgs e) { if (!(((bool)Session["Loged_In"]) && ((bool)Session["Admin"]))) { Session.Abandon(); Response.Redirect("Default.aspx"); } if ((ADO.filter(Request.QueryString["week"]) == null) || (ADO.filter(Request.QueryString["week"].ToString()) != "1" && ADO.filter(Request.QueryString["week"].ToString()) != "0")) { Session.Abandon(); Response.Redirect("Default.aspx"); } week = ADO.filter(Request.QueryString["week"].ToString()); num_of_sms = int.Parse(ADO.GetFullTable("Options", "ID=" + Session["ID"]).Rows[0]["Num_Of_SMS"].ToString()); Width_Of_Boxes = 13; }
protected void Page_Load(object sender, EventArgs e) { if ((bool)Session["Loged_In"] && (Request.QueryString["ID"] != null) && ADO.filter(Request.QueryString["ID"].ToString()) != "" && Request.QueryString["name"] != null && ADO.filter(Request.QueryString["name"].ToString()) != "") { string lackID = ADO.filter(Request.QueryString["ID"]); DataRow dr = ADO.GetFullTable("shift_lacks", "Lack_ID=" + lackID + "").Rows[0]; DataTable dt = ADO.GetFullTable("Work_Table", "ID=" + Session["ID"] + " AND week=1"); string day = GetNameOfDayE(int.Parse(dr["day_s"].ToString())); string session = GetSession(dr["session_s"].ToString()); string name = Trans_To_hebrew(ADO.filter(Request.QueryString["name"])); if (!dt.Rows[0][day + "_" + session].ToString().Contains(name)) { string Update_Shift = dt.Rows[0][day + "_" + session].ToString(); //check if there is a lack Shift match_need = FindMatchNeed(dr["job"].ToString(), int.Parse(dr["day_s"].ToString()), GetSessionNum(dr["session_s"].ToString()), ADO.GetFullTable("AI_Optionts", "ID=" + Session["ID"]).Rows[0], dr["session_s"].ToString()); if (GetNumOfWorkersIsShift(Update_Shift, dr["job"].ToString(), dr["session_s"].ToString(), (session == "intermediate")) < match_need.num_of_workers) { Sort S = new Sort(); if (session == "intermediate") { Update_Shift += name + dr["session_s"] + " "; Update_Shift = S.SortString(Update_Shift, true); } else { Update_Shift += name; Update_Shift = S.SortString(Update_Shift, false); } ADO.ExecuteNonQuery("Update Work_Table Set " + day + "_" + session + "='" + Update_Shift + "' Where ID=" + Session["ID"] + " And week=1"); if (int.Parse(dr["num_of_workers"].ToString()) == 1) { ADO.ExecuteNonQuery("Delete From shift_lacks Where Lack_ID=" + lackID); } else { ADO.ExecuteNonQuery("Update shift_lacks Set num_of_workers=" + (int.Parse(dr["num_of_workers"].ToString()) - 1) + " Where Lack_ID=" + lackID); } } } Response.Redirect("lacks.aspx"); } else { Session.Abandon(); Response.Redirect("Default.aspx"); } }
public void PrintList() { DataTable dt = ADO.GetFullTable("Jobs", "ID=" + Session["ID"]); int i = 1; Response.Write("<br><font size=4>"); Response.Write("מספר תפקידים: " + dt.Rows.Count); Response.Write("</font>"); Response.Write("<table border='2' width='600' class='sample'><tr>"); Response.Write("<th bgcolor='92a4b6' width='10'></th>"); Response.Write("<th bgcolor='92a4b6'>קיצור</th>"); Response.Write("<th bgcolor='92a4b6'>תפקיד</th>"); if ((bool)Session["Admin"]) { Response.Write("<th bgcolor='92a4b6'>ערוך</th>"); Response.Write("<th bgcolor='92a4b6'>מחק</th>"); } Response.Write("</tr>"); if (dt.Rows.Count == 0) { Response.Write("<tr>"); Response.Write("<th colspan='6'><center>"); Response.Write("לא הוגדרו תפקידים"); Response.Write("</center></th>"); Response.Write("</tr>"); } else { foreach (DataRow dr in dt.Rows) { Response.Write("<tr>"); Response.Write("<td>" + i + "</td>"); Response.Write("<td>" + dr["Short_Job"].ToString() + " </td>"); Response.Write("<td>" + dr["Job"].ToString() + " </td>"); if ((bool)Session["Admin"]) { Response.Write("<td> <a href ='Update_Job.aspx?SJ=" + Trans_To_english(dr["Short_Job"].ToString()) + "'><center><img src='Pictures/edit.gif' border='0'></center></a></td>"); Response.Write("<td> <a href ='Delete_Job.aspx?SJ=" + Trans_To_english(dr["Short_Job"].ToString()) + "'><center><img src='Pictures/del.gif' border='0'></center></a></td>"); } Response.Write("</tr>"); i++; } } Response.Write("</table>"); }
protected void Page_Load(object sender, EventArgs e) { if (Session["Wname"] == null || Session["Cname"] == null || Session["Wname"].ToString() == "" || Session["Cname"].ToString() == "") { Session.Abandon(); Response.Redirect("Default.aspx"); } if ((!Session["Wname"].ToString().Equals("5410c239adb1b45866f162e5ec829ca9")) || (!Session["Cname"].ToString().Equals("2cb6e810b21db557600c5bd1ddba81b2"))) { Session.Abandon(); Response.Redirect("Default.aspx"); } if (Request.QueryString["id"] != null && ADO.filter(Request.QueryString["id"].ToString()) != "") { DataTable dtU = ADO.GetFullTable("Users", " UserName='******'"); if (dtU.Rows.Count > 0) { string sql = "DELETE FROM Users WHERE UserName ='******'"; ADO.ExecuteNonQuery(sql); int id = int.Parse(dtU.Rows[0]["ID"].ToString()); sql = "DELETE FROM Workers WHERE ID =" + id; ADO.ExecuteNonQuery(sql); sql = "DELETE FROM Options WHERE ID =" + id; ADO.ExecuteNonQuery(sql); sql = "DELETE FROM Work_Table WHERE ID =" + id; ADO.ExecuteNonQuery(sql); } else { DataTable dtW = ADO.GetFullTable("Workers", "UserID='" + ADO.filter(Request.QueryString["id"].ToString()) + "'"); if (dtW.Rows.Count > 0) { string sql = "DELETE FROM Workers WHERE UserID ='" + ADO.filter(Request.QueryString["id"].ToString()) + "'"; ADO.ExecuteNonQuery(sql); } } } else { Session.Abandon(); Response.Redirect("Default.aspx"); } Response.Redirect("Owner_Page.aspx"); }
protected void Page_Load(object sender, EventArgs e) { if (Request.Form["USER_ID"] != null) { DateTime dob = new DateTime(int.Parse(Request.Form["Year"]), int.Parse(Request.Form["Month"]), int.Parse(Request.Form["Day"])); string strSQL = "Insert INTO Users (UserName, Passw, FName, Phone, Email, Cname, Date_Of_Birth, Reg_Date, Days_Left)" + " values ('" + hashmd5.getMd5Hash(ADO.filter(Request.Form["USER_ID"].ToString().TrimEnd(' '))) + "','" + ADO.filter(Request.Form["Password"].ToString().TrimEnd(' ')) + "','" + ADO.filter(Request.Form["Full_Name"].ToString()) + "','" + ADO.filter(Request.Form["phone_start"]) + "-" + ADO.filter(Request.Form["Phone"].ToString()) + "','" + ADO.filter(Request.Form["E_Mail"].ToString().TrimEnd(' ')) + "','" + ADO.filter(Request.Form["Company_Name"].ToString()) + "','" + dob + "','" + DateTime.Now + "','" + DateTime.Now.AddDays(14) + "')"; ADO.ExecuteNonQuery(strSQL); DataTable dt = ADO.GetFullTable("Users", " UserName='******' '))) + "'"); strSQL = "Insert INTO Work_Table(Allow_Changes, week, ID) values('0','0','" + dt.Rows[0][0] + "')"; ADO.ExecuteNonQuery(strSQL); strSQL = "Insert INTO Work_Table(Allow_Changes, week, ID) values('1','1','" + dt.Rows[0][0] + "')"; ADO.ExecuteNonQuery(strSQL); strSQL = "Insert INTO Work_Table(Allow_Changes, week, ID) values('0','2','" + dt.Rows[0][0] + "')"; ADO.ExecuteNonQuery(strSQL); strSQL = "Insert INTO Options(ID, start_morning_shift, end_morning_shift, start_evening_shift, end_evening_shift, Length_Of_Boxes, Length_Of_Temp_Boxes, intermediate_Shifts, Max_Workers, Max_Jobs, Last_Updated, AL_Sunday, AL_Monday, AL_Tuesday, AL_Wednesday, AL_Thursday, AL_Friday, AL_Saturday) values('" + dt.Rows[0][0] + "','10:00','17:00','17:00','23:00','8' ,'4', '0',30 , 5 ,'" + DateTime.Now + "',1,1,1,1,0,0,0)"; ADO.ExecuteNonQuery(strSQL); strSQL = "Insert INTO AI_Optionts(ID) values('" + dt.Rows[0][0] + "')"; ADO.ExecuteNonQuery(strSQL); send_email(); //update sessions Session["ID"] = dt.Rows[0][0]; Session["Admin"] = true; Session["Cname"] = dt.Rows[0]["CName"]; Session["Wname"] = dt.Rows[0]["FName"]; Session["Loged_In"] = true; Session["Use_Jobs"] = false; Session["SMS_Left"] = 0; Session["Days_Left"] = sum_of_days(DateTime.Parse(dt.Rows[0]["Days_Left"].ToString())); //redirect to Guide page Response.Redirect("Guide_Admin.aspx"); } }