Example #1
0
        public Status AddProductionBaseInfo(string proname, string category, string responsiblename, string tel, List <IFormFile> file)
        {
            this._logger.LogWarning("The server execute AddProductionBaseInfo   --" + DateTime.Now.ToString());
            TProductionBaseInfo productionBaseInfo = new TProductionBaseInfo()
            {
                Name            = proname,
                Category        = category,
                ResponsibleName = responsiblename,
                Telephone       = tel
            };
            List <string> filenames      = new List <string>();
            string        resultfilename = string.Empty;

            if (productionBaseInfo.Name != "")
            {
                UpLoadFile.FileSave(file, productionBaseInfo.Name, out filenames);
            }
            else
            {
                UpLoadFile.FileSave(file, DateTime.Now.ToString("yyyy-MM-dd hh:mm:ss"), out filenames);
            }
            filenames.Sort();
            resultfilename           = string.Join("", filenames.ToArray());
            productionBaseInfo.Image = resultfilename;
            EFHelper <TProductionBaseInfo> eFHelper = new EFHelper <TProductionBaseInfo>();
            int result = eFHelper.Add(productionBaseInfo);

            return(result > 0 ? new Status(true) : new Status(false));
        }
Example #2
0
        public Status DeleteProductionBaseInfo(TProductionBaseInfo productionBaseInfo)
        {
            this._logger.LogWarning("The server execute DeleteProductionBaseInfo   --" + DateTime.Now.ToString());
            EFHelper <TProductionBaseInfo> eFHelper = new EFHelper <TProductionBaseInfo>();
            int result = eFHelper.Delete(productionBaseInfo);

            return(result > 0 ? new Status(true) : new Status(false));
        }