Example #1
0
    public ArrayList getLayouts(string url)
    {
        using (SqlConnection dbCon = new SqlConnection("Data Source=desktop-pc\\sqlexpress;Initial Catalog=click manager;Persist Security Info=True;User ID=click_manager;Password=password"))
        {
            //open connection
            dbCon.Open();

            //create reade query
            SqlCommand readCommand = new SqlCommand("SELECT min, max FROM layouts WHERE url = @url", dbCon);
            readCommand.Parameters.AddWithValue("@url", url);

            //create list of results
            ArrayList layouts = new ArrayList();
            SqlDataReader reader = readCommand.ExecuteReader();

            while (reader.Read())
            {
                layout resp = new layout();
                resp.min = reader["min"].ToString();
                resp.max = reader["max"].ToString();

                layouts.Add(resp);
            }

            //close connection
            dbCon.Close();

            //return results
            return layouts;
        }
    }
Example #2
0
    public ArrayList getLayouts(string url)
    {
        using (SqlConnection dbCon = new SqlConnection("Data Source=desktop-pc\\sqlexpress;Initial Catalog=click manager;Persist Security Info=True;User ID=click_manager;Password=password"))
        {
            //open connection
            dbCon.Open();

            //create reade query
            SqlCommand readCommand = new SqlCommand("SELECT min, max FROM layouts WHERE url = @url", dbCon);
            readCommand.Parameters.AddWithValue("@url", url);

            //create list of results
            ArrayList     layouts = new ArrayList();
            SqlDataReader reader  = readCommand.ExecuteReader();

            while (reader.Read())
            {
                layout resp = new layout();
                resp.min = reader["min"].ToString();
                resp.max = reader["max"].ToString();

                layouts.Add(resp);
            }

            //close connection
            dbCon.Close();

            //return results
            return(layouts);
        }
    }
Example #3
0
        public async Task <IHttpActionResult> Putlayout(int id, layout layout)
        {
            if (!ModelState.IsValid)
            {
                return(BadRequest(ModelState));
            }

            if (id != layout.id)
            {
                return(BadRequest());
            }

            db.Entry(layout).State = EntityState.Modified;

            try
            {
                await db.SaveChangesAsync();
            }
            catch (DbUpdateConcurrencyException)
            {
                if (!layoutExists(id))
                {
                    return(NotFound());
                }
                else
                {
                    throw;
                }
            }

            return(StatusCode(HttpStatusCode.NoContent));
        }
Example #4
0
        /// <summary>
        /// 無 Layout
        /// </summary>
        /// <param name="subject">主旨</param>
        /// <param name="content">內文</param>
        /// <returns></returns>
        public layout NotLayout(string subject, string content)
        {
            layout layout = new layout();

            layout.Layout_Subject = subject;
            layout.Layout_Content = content;
            return(layout);
        }
Example #5
0
        public async Task <ActionResult> DeleteConfirmed(int id)
        {
            layout layout = await db.layout.FindAsync(id);

            db.layout.Remove(layout);
            await db.SaveChangesAsync();

            return(RedirectToAction("Index"));
        }
Example #6
0
        public async Task <IHttpActionResult> Postlayout(layout layout)
        {
            if (!ModelState.IsValid)
            {
                return(BadRequest(ModelState));
            }

            db.layouts.Add(layout);
            await db.SaveChangesAsync();

            return(CreatedAtRoute("DefaultApi", new { id = layout.id }, layout));
        }
Example #7
0
 public v(int numberOfSectors, int placesPerSector)
 {
     layout
         = new layout(
               numberOfSectors
               ,
               placesPerSector)
         ;
     DATA
         =
             new DATA(
                 numberOfSectors);
 }
Example #8
0
 public v(int numberOfSectors, int placesPerSector)
 {
     layout
             = new layout(
                           numberOfSectors
                                           ,
                                            placesPerSector)
                                                             ;
     DATA
          =
             new DATA(
                       numberOfSectors);
 }
 public bool AddNewLayout(layout layout)
 {
     try
     {
         _entities.layout.Add(layout);
         _entities.SaveChanges();
     }
     catch
     {
         return(false);
     }
     return(true);
 }
Example #10
0
        public async Task <IHttpActionResult> Deletelayout(int id)
        {
            layout layout = await db.layouts.FindAsync(id);

            if (layout == null)
            {
                return(NotFound());
            }

            db.layouts.Remove(layout);
            await db.SaveChangesAsync();

            return(Ok(layout));
        }
Example #11
0
        // GET: layouts/Details/5
        public async Task <ActionResult> Details(int?id)
        {
            if (id == null)
            {
                return(new HttpStatusCodeResult(HttpStatusCode.BadRequest));
            }
            layout layout = await db.layout.FindAsync(id);

            if (layout == null)
            {
                return(HttpNotFound());
            }
            return(View(layout));
        }
Example #12
0
    // to drag and drop images
    public void OnEndDrag(PointerEventData eventData)
    {
        layout     layout     = new layout();
        GameObject gameObject = layout.GetobjectUndermouse();

        if (gameObject.tag == "BottomRightPlane")
        {
            this.transform.position       = bottomRightPlanePos;
            gameObject.transform.position = objectDragged;
        }
        else if (gameObject.tag == "BottomLeftPlane")
        {
            this.transform.position       = bottomLeftPlanePos;
            gameObject.transform.position = objectDragged;
        }
        else if (gameObject.tag == "TopHalfPlane")
        {
            // its not working as required
            this.transform.position = topHalfPlanePos;
            Vector2 pos = new Vector2(300f, 110f);
            gameObject.transform.position = pos;
        }
        GetComponent <Image>().raycastTarget = true;
    }
