Example #1
0
        /// The downLoadDrawing method accept a drawingIdent parameter as well
        /// as a reference to an error string
        /// The method calls downLoadPict on CPicture class and return the stream
        /// If and error occurs then the stream is null and an error
        /// message is writtent to the error parameter
        ///
        /// This method shall be called after a call to getDrawing. When getDrawing
        /// is called it will store a copy of the picture on the server and also return
        /// a drawingCL object with the drawingIdent. This identity is used when this
        /// method is called.
        public Stream downLoadDrawing(string drawingIdent)
        {
            string   error = "";
            CDrawing cd    = new CDrawing();

            return(cd.downLoadDrawing(drawingIdent, ref error));
        }
Example #2
0
 public void ReloadControl(Form frm)
 {
     //foreach (CDrawing draw in _listControls) -- requires IEnumerable implementation.
     for (int i = 0; i < _listControls.Count; i++)
     {
         CDrawing d = (CDrawing)_listControls[i];
         d.Draw(frm);
     }
 }
Example #3
0
        /// <summary>
        /// Deletes a drawing from the database. The drawing is
        /// identified by ventil_id and drawingNo (PK).
        /// Return value is a DrawingCl with errCode = 0
        /// and errMessage as an empty string. On error
        /// the errCode is not 0 and the errMessage tells
        /// what was going wrong
        /// </summary>
        /// <param name="ident"></param>
        /// <param name="d"></param>
        /// <returns></returns>
        /// 2019-05-15 KJBO
        public DrawingCL deleteDrawing(string ident, DrawingCL d)
        {
            CDrawing cd = new CDrawing();

            return(cd.deleteDrawing(ident, d));
        }
Example #4
0
        /// <summary>
        /// Get a drawing from the database identified by
        /// primary key (ventil_id, drawingNo)
        /// Returns a DrawingCL object with the drawingIdent
        /// field with a file name to the file being extracted
        /// by the server.
        /// If the fileName is empty or begins with -1 then
        /// there is an error while extracting the picture from
        /// the database to the temporary storage
        ///
        /// After this function is called there has to be a call
        /// to downloadDrawing with the drawingIdent as parameter
        /// This function returns the drawing to the caller as
        /// a memoryStream
        /// </summary>
        /// <param name="ident"></param>
        /// <param name="ventilId"></param>
        /// <param name="ritningNo"></param>
        /// <returns></returns>
        /// 2019-05-08 KJBO
        public DrawingCL getDrawing(string ident, string ventilId, int ritningNo)
        {
            CDrawing cd = new CDrawing();

            return(cd.getDrawing(ident, ventilId, ritningNo));
        }
Example #5
0
        /// <summary>
        /// Upload a drawing from client to server
        /// </summary>
        /// <param name="sPict"></param>
        /// <returns></returns>
        /// 2019-05-06 KJBO
        public string uploadDrawing(Stream sPict)
        {
            CDrawing cd = new CDrawing();

            return(cd.uploadDrawing(sPict));
        }
Example #6
0
        /// <summary>
        /// Updates the drawing metadata.
        /// Note that the drawing must exist, identified
        /// by the following properties in the drawing class:
        /// ventil_id, DrawingNo.
        /// For performance reason this method does not evaluate
        /// the drawing size.
        /// </summary>
        /// <param name="ident"></param>
        /// <param name="d"></param>
        /// <returns></returns>
        /// 2019-05-27 KJBO
        public DrawingCL updateDrawingMetaData(string ident, DrawingCL d)
        {
            CDrawing cd = new CDrawing();

            return(cd.updateDrawingMetaData(ident, d));
        }
Example #7
0
        /// <summary>
        /// This method returns all drawings for one ventil
        /// Note that you dont get the actual drawing nor the
        /// drawingIdent. Instead you use this method for getting a
        /// list of available drawings (and also gets the drawing
        /// description).
        /// After that you have to call GetDrawing and DownloadDrawing
        /// in turn in order to get each individual drawing.
        /// The reason for this is performance. This method gives
        /// a fast list of available drawings only.
        /// </summary>
        /// <param name="ident"></param>
        /// <param name="vartOrdernr"></param>
        /// <param name="radnr"></param>
        /// <returns></returns>
        /// 2016-03-11 Pergas AB kjbo
        public List <DrawingCL> getDrawingsForVentil(string ident, string ventilId)
        {
            CDrawing cd = new CDrawing();

            return(cd.getDrawingsForVentil(ident, ventilId));
        }
Example #8
0
 public void AddControls(CDrawing theControls)
 {
     _listControls.Add(theControls);
 }
Example #9
0
 public override bool PreDraw(SpriteBatch sb, Color lightColor)
 {
     CDrawing.LightningDraw(projectile, sb, new Color(244, 115, 219, 0), Color.White, ref projectile.localAI);
     return(false);
 }