Пример #1
0
        public RTN_SAVE_DATA Step4Save(STEP4_SAVE Param)
        {
            object        obj     = Param;
            RTN_SAVE_DATA rtnData = new RTN_SAVE_DATA();

            try
            {
                using (TransactionScope tran = new TransactionScope())
                {
                    string deviceCodes = Param.DEVICE_CODE.FromArrayToString();
                    deviceCodes = string.IsNullOrEmpty(deviceCodes) ? "0" : deviceCodes;
                    string adDeviceCodes = Param.AD_DEVICE_CODE.FromArrayToString();
                    adDeviceCodes = string.IsNullOrEmpty(adDeviceCodes) ? "0" : adDeviceCodes;

                    string sql = Global.DBAgent.LoadSQL(sqlBasePath + "Advertising\\RequestADStep.xml", "Step4Save"
                                                        , Param.SAVE_TYPE.ToString("")
                                                        , Param.AD_CODE.ToString("0")
                                                        , deviceCodes
                                                        , adDeviceCodes
                                                        , Param.TIMEZONE_OFFSET.ToString("9")
                                                        , Param.REG_CODE.ToString("0")

                                                        );
                    db.ExecuteCommand(sql);
                    tran.Complete();
                }
            }
            catch (Exception ex)
            {
                rtnData.ERROR_MESSAGE = ex.Message;
            }

            return(rtnData);
        }
        public JsonResult Step4Save(STEP4_SAVE Param)
        {
            Param.AD_CODE  = SessionHelper.LoginInfo.AD_CODE;
            Param.REG_CODE = SessionHelper.LoginInfo.MEMBER.MEMBER_CODE;
            RTN_SAVE_DATA data = new RequestADService().Step4Save(Param);

            if (Param.SAVE_TYPE == "SAVE")
            {
                data.RETURN_URL = "/advstep/step5?id=" + Param.AD_CODE.ToString();
            }
            return(new JsonResult {
                Data = data
            });
        }