Example #13
0
using System;
Example #14
0
 public void notify(System.Web.UI.Page myPage, string message, allTypes types, layout layout, string timeout)
 {
     ScriptManager.RegisterClientScriptBlock(myPage, typeof(Page), "notification2", "notification3('" + message + "','" + types + "','" + layout + "','" + timeout + "')", true);
 }
Example #15
0
        public layout Layout_SapErrorData(string subject, string content)
        {
            layout layout         = new layout();
            string layout_Content = string.Empty;

            layout_Content = @"
<body style='margin:0px; padding:0px'>
    <table width='100%' border='0' align='left'  valign='top'  cellpadding='0' cellspacing='3'>
      <tr>
        <td style='padding-top:5px'>"
                             + "<img src =\'cid:LayoutImg0\' style='height:48px; width:auto' />" +
                             @"</td>
      </tr>
      <tr>
        <td>      
              <table style='height: 6px; width: 100%; border: 0px;' border='0' cellpadding='0' cellspacing='0'>
                <tr style='height: 5px;'>
                    <td> "
                             + "<img src =\'cid:LayoutImg1\' width='100%' />" +
                             @"</td>
                </tr>

             </table>
        </td>
      </tr>
      <tr>
        <td>
          <!--這是標題td-->
          <h1 style='font-size:18px; color:#00764B; margin:5px 0px; font-weight:bold'>" +
                             subject
                             + @"</h1>
          <!--標題td結束-->
        </td>
      </tr>
      <tr>
        <td align='left' valign='top' style='padding-bottom:30px; padding-top:10px; font-size:12px ; color: #333; '>" +
                             content
                             + @"</td>
      </tr>
      <tr>
        <td>
          <table width='100%' border='0' cellpadding='0' cellspacing='0'>
            <tr>
              <td style='width:87px'>"
                             + "<img src=\"cid:LayoutImg2\" width='87' height='16'/>" +
                             @"</td>
              <td valign='middle' style='padding-right:5px'>
           
             <table style='height: 1px; width: 100%; border: 0px;' border='0' cellpadding='0' cellspacing='0'>
                <tr style='height: 1px;'>
                    <td style='border:0; height:1px; background-color:#d4d4d4; width: 100%'></td>
                </tr>
             </table>


              </td>
            </tr>
          </table>
        </td>
      </tr>
      <tr>
        <td style='padding:0px 5px 5px 20px'>
          <table width='100%' border='0' cellspacing='0' cellpadding='0'>
            <tr>
              <td height='40' align='left' valign='middle' width='120px'>
                <table border='0' align='left' cellpadding='0' cellspacing='0'>
                  <tr>
                    <td align='left' valign='middle' >
                      <a href='" + new ServerInfoUtility().WebPath + "' target='_blank' style='text-decoration:none;'>"
                             + "<img src =\'cid:LayoutImg3\' />" +
                             @"</a>
                    </td>
                  </tr>
                </table>
              </td>
              <td style='padding-top:5px; color:#22415d;'>
                  This is an automated message, please do not reply.
              </td>
            </tr>

          </table>
        </td>
      </tr>
      <tr>
        <td valign='middle' style='padding-right:5px; padding-left:5px; '>
	

            <table style='height: 2px; width: 100%; border: 0px;' border='0' cellpadding='0' cellspacing='0'>
                <tr style='height: 1px;'>
                    <td style='border:0; height:1px; background-color: #CCC; margin:0px; width: 100%'></td>
                </tr>
                <tr style='height: 1px;'>
                    
                </tr>
             </table>

        </td>
      </tr>
      <tr>
        <td>
            <p style='padding:5px 10px ; color:#999; font-size:10px; margin:0px'>The information contained in this e-mail message (and any attachment transmitted herewith) is for the exclusive use of intended addressee(s) only and is confidential information. If you have received this electronic message in error, please reply to the sender highlighting the error and destroy the original message and all copies immediately.</p>
            <p style='padding:2px 10px 5px 10px; color:#999; font-size:10px; margin:0px'>本郵件(包括其附件)所含訊息為保密訊息,僅為特定收件人之用。如你誤收此郵件,請立即通知發件人,並將郵件銷毀。</p>
        </td>
      </tr>
      <tr style='border-bottom: double 4px #d4d4d4'>
        <td><p style='padding:5px 10px ; color:#999; font-size:10px; margin:0px'>"
                             + "<img src=\"cid:LayoutImg4\" /></p>" + @"

             <table style='height: 1px; width: 100%; border: 0px;' border='0' cellpadding='0' cellspacing='0'>
                <tr style='height: 1px;'>
                    <td style='border:0; height:1px; background-color: #CCC; margin:1px 0px 0px 0px; width: 100%'></td>
                </tr>
             </table>

        </td>
      </tr>
    </table>
</body>";
            layout.Layout_Subject = subject;
            layout.Layout_Content = layout_Content;
            //layout.ContentImgPathList = contentImgPathList;
            return(layout);
        }