private void GetLicenseCode() { DdlLicensCode.DataSource = GlobFuncs.GetDDL("LicenseLevelTable", "LicenseId", "LicenseName"); DdlLicensCode.DataTextField = "name"; DdlLicensCode.DataValueField = "id"; DdlLicensCode.DataBind(); }
public List <creditCardDAL> getCards() { DataBase db = new DataBase(); creditCardDAL cardItem; List <creditCardDAL> cardsList = new List <creditCardDAL>(); DataTable dt = new DataTable(); string sql = "select id,Number,month,year,DigitNo,OwnerId,CustomerId from CreditCardsTable where CustomerId = " + this.customerId; dt = db.ExecuteReader(sql); if (dt.Rows.Count > 0) { for (int i = 0; i < dt.Rows.Count; i++) { cardsList.Add(cardItem = new creditCardDAL() { id = dt.Rows[i]["id"].ToString(), number = GlobFuncs.decription(dt.Rows[i]["Number"].ToString(), ConfigurationManager.AppSettings["encriptionKey"]), month = dt.Rows[i]["month"].ToString(), year = dt.Rows[i]["year"].ToString(), digitNo = dt.Rows[i]["DigitNo"].ToString(), ownerId = dt.Rows[i]["OwnerId"].ToString(), }); } return(cardsList); } return(cardsList); }
private void GetCityList() { TxtCity.DataSource = GlobFuncs.GetDDL("CityTable", "CityId", "CityName"); TxtCity.DataTextField = "name"; TxtCity.DataValueField = "id"; TxtCity.DataBind(); }
public int editOrder() { string external = GlobFuncs.convertExtensionToString(this.extetions); editExtOrder ext = new editExtOrder(this.externalOrderId, this.person.IdNumber, this.person.FullName, this.person.PhoneNumber, this.person.PhoneNumber, this.person.LiccensNumber, this.PickupBranch, this.ReturnBranch, this.PickupDate, this.ReturnDate, this.CarId, 18, external, this.CreditCard.number, this.CreditCard.month, this.CreditCard.year, this.CreditCard.digitNo, this.CreditCard.ownerId, this.notes); string ApiAddress = GlobFuncs.GetApiAddress(this.Company, "editOrderBll"); string Json = JsonConvert.SerializeObject(ext); string returnFlag = GetApi.PostApi(Json, ApiAddress); if (returnFlag != 0.ToString()) { string b = GlobFuncs.GetDetails(this.Company, this.CarId); CarDetails carDetails = new CarDetails(); string[] arr = b.Split('#'); string str = arr[0].Substring(2, arr[0].Length - 3).Replace("\\", ""); carDetails = JsonConvert.DeserializeObject <CarDetails>(str); string pickBr = GlobFuncs.GetBranchName(this.PickupBranch, this.Company); string RetBr = GlobFuncs.GetBranchName(this.ReturnBranch, this.Company); DataBase db = new DataBase(); string sql = "update OrderTable set creditCardId = '" + this.CreditCard.id + "' where RentId = " + this.orderId + ";delete from ExtensInOrder where OrderId = " + this.orderId; db.ExecuteNonQuery(sql); if (this.extetions.Count > 0) { sql = "insert into ExtensInOrder (OrderId,ExtentionId,description,price) values"; foreach (Extention extention in this.extetions) { sql += "(" + int.Parse(db.GetMaxId("OrderTable", "RentId").ToString()) + "," + extention.id + ",'" + extention.description + "'," + extention.Price + "),"; } sql = sql.Substring(0, sql.Length - 1); db.ExecuteNonQuery(sql); } return(1); } return(0); }
public int updateCard() { this.number = GlobFuncs.EncryptString(this.number, ConfigurationManager.AppSettings["encriptionKey"]); string sql = "update CreditCardsTable set Number = '" + this.number + "',month = '" + this.month + "', year = '" + this.year + "', DigitNo = '" + this.digitNo + "' where id = '" + this.id + "'"; DataBase db = new DataBase(); return(db.ExecuteNonQuery(sql)); }
public string GetDetails() { string ObjId = JsonConvert.SerializeObject(this.id); string Address = GlobFuncs.GetApiAddress(int.Parse(this.Company), "CarDetail"); string ret = GetApi.PostApi(ObjId, Address); return(ret); }
//מתודה המקבלת רשימה נפתחת ומביאה את הנתונים שלו private DropDownList GetDropDownList(DropDownList ddl, string table, string idField, string textField) { ddl.DataSource = GlobFuncs.GetDDL(table, idField, textField); ddl.DataValueField = "id"; ddl.DataTextField = "name"; ddl.DataBind(); return(ddl); }
protected void Session_Start(object sender, EventArgs e) { int count = int.Parse(Application["counter"].ToString()); count++; Application["counter"] = count; Application["Companys"] = GlobFuncs.GetCompanyList(); }
protected void Page_Load(object sender, EventArgs e) { person per = new person(); per = (person)Session["person"]; if (!IsPostBack) { if (per == null) { if (Session["search"] != null) { Session["orderQuery"] = Request.RawUrl; Response.Redirect("login.aspx"); } } if (Session["search"] == null) { Response.Redirect("search.aspx"); } TxtOrdEmail.Text = per.Email; TxtOrdName.Text = per.FullName; TxtOrdPhone.Text = per.PhoneNumber; Company = (string)Request["Comapny"]; Car = (string)Request["CarId"]; string tot = GetOrder(); string[] arr = GetTemplate(Company, int.Parse(Car)).Split('#'); LtlMsg.Text = "<script>var temp = JSON.parse(" + arr[0] + "\")\n var search = " + JsonConvert.SerializeObject((searchBLL)Session["search"]) + "</script>"; LtlMsg1.Text = "<script>var extention = JSON.parse(\"" + arr[1] + ")</script>"; LtlMsg2.Text = "<script>var cards = " + GetCreditCards() + "</script>"; List <Extention> extentions = new List <Extention>(); string ext = arr[1].Replace("\\", ""); ext = ext.Substring(0, ext.Length - 1); DataTable table = new DataTable(); table = JsonConvert.DeserializeObject <DataTable>(ext); foreach (DataRow row in table.Rows) { extentions.Add(new Extention(int.Parse(row["id"].ToString()), row["description"].ToString(), int.Parse(row["Price"].ToString()))); } rptExt.DataSource = extentions; rptExt.DataBind(); CreateYearList(); } else { Company = (string)Request["Comapny"]; Car = (string)Request["CarId"]; } if (Request["id"] != null) { BtnOrder.Text = "שמור שינויים"; double o = double.Parse(Request["id"]); double orderId = o / 1825.8976; DataTable orderDt = GlobFuncs.getOrderDataByOrderId(int.Parse(orderId.ToString())); txtNotes.Text = orderDt.Rows[0]["notes"].ToString(); TxtOrdName.Text = per.FullName; ltlExtInOrder.Text = "<script>var extInOrder =" + GlobFuncs.getExtByOrderId(orderId.ToString()) + "\n var creditCardInOrder = " + GlobFuncs.getCreditCardOfOrder(int.Parse(orderId.ToString())) + "</script>"; } }
public string GetCreditCards() { person per = new person(); per = (person)Session["Person"]; string list = GlobFuncs.GetCreditCards(per.CustomId); return(list); }
protected void Page_Load(object sender, EventArgs e) { //קוד שרץ בעת טעינת הדף הראשונית if (!IsPostBack) { //בדיקה האם מדובר במשתמש רשום person per = new person(); per = (person)Session["person"]; if (per == null) { Response.Redirect("/Reg.aspx"); } //יצירת אובייקט הזמנות חדש List <order> orders = new List <order>(); //מילוי נתונים ברפיטר של ההזמנות RptOrders.DataSource = GlobFuncs.getOrdersByCustomerId(per.CustomId); RptOrders.DataBind(); //העברת נתונים לצד לקוח .כמות הזמנות. פרטי כרטיסי אשראי .הודעות. מספר לקוח ltlNo.Text = "<script>var numbers = " + RptOrders.Items.Count + "\n var creditCards = " + GlobFuncs.GetCreditCards(per.CustomId) + " \n let messages = " + GlobFuncs.getChathMasseges(per.CustomId) + " \n var customerOrders = " + GlobFuncs.getCustomerOrders(per.CustomId) + ";\n let allOrders = " + GlobFuncs.getOrdersByCustomerIdJson(per.CustomId) + "\n let searchs = " + GlobFuncs.getAllSearchesByUser(per.CustomId) + "</script>"; //קבלת פרטי הלקוח והזנתו בשדות במסך Users us = GetUser(per.CustomId); TxtName.Text = us.Name; TxtAddress.Text = us.Address; TxtId.Text = us.Id; TxtCity.Text = GlobFuncs.getUnitValue(us.City, "CityId", "CityName", "CityTable"); TxtDateOfBirth.Text = us.BirthDay.Substring(6, 4) + "-" + us.BirthDay.Substring(3, 2) + "-" + us.BirthDay.Substring(0, 2); TxtLicenseNumber.Text = us.LicenseNumber; if (us.DateOfIssuanceLicense != null) { TxtDateOfIssuanceLicense.Text = us.DateOfIssuanceLicense.Substring(6, 4) + "-" + us.DateOfIssuanceLicense.Substring(3, 2) + "-" + us.DateOfIssuanceLicense.Substring(0, 2); } DdlLicensCode.Text = us.LicenseLevel.ToString(); TxtPhone.Text = us.Phone; TxtLicenseCode.Text = GlobFuncs.getUnitValue(us.LicenseLevel, "LicenseId", "LicenseName", "LicenseLevelTable"); //יצירת רשימות נפתחות עבור ערים ודרגות רישיון ddlCity = GetDropDownList(ddlCity, "CityTable", "CityId", "CityName"); DdlLicensCode = GetDropDownList(DdlLicensCode, "LicenseLevelTable", "LicenseId", "LicenseName"); ddlCity.SelectedValue = us.City.ToString(); DdlLicensCode.SelectedValue = us.LicenseLevel.ToString(); //יצירת אובייקט כרטיסי אשראי creaditCardBLL creaditCard = new creaditCardBLL() { customerId = per.CustomId }; //הזנת פרטי כרטיס האשראי בתוך רפיטר של כרטיסי אשראי rptCards.DataSource = creaditCard.getCards(); rptCards.DataBind(); } }
protected void BtnSearch_Click(object sender, EventArgs e) { CreateSearch(); if (Session["person"] != null) { person per = (person)Session["person"]; GlobFuncs.addSearch(ReturnDate.Text.ToString().Substring(0, 10), ReturnDate.Text.ToString().Substring(13), DdlPickupLocation.Text.ToString(), DdlReturnLocation.Text.ToString(), per.CustomId); } Response.Redirect("results.aspx"); }
private void CreateYearList() { List <Year> years = new List <Year>(); years = GlobFuncs.GetYearList(); YearDdl.DataSource = years; YearDdl.DataTextField = "year"; YearDdl.DataValueField = "value"; YearDdl.DataBind(); }
private void GetDdlCitys() { DdlPickupLocation.DataSource = GlobFuncs.GetDDL("CityTable", "CityId", "CityName"); DdlPickupLocation.DataTextField = "name"; DdlPickupLocation.DataValueField = "id"; DdlPickupLocation.DataBind(); DdlReturnLocation.DataSource = GlobFuncs.GetDDL("CityTable", "CityId", "CityName"); DdlReturnLocation.DataTextField = "name"; DdlReturnLocation.DataValueField = "id"; DdlReturnLocation.DataBind(); }
//מתודה שרצה כאשר המשתמש הקליק על כפתור ערוך הזמנה //המתודה מעבירה את המשתמש לדף עריכת הזמנה עבור ההזמנה הספציפית protected void RptOrders_ItemCommand(object source, RepeaterCommandEventArgs e) { int orderIndex = e.Item.ItemIndex; person person = new person(); person = (person)Session["person"]; List <order> orders = GlobFuncs.getOrdersByCustomerId(person.CustomId); searchBLL search = new searchBLL(orders[orderIndex].PickupBranch.ToString(), orders[orderIndex].PickupDate.Substring(6, 4) + "-" + orders[orderIndex].PickupDate.Substring(3, 2) + "-" + orders[orderIndex].PickupDate.Substring(0, 2), orders[orderIndex].ReturnBranch.ToString(), orders[orderIndex].ReturnDate.Substring(6, 4) + "-" + orders[orderIndex].ReturnDate.Substring(3, 2) + "-" + orders[orderIndex].ReturnDate.Substring(0, 2)); Session["search"] = search; Response.Redirect("Order.aspx?Comapny=" + GlobFuncs.getComanyIdByName(orders[orderIndex].CompanyId) + "&CarId=" + orders[orderIndex].CarId + "&id=" + int.Parse(orders[orderIndex].RentId.ToString()) * 1825.8976); }
protected void BtnSend_Click(object sender, EventArgs e) { try { GlobFuncs.SendEmail(TxtEmail.Text.ToString(), "התקבלה פניה במערכת vancars", "<div style=\"text-align:center\"><h1>שלום " + TxtName.Text.ToString() + "</h1><h1>פנייתך נשלחה למערכת vancars</h1><br/><h4>להלן פרטי הפנייה שנשלחו אלינו</h4><br/>" + TxtMsg.Text.ToString() + "</br><h4>אנו נעשה כמיטב יכולתינו לטפל בפנייתך בהקדם</h4></div>"); GlobFuncs.SendEmail("*****@*****.**", "התקבלה פניה מאת " + TxtName.Text.ToString() + " בנושא " + TxtSubject.Text.ToString(), "<div style=\"text-align:center\">" + TxtMsg.Text.ToString() + "</div>"); showErrorMwssage(2010, ""); } catch (Exception Ex) { showErrorMwssage(0, Ex.Message); } }
protected void getJson() { searchBLL search = (searchBLL)Session["search"]; string id = Request["search"]; if (id != null) { search = GlobFuncs.getSearchById(int.Parse(id)); } if (search == null) { Response.Redirect("search.aspx"); } if (search.PickupDate.Contains("/")) { search.PickupDate = search.PickupDate.Substring(0, 10); search.ReturnDate = search.ReturnDate.Substring(0, 10); string pickdate = search.PickupDate.Substring(6, 4); string retdate = search.ReturnDate.Substring(6, 4); pickdate = pickdate + "-"; retdate = retdate + "-"; pickdate = pickdate + search.PickupDate.Substring(0, 2); retdate = retdate + search.ReturnDate.Substring(0, 2); pickdate = pickdate + "-"; retdate = retdate + "-"; pickdate = pickdate + search.PickupDate.Substring(3, 2); retdate = retdate + search.ReturnDate.Substring(3, 2); search.PickupDate = pickdate; search.ReturnDate = retdate; } string ret = search.GetList(); LtlMsg.Text = "<script>var cars=JSON.parse(" + ret + ")\n var companys = " + GlobFuncs.GetCompanyList() + "</script>"; DdlPickupLocation.DataSource = GlobFuncs.GetDDL("CityTable", "CityId", "CityName"); DdlPickupLocation.DataTextField = "name"; DdlPickupLocation.DataValueField = "id"; DdlPickupLocation.DataBind(); DdlPickupLocation.SelectedValue = search.PickupLocation; DdlReturnLocation.DataSource = GlobFuncs.GetDDL("CityTable", "CityId", "CityName"); DdlReturnLocation.DataTextField = "name"; DdlReturnLocation.DataValueField = "id"; DdlReturnLocation.DataBind(); DdlReturnLocation.SelectedValue = search.ReturnLocarion; string date = search.PickupDate + " - " + search.ReturnDate; ReturnDate.Text = date.Substring(5, 2) + "/" + date.Substring(8, 2) + "/" + date.Substring(0, 4) + " - " + date.Substring(18, 2) + "/" + date.Substring(21, 2) + "/" + date.Substring(13, 4); if (ret.Length < 20) { showErrorMwssage(2009); } }
//פונקציה המקבלת אובייקת רשימה נפתחת וטבלת ערכים ומאתחלת את הרשימה private void getDdlSource(DropDownList dropDownList, string tableName, string idName, string valueName, string moreLine) { if (moreLine.Length > 0) { dropDownList.DataSource = GlobFuncs.addMoreLine(GlobFuncs.GetDDL(tableName, idName, valueName), moreLine); } else { dropDownList.DataSource = GlobFuncs.GetDDL(tableName, idName, valueName); } dropDownList.DataTextField = "name"; dropDownList.DataValueField = "id"; dropDownList.DataBind(); }
private async void UpdateSuggests(string q) { string query = string.Format(GlobFuncs.getConfig("serviceAutoComplit"), GlobFuncs.getConfig("token"), q); internet = new OnlineStreem(query, log); await internet.PostCallAPI(); internet.getAddress(); Suggests.Clear(); foreach (var l in internet.getAddress()) { Suggests.Add(l); } this.machine.Fire(ViewTrigger.SelectPlaceOnMap); }
protected void BtnForget_Click(object sender, EventArgs e) { if (TxtForget.Text == null) { TxtForget.Focus(); } else { TimingPass = GlobFuncs.ForgetPass(TxtForget.Text.ToString()); TxtTemporary.Visible = true; LtlMsg.Visible = true; BtnGo.Visible = true; //GlobFuncs.SendEmail(TxtForget.Text.ToString(), "שחזור סיסמה ממערכת VanCar", "הקוד הזמני הוא: " + TimingPass.ToString()); GlobFuncs.SendEmail(TxtForget.Text.ToString(), "שחזור סיסמה ממערכת VanCar", "<div style=\"text-align:center\"><h1>התקבלה בקשה לשחזור סיסמתך במערכת vancars</h1><h3>הקוד לשחזור הסיסמה הוא:" + TimingPass.ToString() + "</h3></div>"); } }
public FrameViewModel() { wellcome = new wellcome(); wellcome.Show(); Log log = new Log(new Callback(MainStatus)); Machine = new Machine(); DataManager D = new DataManager(log); stateConfigure(Machine, D); loge = log.LogMessege("log working:)", true); eventConnect(D); D.InputFromUrl(GlobFuncs.getConfig("dataUrl")); D.viewData(); }
public List <string> CreateExtOrder() { string external = GlobFuncs.convertExtensionToString(this.extetions); ExtOrder ext = new ExtOrder(this.person.IdNumber, this.person.FullName, this.person.PhoneNumber, this.person.PhoneNumber, this.person.LiccensNumber, this.PickupBranch, this.ReturnBranch, this.PickupDate, this.ReturnDate, this.CarId, 18, external, this.CreditCard.number, this.CreditCard.month, this.CreditCard.year, this.CreditCard.digitNo, this.CreditCard.ownerId, this.notes); string ApiAddress = GlobFuncs.GetApiAddress(this.Company, "OrderBll"); string Json = JsonConvert.SerializeObject(ext); string a = GetApi.PostApi(Json, ApiAddress); List <string> ordNo = new List <string>(); if (a != null) { a = a.Substring(1, a.Length - 2); ordNo.Add(a); string b = GlobFuncs.GetDetails(this.Company, this.CarId); CarDetails carDetails = new CarDetails(); string[] arr = b.Split('#'); string str = arr[0].Substring(2, arr[0].Length - 3).Replace("\\", ""); carDetails = JsonConvert.DeserializeObject <CarDetails>(str); string pickBr = GlobFuncs.GetBranchName(this.PickupBranch, this.Company); string RetBr = GlobFuncs.GetBranchName(this.ReturnBranch, this.Company); DataBase db = new DataBase(); string sql = "insert into OrderTable (CustomId,ExternalRentId,totalPrice,CarName,CarId,CarLevel,CompanyId,Seats,GearBox,EngineCapacity,Doors,Beags,PickupBranch,PickupBranchText,PickupDate,ReturnBranch,ReturnBranchText,ReturnDate,creditCardId,Status,notes)values" + " ('" + this.person.CustomId + "','" + a + "'," + this.totalPrice + ",'" + carDetails.CarName + "'," + this.CarId + ",'" + carDetails.CarLevel + "','" + this.Company + "','" + carDetails.Seats + "','" + carDetails.GearBox + "','" + carDetails.EngineCapacity + "','" + carDetails.Doors + "','" + carDetails.Baegs + "','" + this.PickupBranch + "','" + pickBr + "','" + this.PickupDate + "','" + this.ReturnBranch + "','" + RetBr + "','" + this.ReturnDate + "','" + this.CreditCard.id + "','2','" + this.notes + "')"; int SuccessFlag = db.ExecuteNonQuery(sql); if (SuccessFlag > 0) { ordNo.Add(db.GetMaxId("OrderTable", "RentId").ToString()); if (this.extetions.Count > 0) { sql = "insert into ExtensInOrder (OrderId,ExtentionId,description,price) values"; foreach (Extention extention in this.extetions) { sql += "(" + int.Parse(db.GetMaxId("OrderTable", "RentId").ToString()) + "," + extention.id + ",'" + extention.description + "'," + extention.Price + "),"; } sql = sql.Substring(0, sql.Length - 1); db.ExecuteNonQuery(sql); } return(ordNo); } ordNo.Add("Error"); } else { ordNo.Add("Error"); } return(ordNo); }
protected void BtnOrder_Click(object sender, EventArgs e) { if (TxtOrdName.Text.Length < 1) { showErrorMwssage(1003); } else if (TxtOrdEmail.Text.Length < 1) { showErrorMwssage(1004); } else { string cardId; if (hdnCard.Value == "-1") { person person = new person(); person = (person)Session["person"]; creaditCardBLL creaditCard = new creaditCardBLL() { id = GlobFuncs.createCreditCardId(), number = TxtCard.Text.ToString(), month = monthDdl.SelectedValue.ToString(), year = YearDdl.SelectedValue.ToString(), digitNo = TxtCvv.Text.ToString(), ownerId = TxtId.Text.ToString(), customerId = person.CustomId }; cardId = creaditCard.AddCard(); } else { cardId = hdnCard.Value; } Session["selectedExt"] = hdnSelectedExt.Value; Session["totPrice"] = hdnPrice.Value; Session["notes"] = txtNotes.Text; if (BtnOrder.Text != "שמור שינויים") { Response.Redirect("OrderConfirmation.aspx?Company=" + Company + "&CarId=" + Car + "&card=" + cardId); } else { Response.Redirect("OrderConfirmation.aspx?Company=" + Company + "&CarId=" + Car + "&card=" + cardId + "&id=" + Request["id"]); } } }
public string addCard() { this.number = GlobFuncs.EncryptString(this.number, ConfigurationManager.AppSettings["encriptionKey"]); DataBase db = new DataBase(); string sql = "insert into CreditCardsTable(id,Number,month,year,DigitNo,OwnerId,CustomerId) " + "values ('" + this.id + "','" + this.number + "','" + this.month + "','" + this.year + "','" + this.digitNo + "','" + this.ownerId + "'," + this.customerId + ")"; int success = db.ExecuteNonQuery(sql); if (success > 0) { return(this.id); } else { return("error"); } }
//מתודה השומרת פרטי כרטיס אשראי חדשים protected void addCreditCard_Click(object sender, EventArgs e) { if (txtCradNumber.Text == "") { showErrorMwssage(1005); } else if (txtCardMonth.Text == "") { showErrorMwssage(2002); } else if (txtCardYear.Text == "") { showErrorMwssage(2003); } else if (txtCardCvv.Text == "") { showErrorMwssage(2004); } else if (txtOwnerId.Text == "") { showErrorMwssage(2005); } else { person per = new person(); per = (person)Session["person"]; creaditCardBLL creaditCard = new creaditCardBLL() { id = GlobFuncs.createCreditCardId(), number = txtCradNumber.Text, month = txtCardMonth.Text, year = txtCardYear.Text, digitNo = txtCardCvv.Text, ownerId = txtOwnerId.Text, customerId = per.CustomId }; string txtCardId = creaditCard.AddCard(); rptCards.DataSource = creaditCard.getCards(); rptCards.DataBind(); ScriptManager.RegisterClientScriptBlock(this, this.GetType(), "hideModal", "hideAddCreditCardModal()", true); Response.Redirect("PrivateArea.aspx#CreditCards"); } }
protected void BtnLogin_Click(object sender, EventArgs e) { string pass = GlobFuncs.Hash(TextBox2.Text.ToString()); Users us = new Users(TextBox1.Text.ToString(), pass); person persn = new person(); persn = us.Login(); if (persn != null) { if (persn.CustomId > 0) { Session["Person"] = persn; if (Session["orderQuery"] != null) { string sourceString = Session["orderQuery"].ToString(); if (sourceString.Contains("order.aspx")) { Response.Redirect(sourceString); } } Response.Redirect("PrivateArea.aspx"); } else if (persn.CustomId == -2) { showErrorMwssage(1); } else if (persn.CustomId == -3) { showErrorMwssage(2); } else { showErrorMwssage(3); } } else { showErrorMwssage(1); } }
public string GetCars() { string result = "\"["; string json = JsonConvert.SerializeObject(this); DataTable dt = new DataTable(); dt = GlobFuncs.getCarsApis(); foreach (DataRow row in dt.Rows) { string res = GetApi.PostApi(json, row["ApiAddress"].ToString() + "CarsBLL"); if (res.Length > 0) { res = res.Replace("}", ",\\\"Company\\\":" + row["CompanyId"] + "\\r\\n }"); res = res.Substring(2, res.Length - 4) + ","; result = result + res; } } result = result.Substring(0, result.Length - 1); result = result + "]\""; return(result); }
protected void Page_Load(object sender, EventArgs e) { //פונקציות שרצות בעת הטעינה הראשונית של הדף if (!IsPostBack) { //קריאה ארבע פעמים לפונקציה שמאתחלת נתונים בתוך רשימה נפתחת getDdlSource(companyDdl, "CompanysTable", "CompanyId", "CompanyName", "חברה נוספת"); getDdlSource(ddlCity, "CityTable", "CityId", "CityName", " עיר נוספת "); getDdlSource(carLevelDdl, "CarLevelTable", "IdLevel", "LevelName", " דרגת רכב נוסף "); getDdlSource(companyDdl1, "CompanysTable", "CompanyId", "CompanyName", ""); //הבאת נתונים מצד השרת ושתילתו בתוך משתנים בצד הלקוח string[] arr = GlobFuncs.getUnreadChats(); ltlAllOrders.Text = "<script>var allOrders = " + GlobFuncs.getAllOrders() + "</script>"; ltlAllCustomers.Text = "<script>var allCustomers= " + GlobFuncs.getAllCustomers() + "</script>"; ltlChatsUnread.Text = "<script>var chatsUnread = " + arr[0] + "</script>"; //פונקציה הבודקת אם המשתמש רשום או אינו מורשה לגשת לדף זה checkeIsAdmin(); } }
protected void BtnChange_Click(object sender, EventArgs e) { if (pass.Text != pass2.Text) { Msg3.Visible = true; Msg3.Text = "אימות סיסמה נכשל נא הזן שוב אימות סיסמה"; pass2.Focus(); } else { bool b = GlobFuncs.UpdateDB("CustomersTable", "Password", GlobFuncs.Hash(pass.Text.ToString()), "Email", TxtForget.Text.ToString()); if (b == true) { person per = new person(); per = (person)Session["Person"]; Response.Redirect("PrivateArea.aspx"); } else { Msg3.Text = "התרחשה שגיאה בעת עדכון הסיסמה, נא נסה שנית"; } } }
public void getCardDetails() { string sql = "select * from CreditCardsTable where id = '" + this.id + "'"; DataBase dataBase = new DataBase(); DataTable dataTable = dataBase.ExecuteReader(sql); if (dataTable.Rows.Count == 0) { this.id = "-1"; return; } else { DataRow row = dataTable.Rows[0]; this.id = row["id"].ToString(); this.number = GlobFuncs.decription(row["number"].ToString(), ConfigurationManager.AppSettings["encriptionKey"]); this.month = row["month"].ToString(); this.year = row["year"].ToString(); this.digitNo = row["digitNo"].ToString(); this.ownerId = row["ownerId"].ToString(); return; } }