static void OnPostprocessAllAssets(string[] importedAssets, string[] deletedAssets, string[] movedAssets, string[] movedFromAssetPaths)
    {
        foreach (string asset in importedAssets)
        {
            if (!filePath.Equals(asset))
            {
                continue;
            }

            MOCK_DATA data = (MOCK_DATA)AssetDatabase.LoadAssetAtPath(assetFilePath, typeof(MOCK_DATA));
            if (data == null)
            {
                data               = ScriptableObject.CreateInstance <MOCK_DATA> ();
                data.SheetName     = filePath;
                data.WorksheetName = sheetName;
                AssetDatabase.CreateAsset((ScriptableObject)data, assetFilePath);
                //data.hideFlags = HideFlags.NotEditable;
            }

            //data.dataArray = new ExcelQuery(filePath, sheetName).Deserialize<MOCK_DATAData>().ToArray();

            //ScriptableObject obj = AssetDatabase.LoadAssetAtPath (assetFilePath, typeof(ScriptableObject)) as ScriptableObject;
            //EditorUtility.SetDirty (obj);

            ExcelQuery query = new ExcelQuery(filePath, sheetName);
            if (query != null && query.IsValid())
            {
                data.dataArray = query.Deserialize <MOCK_DATAData>().ToArray();
                ScriptableObject obj = AssetDatabase.LoadAssetAtPath(assetFilePath, typeof(ScriptableObject)) as ScriptableObject;
                EditorUtility.SetDirty(obj);
            }
        }
    }
        public ActionResult DeleteConfirmed(int id)
        {
            MOCK_DATA mOCK_DATA = db.MOCK_DATA.Find(id);

            db.MOCK_DATA.Remove(mOCK_DATA);
            db.SaveChanges();
            return(RedirectToAction("Index"));
        }
Esempio n. 3
0
        // GET api/values/5

        public MOCK_DATA Get(Guid id)
        {
            using (var db = new richmondDayEntities())
            {
                employee = db.MOCK_DATA.FirstOrDefault(f => f.emp_id == id);
            }
            return(employee);
        }
 public ActionResult Edit([Bind(Include = "id,first_name,last_name,email,gender,ip_address")] MOCK_DATA mOCK_DATA)
 {
     if (ModelState.IsValid)
     {
         db.Entry(mOCK_DATA).State = EntityState.Modified;
         db.SaveChanges();
         return(RedirectToAction("Index"));
     }
     return(View(mOCK_DATA));
 }
        public ActionResult Create([Bind(Include = "id,first_name,last_name,email,gender,ip_address")] MOCK_DATA mOCK_DATA)
        {
            if (ModelState.IsValid)
            {
                db.MOCK_DATA.Add(mOCK_DATA);
                db.SaveChanges();
                return(RedirectToAction("Index"));
            }

            return(View(mOCK_DATA));
        }
Esempio n. 6
0
        // DELETE api/values/5
        public void Delete(Guid id)
        {
            using (var db = new richmondDayEntities())
            {
                employees = db.MOCK_DATA.ToList();
                employee  = employees.FirstOrDefault(f => f.emp_id == id);

                db.MOCK_DATA.Remove(employee);
                db.SaveChanges();
            }
        }
Esempio n. 7
0
        // PUT api/values/5
        public void Put(EmployeeModel emp)
        {
            using (var db = new richmondDayEntities())
            {
                employee = db.MOCK_DATA.FirstOrDefault(f => f.emp_id == emp.emp_id);

                employee.email      = emp.email;
                employee.first_name = emp.first_name;
                employee.last_name  = emp.last_name;

                db.SaveChanges();
            }
        }
        // GET: MOCK_DATA/Delete/5
        public ActionResult Delete(int?id)
        {
            if (id == null)
            {
                return(new HttpStatusCodeResult(HttpStatusCode.BadRequest));
            }
            MOCK_DATA mOCK_DATA = db.MOCK_DATA.Find(id);

            if (mOCK_DATA == null)
            {
                return(HttpNotFound());
            }
            return(View(mOCK_DATA));
        }