示例#1
0
 public Carros()
 {
     InitializeComponent();
     _appCar   = new DBCar();
     _appImage = new DBImage();
     User      = new CarLand.Domain.Entities.User();
 }
示例#2
0
文件: Database.cs 项目: onuremre/Elta
    public List <DBImage> showImages(int place_id)
    {
        List <DBImage> result = new List <DBImage>();

        //conn = "URI=file:" + Application.dataPath + "/Resources/Elta.db";
        conn   = "URI=file:" + Application.persistentDataPath + "/Resources/Elta.db";
        dbconn = (IDbConnection) new SqliteConnection(conn);
        dbconn.Open();
        IDbCommand dbcmd = dbconn.CreateCommand();

        string sqlQuery = "SELECT * FROM image,place where place.id = image.place_id and place.id = " + place_id;

        dbcmd.CommandText = sqlQuery;
        IDataReader reader = dbcmd.ExecuteReader();

        while (reader.Read())
        {
            DBImage image = new DBImage();
            image.Id      = reader.GetInt32(0);
            image.Name    = reader.GetString(1);
            image.Url     = reader.GetString(2);
            image.PlaceId = reader.GetInt32(3);

            result.Add(image);
        }
        reader.Close();
        reader = null;
        dbcmd.Dispose();
        dbcmd = null;
        dbconn.Close();
        dbconn = null;

        return(result);
    }
示例#3
0
 public void changer(GameObject gameObject)
 {
     piece = gameObject.name.Split('(');
     image = db.showImage(Convert.ToInt32(piece[0]));
     print(image.Id);
     fileGUI.load(image.Id);
 }
示例#4
0
 public ImageGallery(DBImage dbImg)
 {
     InitializeComponent();
     this._dbImg = dbImg;
     NotifyPropertyChanged("DBImg");
     NotifyPropertyChanged("Path");
 }
示例#5
0
 public void showImage(int imageId)
 {
     image = db.showImage(imageId);
     place = db.showPlace(image.PlaceId);
     fileGUI.imageChanger(place.Path + "/" + image.Url, "kure");
     imageTransition(image.Id);
 }
示例#6
0
 public EditCar()
 {
     InitializeComponent();
     _appCar   = new DBCar();
     _appImage = new DBImage();
     Car       = new Domain.Entities.Car();
 }
示例#7
0
 public Create()
 {
     InitializeComponent();
     _appCar   = new DBCar();
     _appImage = new DBImage();
     Images    = new List <PictureBox>();
     Car       = new Domain.Entities.Car();
 }
示例#8
0
        public static void SetDeleteImage(DBImage image)
        {
            if (image != null)
            {
                // delete the image from cache
                ImageManager.DeleteCachedImage(image.Id);

                // set it to be deleted in SQL
                DBContext.Instance.DBImages.DeleteOnSubmit(image);
            }
        }
示例#9
0
    public void enterDirectory(GameObject go)
    {
        if (go.name == item[0])
        {
            place = db.showPlace(id2[0]);
        }
        else if (go.name == item[1])
        {
            place = db.showPlace(id2[1]);
        }
        else if (go.name == item[2])
        {
            place = db.showPlace(id2[2]);
        }

        image = db.showImage(place.StartingImageId);
        load(image.Id);
    }
示例#10
0
    public void reload(int i)
    {
        id = db.showPlacesId(i, 0);
        if (id.Count < 3)
        {
            switch (id.Count)
            {
            case 0:
                k  = db.firstLast(0);
                id = db.showPlacesId(k, 0);
                break;

            case 1:
                foreach (int a in db.showPlacesId(db.firstLast(0), 0))
                {
                    id.Add(a);
                }
                break;

            case 2:
                foreach (int a in db.showPlacesId(db.firstLast(0), 0))
                {
                    id.Add(a);
                }
                break;
            }
        }

        for (int j = 0; j < 3; j++)
        {
            place = db.showPlace(id[j]);
            image = db.showImage(place.StartingImageId);
            imageChanger(place.Path + "/" + image.Url, item[j]);
            id2[j] = id[j];
        }
    }
示例#11
0
 private void btnAddImg_PreviewMouseDown(object sender, MouseButtonEventArgs e)
 {
     Microsoft.Win32.OpenFileDialog dlg = new Microsoft.Win32.OpenFileDialog();
     dlg.Multiselect = true;
     dlg.Filter = "All Images|*.jpeg;*.png;*.jpg;*.gif|JPEG Files (*.jpeg)|*.jpeg|PNG Files (*.png)|*.png|JPG Files (*.jpg)|*.jpg|GIF Files (*.gif)|*.gif";
     if (dlg.ShowDialog() == true)
     {
         string[] names = dlg.SafeFileNames;
         string[] pathNames = dlg.FileNames;
         for (int i=0;i< pathNames.Length;i++)
         {
             DBImage dbImg = new DBImage(Appunto, names[i], pathNames[i]);
             ListImage.Add(dbImg);
             gallery.Children.Add(new ImageGallery(dbImg));
         }
         //copia l'immagine
     }
 }
