public JsonResult Step2Save(T_AD Param)
        {
            T_AD dataSel = new AdvertisingService().GetT_AD_List((int)Param.AD_CODE).FirstOrDefault();

            if (dataSel == null)
            {
                dataSel = new T_AD();
            }
            dataSel.TITLE       = Param.TITLE;
            dataSel.SUB_TITLE   = Param.SUB_TITLE;
            dataSel.LOGO_URL    = Param.LOGO_URL;
            dataSel.CONTENT     = Param.CONTENT;
            dataSel.STATUS      = Param.STATUS;
            dataSel.INSERT_CODE = (int)SessionHelper.LoginInfo.MEMBER.MEMBER_CODE;
            dataSel.MEMBER_CODE = (int)SessionHelper.LoginInfo.MEMBER.MEMBER_CODE;
            RTN_SAVE_DATA data = new AdvertisingService().T_AD_Save(dataSel);
            T_COMMON      COMM = new BaseService().GetCommon(new T_COMMON_COND {
                MAIN_CODE = "A001", SUB_CODE = Param.STATUS
            }).FirstOrDefault();

            if (COMM != null)
            {
                data.RETURN_URL = COMM.REF_DATA1.Split('|')[1] + "?id=" + data.DATA;
            }
            SessionHelper.LoginInfo.AD_CODE = Convert.ToInt32(data.DATA);

            return(new JsonResult {
                Data = data
            });
        }
Ejemplo n.º 2
0
        public JsonResult adSave(T_AD Param, T_DEVICE_MAIN device)
        {
            Param.INSERT_CODE = SessionHelper.LoginInfo.MEMBER.MEMBER_CODE;
            RTN_SAVE_DATA rtn = new AdvertisingService().T_AD_Save(Param, device);

            return(new JsonResult {
                Data = rtn
            });
        }
        public ActionResult adreg2(long?id)
        {
            this.setAdreg(id);
            T_AD data = ViewBag.data;

            return(RedirectToAction("adreg_" + (data.AD_FRAME_TYPE ?? 1).ToString() + "Frame", new
            {
                id = id
            }));
        }
        public void SetpStatus(long?id)
        {
            id = (id == null) ? ((SessionHelper.LoginInfo.AD_CODE == null)? 0 : SessionHelper.LoginInfo.AD_CODE) : id;
            SessionHelper.LoginInfo.AD_CODE = id;
            T_AD data = new AdvertisingService().GetT_AD_List((int)id).FirstOrDefault();

            if (data == null)
            {
                data = new T_AD()
                {
                    AD_CODE = 0, STATUS = 2
                }
            }
            ;
            data.AD_CODE = (int)id;
            ViewBag.data = data;
        }
        public void setAdreg(long?id, int?adFrameType = 1)
        {
            T_COMPANY_COND compCond = new T_COMPANY_COND {
            };

            if (SessionHelper.LoginInfo.STORE_CODE != 1)
            {
                compCond.COMPANY_CODE = SessionHelper.LoginInfo.COMPANY_CODE;
            }
            List <SelectListItem> compCombo = new BasicService().GetCompanyList(compCond).Select(s => new SelectListItem {
                Value = s.COMPANY_CODE.ToString(), Text = s.COMPANY_NAME
            }).ToList();

            adFrameType = adFrameType ?? 1;
            T_AD data = new AdvertisingService().GetT_AD_List((long)(id == null ? 0 : id)).FirstOrDefault();

            if (data == null)
            {
                data = new T_AD()
                {
                    COMPANY_CODE = SessionHelper.LoginInfo.COMPANY_CODE
                    ,
                    STORE_CODE = SessionHelper.LoginInfo.STORE_CODE
                    ,
                    MEMBER_CODE = SessionHelper.LoginInfo.MEMBER.MEMBER_CODE
                    ,
                    MEMBER_NAME = SessionHelper.LoginInfo.MEMBER.USER_NAME
                    ,
                    MOBILE = SessionHelper.LoginInfo.MEMBER.MOBILE
                    ,
                    COMPANY_NAME = SessionHelper.LoginInfo.STORE.COMPANY_NAME
                    ,
                    STORE_NAME = SessionHelper.LoginInfo.STORE.STORE_NAME
                    ,
                    CONTACT_COMPANY_CODE = SessionHelper.LoginInfo.COMPANY_CODE
                    ,
                    CONTACT_STORE_CODE = SessionHelper.LoginInfo.STORE_CODE
                    ,
                    CONTACT_CODE = SessionHelper.LoginInfo.MEMBER.MEMBER_CODE
                    ,
                    CONTACT_NAME = SessionHelper.LoginInfo.MEMBER.USER_NAME
                    ,
                    CONTACT_MOBILE = SessionHelper.LoginInfo.MEMBER.MOBILE
                    ,
                    CONTACT_COMPANY_NAME = SessionHelper.LoginInfo.STORE.COMPANY_NAME
                    ,
                    CONTACT_STORE_NAME = SessionHelper.LoginInfo.STORE.STORE_NAME
                    ,
                    CONTENT_TYPE = 1
                    ,
                    AD_FRAME_TYPE = adFrameType
                };
            }

            ViewBag.compCombo = compCombo;
            ViewBag.data      = data;

            ViewBag.filelocalbox = new CommonService().GetFileList(new T_FILE {
                TABLE_NAME = "T_AD", TABLE_KEY = id.ToString(), FILE_SEQ = 1
            }).FirstOrDefault();
            if (SessionHelper.LoginInfo.EMPLOYEE.COMPANY_CODE == 1 || id == null || SessionHelper.LoginInfo.EMPLOYEE.COMPANY_CODE == ViewBag.data.COMPANY_CODE)
            {
                SessionHelper.LoginInfo.EDIT_MODE = enEditMode.WRITE;
            }
            else
            {
                SessionHelper.LoginInfo.EDIT_MODE = enEditMode.READ;
            }

            ViewBag.KeywordList = new KeywordService().GetAdDeviceSearchKeyword(new CATEGORY_KEYWORD_COND {
                AD_CODE = Convert.ToInt64(id.ToString("-1")), KEYWORD_TYPE = 2
            });
        }