Exemplo n.º 1
0
        public ImageModel GetPic(int width, int height, string pictureFileNo, string type)
        {
            //如果图片不存在的错误----
            string filecontent  = string.Empty;
            string picExtension = string.Empty;

            try
            {
                switch (type)
                {
                case "1":
                    ProductPictureFile model = DapperUtil.QueryByIdentityWithNoLock <ProductPictureFile>(pictureFileNo);
                    filecontent  = model.FileContent;
                    picExtension = model.Extension;
                    break;


                case "2":
                    SystemPictureFile model2 = DapperUtil.QueryByIdentityWithNoLock <SystemPictureFile>(pictureFileNo);
                    filecontent  = model2.FileContent;
                    picExtension = model2.Extension;
                    break;


                case "3":
                    UserPictureFile model3 = DapperUtil.QueryByIdentityWithNoLock <UserPictureFile>(pictureFileNo);
                    filecontent  = model3.FileContent;
                    picExtension = model3.Extension;
                    break;
                }
            }
            catch (Exception)
            {
                return(new ImageModel());
            }
            Image      outImage = PictureFileConverter.GetThumbnailImage(filecontent, width, height);
            ImageModel imgModel = new ImageModel
            {
                Extension = picExtension,
                Image     = outImage
            };

            return(imgModel);
        }
Exemplo n.º 2
0
 public SWfsGlobalConfig GetGlobalConfigByFNo(string functionNo)
 {
     return(DapperUtil.QueryByIdentityWithNoLock <SWfsGlobalConfig>(functionNo));
 }
Exemplo n.º 3
0
 public SWfsProductComment GetCommentById(int commentId)
 {
     return(DapperUtil.QueryByIdentityWithNoLock <SWfsProductComment>(commentId));
 }
Exemplo n.º 4
0
        public string VCodeCreate()
        {
            SWfsVActivity obj        = null;
            bool          isupdate   = false;//用isupdat来区分添加和修改操作
            string        activityId = Request.Form["ActivityId"];

            if (!string.IsNullOrEmpty(activityId))
            {
                isupdate = true;
                obj      = DapperUtil.QueryByIdentityWithNoLock <SWfsVActivity>(activityId);
            }
            else
            {
                obj            = new SWfsVActivity();
                obj.DateCreate = DateTime.Now;
            }

            //添加操作需要赋值的部分
            if (isupdate == false)
            {
                string activityNo = DateTime.Now.ToString("yyyyMMdd") + DateTime.Now.Millisecond.ToString();
                obj.ActivityId = activityNo;
            }



            //修改添加都需要赋值的【公共部分】
            obj.ActivityTypeId = 7;
            obj.ActivityName   = Request.Form["ActivityName"];
            //如保存过v码则不允许编辑对于disabled数据后台获取不到 需判断值
            if (!string.IsNullOrEmpty(Request.Form["ActivityCode"]))
            {
                obj.ActivityCode = Request.Form["ActivityCode"];
            }
            obj.ActivityStatus = Request.Form["ActivityStatus"] != null?Convert.ToInt16(Request.Form["ActivityStatus"]) : (short)1;

            obj.ActivityDateStart = DateTime.Parse(Request.Form["ActivityDateStart"]);
            obj.ActivityDateEnd   = DateTime.Parse(Request.Form["ActivityDateEnd"]);
            obj.OperatorId        = PresentationHelper.GetPassport().UserName;
            obj.ListingOutletFlag = short.Parse(Request.Form["siteNo"]);

            //根据isupdat谁的操作去做谁的事
            if (isupdate == false)
            {
                if (Vcode.VCodeCreate(obj) >= 0)
                {
                    return("{\"result\":\"success\"}");
                }
                else
                {
                    return("{\"result\":\"false\"}");
                }
            }
            else
            {
                if (Vcode.VCodeUpdate(obj))
                {
                    return("{\"result\":\"success\"}");
                }
                else
                {
                    return("{\"result\":\"false\"}");
                }
            }
        }
Exemplo n.º 5
0
 //按ID查询导航
 private SWfsBrandNavigation GetBrandNavigationNO(string navNO)
 {
     return(DapperUtil.QueryByIdentityWithNoLock <SWfsBrandNavigation>(navNO));
 }
Exemplo n.º 6
0
 //根据编号查询尚品活动
 private SWfsNewSubject GetNewSubjectByNO(string subjectNO)
 {
     return(DapperUtil.QueryByIdentityWithNoLock <SWfsNewSubject>(subjectNO));
 }
Exemplo n.º 7
0
 //按ID获取模板
 public SWfsBrandFlagShipTemplate GetTemplateObjByID(int tempID)
 {
     return(DapperUtil.QueryByIdentityWithNoLock <SWfsBrandFlagShipTemplate>(tempID));
 }
Exemplo n.º 8
0
 //按ID获取单条导航信息
 public SWfsBrandNavigation GetNavObj(int navNo)
 {
     return(DapperUtil.QueryByIdentityWithNoLock <SWfsBrandNavigation>(navNo));
 }
Exemplo n.º 9
0
 public WfsProduct   GetOneProduct()
 {
     return(DapperUtil.QueryByIdentityWithNoLock <WfsProduct>("0100726"));
 }
 /// <summary>
 /// 根据ID获取SwfsFlagShipModuleLink
 /// </summary>
 /// <param name="LinkId"></param>
 /// <returns></returns>
 public SwfsFlagShipModule GetSwfsFlagShipModuleById(int ModuleId)
 {
     return(DapperUtil.QueryByIdentityWithNoLock <SwfsFlagShipModule>(ModuleId));
 }
Exemplo n.º 11
0
 /// <summary>
 /// 根据ID获取SwfsFlagShipModuleLink
 /// </summary>
 /// <param name="LinkId"></param>
 /// <returns></returns>
 public SwfsFlagShipModuleLink GetSwfsFlagShipModuleLinkById(int LinkId)
 {
     return(DapperUtil.QueryByIdentityWithNoLock <SwfsFlagShipModuleLink>(LinkId));
 }
Exemplo n.º 12
0
 /// <summary>
 /// 根据主键获得实体
 /// </summary>
 /// <param name="id"></param>
 /// <returns></returns>
 public SWfsBrandAdsInfo GetModel(int id)
 {
     return(DapperUtil.QueryByIdentityWithNoLock <SWfsBrandAdsInfo>(id));
 }
Exemplo n.º 13
0
 public SWfsMobileAd GetMobileAdInfo(int id)
 {
     return(DapperUtil.QueryByIdentityWithNoLock <SWfsMobileAd>(id));
 }
Exemplo n.º 14
0
 public SWfsMeetingActiveSpecial GetActiveSpecialInfoById(int activeId)
 {
     return(DapperUtil.QueryByIdentityWithNoLock <SWfsMeetingActiveSpecial>(activeId));
 }
Exemplo n.º 15
0
 /// <summary>
 /// 根据主键获得实体
 /// </summary>
 /// <param name="id"></param>
 /// <returns></returns>
 public SWfsStyleMatchSpecial GetModel(int id)
 {
     return(DapperUtil.QueryByIdentityWithNoLock <SWfsStyleMatchSpecial>(id));
 }
Exemplo n.º 16
0
 /// <summary>
 /// 查询一条数据
 /// </summary>
 /// <param name="activityId"></param>
 /// <returns></returns>
 public SWfsVActivity VCodeId(string activityId)
 {
     return(DapperUtil.QueryByIdentityWithNoLock <SWfsVActivity>(activityId));
 }