Exemplo n.º 1
0
    //--------------------------------------------------------------------
    // 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);
        }
    }
Exemplo n.º 2
0
        public string Get(string Id)
        {
            ImgStudent i = new ImgStudent();

            return(i.getAvatarImage(Id));
        }
Exemplo n.º 3
0
        public void Post([FromBody] ImgStudent StudentImage)
        {
            ImgStudent pic = new ImgStudent();

            pic.insertPic(StudentImage);
        }
Exemplo n.º 4
0
        public void Post([FromBody] ImgStudent img)
        {
            ImgStudent pic = new ImgStudent();

            pic.insertPic(img);
        }