Ejemplo n.º 1
0
        public string PermanentlyDeleteMessage(Stream message)
        {
            try
            {

                MessageBox objInput = JSonHelper.JsonDeserialize<MessageBox>(new StreamReader(message).ReadToEnd());
                if (System.Configuration.ConfigurationManager.AppSettings[objInput.Pin] == null)
                {
                    return "Invalid PIN";
                }
                if (objInput.Pin != null && objInput.Pin.Length > 0)
                {
                    MessageBox obj2 = new MessageBox();
                    List<MessageInfo> objcol = new List<MessageInfo>();
                    MessageInfo obj = new MessageInfo();
                    MessageBLL objbll = new MessageBLL();

                    obj.MessageComposeId = objInput.MessageComposeId;
                    obj.Pin = System.Configuration.ConfigurationManager.AppSettings[objInput.Pin].ToString();
                    int i = objbll.DeleteMessages_DeletedItems(obj);
                    if (i > 0)
                        return "Delete sucessful";
                    else
                        return "Delete Unsucessful";
                }
                else
                {
                    return "Pin is a required field";
                }
            }
            catch (Exception ex)
            {
                return "Unable to delete. Please try again later";
            }
        }