Beispiel #1
0
        public ResponseModel ModifyStoreAttachmentSettings([FromBody] AttachmentSettingsRequest AttachmentSettings)
        {
            int           response         = 0;
            ResponseModel objResponseModel = new ResponseModel();
            int           statusCode       = 0;
            string        statusMessage    = "";

            try
            {
                ////Get token (Double encrypted) and get the tenant id
                string       token        = Convert.ToString(Request.Headers["X-Authorized-Token"]);
                Authenticate authenticate = new Authenticate();
                authenticate = SecurityService.GetAuthenticateDataFromToken(_radisCacheServerAddress, SecurityService.DecryptStringAES(token));
                ModulesSettingColler attachmentsettingcoller = new ModulesSettingColler();

                response = attachmentsettingcoller.ModifyStoreAttachmentSettings(new ModulesSettingService(_connectioSting), authenticate.TenantId, authenticate.UserMasterID, AttachmentSettings);

                statusCode = response == 0 ? (int)EnumMaster.StatusCode.RecordNotFound : (int)EnumMaster.StatusCode.Success;

                statusMessage = CommonFunction.GetEnumDescription((EnumMaster.StatusCode)statusCode);

                objResponseModel.Status       = true;
                objResponseModel.StatusCode   = statusCode;
                objResponseModel.Message      = statusMessage;
                objResponseModel.ResponseData = response;
            }
            catch (Exception)
            {
                throw;
            }

            return(objResponseModel);
        }
Beispiel #2
0
        /// <summary>
        /// Modify Store Attachment Settings
        /// </summary>
        /// <param name="AttachmentSettings"></param>
        /// <param name="CreatedBy"></param>
        /// <param name="TenantId"></param>
        /// <returns></returns>
        public int ModifyStoreAttachmentSettings(int TenantId, int CreatedBy, AttachmentSettingsRequest AttachmentSettings)
        {
            int result = 0;

            try
            {
                if (AttachmentSettings.AttachmentSize > 0)
                {
                    if (AttachmentSettings.FileFomatID.Length > 0)
                    {
                        conn.Open();

                        MySqlCommand Targetcmd = new MySqlCommand("SP_InsertStoreAttachmentSettings", conn)
                        {
                            CommandType = CommandType.StoredProcedure
                        };

                        Targetcmd.Parameters.AddWithValue("@_AttachmentSize", AttachmentSettings.AttachmentSize);
                        Targetcmd.Parameters.AddWithValue("@_FileFomatID", AttachmentSettings.FileFomatID);
                        Targetcmd.Parameters.AddWithValue("@_CreatedBy", CreatedBy);
                        Targetcmd.Parameters.AddWithValue("@_TenantId", TenantId);

                        result = Convert.ToInt32(Targetcmd.ExecuteScalar());
                    }
                }
            }
            catch (Exception)
            {
                throw;
            }
            finally
            {
                if (conn != null)
                {
                    conn.Close();
                }
            }

            return(result);
        }
        public int ModifyStoreAttachmentSettings(IModulesSetting AttachmentSetting, int TenantId, int CreatedBy, AttachmentSettingsRequest AttachmentSettings)
        {
            _AttachmentSetting = AttachmentSetting;

            return(_AttachmentSetting.ModifyStoreAttachmentSettings(TenantId, CreatedBy, AttachmentSettings));
        }