private SharingDataTokenizer(SharingData data) { Token = TokenizeSharingToken(data.Token); Identity = TokenizeIdentity(data.Identity); CreatorId = TokenizeCreatorId(data.CreatorId); Mode = TokenizeSharingMode(data.Mode); Level = TokenizeSharingLevel(data.Level); }
public SharingData InitSharingData() { SharingData x = new SharingData(); x.recipeId = null; x.recipeOwner = new Users.NewUser(); x.recipeOwner.userId = null; x.recipeOwner.userGroupId = null; x.recordDate = DateTime.UtcNow.ToString(); x.status = new Status(); x.status.code = 0; x.rank = 0; x.like = 0; x.views = 0; x.lang = null; x.adminSave = false; x.resp = new Global.Response(); x.consumers = 1; return(x); }
public JsonResult Sharing(string MyChecked) { Sharing sh = new Sharing(); SharingData shd = new SharingData(); var array = MyChecked.Split(','); if (MyChecked != "" && MyChecked != null) { for (var i = 0; i < array.Length; i++) { var Original = shd.Get().ToList().Where(a => a.num.ToString() == array[i]).SingleOrDefault(); var DelPath = System.IO.Path.Combine(Server.MapPath("~/upload/Sharing/"), Original.img); System.IO.File.Delete(DelPath); if (Original.jsonimg != "no_img.jpg") { var jsonstr = JsonConvert.DeserializeObject<List<jsonSer>>(Original.jsonimg); var DelJsonPath = Server.MapPath("~/upload/Sharing/"); foreach (var j in jsonstr) { var DelJsonPathing = System.IO.Path.Combine(DelJsonPath, j.content); System.IO.File.Delete(DelJsonPathing); } } sh.num = Convert.ToInt32(array[i]); shd.Delete(sh); } } return Json(""); }
public static SharingDataTokenizer Tokenize(SharingData data) { return(new SharingDataTokenizer(data)); }