Exemple #1
0
 /// <summary>
 /// 作者:Kylin
 /// 时间:2014.12.22
 /// 描述:添加 Attachment
 /// </summary>
 /// <param name="model"></param>
 /// <returns></returns>
 public static bool CreateTrainScheduleAttachment(TrainAttachment model)
 {
     var edb = new EmeEntities();
     edb.Entry(model).State = EntityState.Added;
     return edb.SaveChanges() > 0;
 }
        public JsonResult CreateTrainScheduleAttachments(int trainScheduleId, string cName, string fileCode, string fileName, string fileExt, int fileSize)
        {
            var trainAttachment = new TrainAttachment()
                {
                    TrainScheduleId = trainScheduleId,
                    FileCode = fileCode,
                    FileName = fileName,
                    //FileExt = item[2],
                    TAttName = cName,
                    FileSize = fileSize,
                    Status = ConvertEnum.StatusTypeForActive,
                    CreateBy = LoginUserManager.CurrLoginUser.UserId,
                    CreateTime = DateTime.Now
                };

            var result = TrainBLL.CreateTrainScheduleAttachment(trainAttachment);
            var msg = result ? "上传成功!" : "上传失败!";
            return Json(new { status = result, msg = msg }, JsonRequestBehavior.DenyGet);
        }