示例#12
0
 public ListCar()
 {
     InitializeComponent();
     _appCar   = new DBCar();
     _appImage = new DBImage();
 }
示例#13
0
文件: DBCtrl.cs 项目: b4p3p/omeopauta
        /// <summary>
        /// appunto deve essere stato precedentemente salvato per avere l'ID corretto
        /// </summary>
        private static void moveImage(DBImage item, DBAppunto appunto)
        {
            if (!Directory.Exists(FOLDER_IMAGES)) Directory.CreateDirectory(FOLDER_IMAGES);
            string newName = appunto.ID + "_" + DateTime.Now.ToString("yyyyMMdd_HHmmss") + "_" + item.Name;
            string newPath = FOLDER_IMAGES + "/" + newName;

            File.Copy(item.AbsPath, newPath);

            item.Name = newName;
        }
示例#14
0
        /// <summary>
        /// Raises the <see cref="E:System.Web.UI.Control.Load"></see> event.
        /// </summary>
        /// <param name="e">The <see cref="T:System.EventArgs"></see> object that contains the event data.</param>
        protected override void OnLoad(EventArgs e)
        {
            // Bubble effect..
            if (m_EventRanInit == false)
            {
                OnInit(new EventArgs());
            }
            if (m_EventRanLoad)
            {
                return;
            }

            #region Display HelpText

            if (GotHttpContext && HttpContext.Current.Request != null)
            {
                if (EditIndexRequest != null && !Page.IsPostBack && HttpContext.Current.Request[EditIndexRequest] != null)
                {
                    EditIndex   = HttpContext.Current.Request[EditIndexRequest];
                    DisplayView = DisplayView.Detail;
                }
                else if (HttpContext.Current.Request[DetailPopupKeys] != null)
                {
                    EditIndex   = HttpContext.Current.Request[DetailPopupKeys];
                    DisplayView = DisplayView.Detail;
                }

                if (HttpContext.Current.Request["ShowHelp"] != null)
                {
                    Page.Response.Clear();

                    Page.Response.Write("<html><head><title>WebGrid Help</title></head>");

                    string csslink = string.Format("<link href=\"{0}\" rel=\"stylesheet\" type=\"text/css\" />",
                                                   Page.ClientScript.GetWebResourceUrl(GetType(),
                                                                                       "WebGrid.Resources.jquery-ui-smoothness.css"
                                                                                       .Replace("&",
                                                                                                "&amp;")));
                    Page.Response.Write(csslink);

                    Page.Response.Write("<body style=\"background-color:White;\">");
                    PlaceHolder helptext = null;

                    if (m_helptext_public != null)
                    {
                        helptext = m_helptext_public;
                    }
                    else
                    {
                        Grid grid = FindGrid(Page, HttpContext.Current.Request["gridid"]);
                        if (grid != null)
                        {
                            helptext = grid.HelpText;
                        }
                    }

                    if (helptext != null)
                    {
                        StringBuilder  sb            = new StringBuilder();
                        StringWriter   sw            = new StringWriter(sb);
                        HtmlTextWriter controlwriter = new HtmlTextWriter(sw);
                        helptext.RenderControl(controlwriter);
                        Page.Response.Write(sb.ToString());
                        sw.Close();
                        sw.Dispose();
                    }
                    else
                    {
                        Page.Response.Write(Help.GenerateHelp(ImagePath));
                    }
                    Page.Response.Write("</body></html>");
                    Page.Response.End();
                    return;
                }

                Util.MultiSelect.SelectableRows.GetSelectedRows(this);

                // DB Image?
                if (HttpContext.Current.Request["wgdbimgeditorid"] != null && HttpContext.Current.Request["wgdbimgeditorid"] == ClientID)
                {
                    DBImage.Render(this);
                    if (SystemMessage.Count == 0)
                    {
                        Visible = false;
                        return;
                    }
                }
            }

            #endregion

            m_EventRanLoad = true;

            if (Trace.IsTracing)
            {
                Trace.Trace("{0} : Start OnLoad();", ID);
            }

            if (Trace.IsTracing)
            {
                Trace.Trace("base.OnLoad({0})", ID);
            }
            base.OnLoad(e);

            if (EnableCallBack)
            {
                if (Page != null && GotHttpContext)
                {
                    Anthem.Manager.Register(this);
                }
                else if (DesignMode == false)
                {
                    EnableCallBack = false;
                }
            }

            if (Trace.IsTracing)
            {
                Trace.Trace("{0} : Finish OnLoad();", ClientID);
            }
        }