Beispiel #1
0
        private void SaveImageFilePathToDb(string wuYeYongTu, string shi, string wuYeBianHao, string wuYeMingCheng,
                                           string zhaoPianLeiXin, string physicalPath, string url, string uploadFileName, string areaPath, byte[] img)
        {
            string keyVal = string.Format("/{0}/{1}/{2}/{3}/{4}", shi, wuYeYongTu, wuYeBianHao, wuYeMingCheng,
                                          zhaoPianLeiXin);

            var wuYeService = new WuYeService();
            var zhaoPian    = new WuYeZhaoPian
            {
                WuYeYongTu     = wuYeYongTu,
                WuYeBianHao    = wuYeBianHao,
                WuYeMingCheng  = wuYeMingCheng,
                ZhaoPianLeiXin = zhaoPianLeiXin,
                KeyValue       = keyVal,
                FilePath       = physicalPath,
                AreaPath       = areaPath,
                OrgNamePath    = GetOrganizationNamePath(),
                CreatedBy      = GetCurrentUserName(),
                CreatedDate    = DateTime.Now,
                FileName       = uploadFileName,
                Url            = url,
                Base64Img      = Convert.ToBase64String(img),
                Uploaded       = StatusHelper.IsLocalModel() ? "N" : "Y"
            };

            wuYeService.AddWuYeZhaoPian(zhaoPian);
        }
Beispiel #2
0
        public ActionResult Update(WuYeZhaoPian entity)
        {
            if (ModelState.IsValid)
            {
                entity.LastModifiedBy   = GetCurrentUserName();
                entity.LastModifiedDate = DateTime.Now;

                _wuYeService.UpdateWuYeZhaoPian(entity);
                _wuYeService.Save();

                var window = this.GetCmp <Window>("windowWuYeZhaoPian");
                window.Hide();
                this.GetCmp <Store>("storeWuYeZhaoPian").Reload();
                return(this.Direct());
            }

            return(this.Direct());
        }
Beispiel #3
0
        public ActionResult Insert(WuYeZhaoPian entity)
        {
            if (ModelState.IsValid)
            {
                entity.OrgNamePath = GetOrganizationNamePath();
                entity.CreatedBy   = GetCurrentUserName();
                entity.CreatedDate = DateTime.Now;

                _wuYeService.AddWuYeZhaoPian(entity);
                _wuYeService.Save();

                this.GetCmp <Window>("windowWuYeZhaoPian").Hide();
                this.GetCmp <Store>("storeWuYeZhaoPian").Reload();

                return(this.Direct());
            }
            return(this.Direct());
        }