Esempio n. 1
0
        public HttpResponseBase GetEmailByID()
        {
            string json = string.Empty;
            uint eid = 0;
            string email_name = string.Empty;
            string email_address = string.Empty;
            try
            {
                if (!string.IsNullOrEmpty(Request.Params["eid"]))
                {
                    eid = Convert.ToUInt32(Request.Params["eid"].ToString());
                }
                _edmEmailMgr = new EdmEmailMgr(mySqlConnectionString);
                _edmEmailMgr.GetEmailByID(eid, out email_name, out email_address);
                //json = "{success:true}";
                json = "{success:true,email_name:'" + email_name + "',email_address:'" + email_address + "'}";
            }
            catch (Exception ex)
            {
                Log4NetCustom.LogMessage logMessage = new Log4NetCustom.LogMessage();
                logMessage.Content = string.Format("TargetSite:{0},Source:{1},Message:{2}", ex.TargetSite.Name, ex.Source, ex.Message);
                logMessage.MethodName = System.Reflection.MethodBase.GetCurrentMethod().Name;
                log.Error(logMessage);
                json = "{success:false,data:[]}";
            }
            this.Response.Clear();
            this.Response.Write(json);
            this.Response.End();
            return this.Response;

        }