//-------------------------------------------------------------------- // Build the Insert command String //-------------------------------------------------------------------- //////////////////////////שמירת תמונה לתלמיד//////////////////////////////////////// public int insertPic(ImgStudent StudentImage) { SqlConnection con; SqlCommand cmd; try { con = connect("DBConnectionString"); // ניצור את הקשר עם הדטה בייס - השם שיופיע פה יופיע בWEBCONFINGS } catch (Exception ex) { throw (ex); } try { int numEffected = 0; string cStr = "UPDATE Student SET Image_='" + StudentImage.Img + "' where Email='" + StudentImage.Email + "'"; // לא קבוע - נשנה לפי הערכים בטבלה, //בניית פקודת דחיפה - הכנסה לדאטהבייס cmd = CreateCommand(cStr, con); numEffected += cmd.ExecuteNonQuery(); return(numEffected); } catch (Exception ex) { return(0); // write to log throw (ex); } }
public string Get(string Id) { ImgStudent i = new ImgStudent(); return(i.getAvatarImage(Id)); }
public void Post([FromBody] ImgStudent StudentImage) { ImgStudent pic = new ImgStudent(); pic.insertPic(StudentImage); }
public void Post([FromBody] ImgStudent img) { ImgStudent pic = new ImgStudent(); pic.insertPic(img); }