Пример #1
0
        public string sendmailforinvitefriend([FromBody] JObject parameter)
        {
            //JavaScriptSerializer js = new JavaScriptSerializer();
            //string[] persons = js.Deserialize<string[]>(parameter["dataemail"]["email_list_send"].ToString());


            emailSendFrined objsendmail = new emailSendFrined();
            string          result = ""; bool resultSendEmail = false;
            bool            security_flag = false;

            try
            {
                if ((parameter["tokendata"]["member_id"].ToString() != null || parameter["tokendata"]["member_id"].ToString() != "") && (parameter["tokendata"]["Token"].ToString() != null || parameter["tokendata"]["Token"].ToString() != ""))
                {
                    security_flag = objmasters.securityCheck(parameter["tokendata"]["member_id"].ToString(), parameter["tokendata"]["Token"].ToString());
                }
                if (parameter["dataemail"]["email_list_send"].ToString() != "")
                {
                    objsendmail = parameter["dataemail"].ToObject <emailSendFrined>();
                }

                if (security_flag == true)
                {
                    if (objsendmail.email_list_send != null && objsendmail.email_list_send.Length > 0)
                    {
                        for (int i = 0; i < objsendmail.email_list_send.Length; i++)
                        {
                            resultSendEmail = sendinvitemail(objsendmail.email_list_send[i]);
                        }
                    }
                }
                else
                {
                    return("securityIssue");
                }
                if (resultSendEmail == true)
                {
                    ServerLog.Log((System.Web.HttpContext.Current.Request.AppRelativeCurrentExecutionFilePath).ToString() + " " + parameter.ToString() + "status" + "Pass");
                    return("pass");
                }
                else
                {
                    ServerLog.Log((System.Web.HttpContext.Current.Request.AppRelativeCurrentExecutionFilePath).ToString() + " " + parameter.ToString() + "status" + "Fail");
                    return("fail");
                }
            }
            catch (Exception ex)
            {
                ServerLog.Log((System.Web.HttpContext.Current.Request.AppRelativeCurrentExecutionFilePath).ToString() + " " + parameter.ToString() + "status" + ex.StackTrace);
                return("fail");
            }
            //return result;
        }
Пример #2
0
        public string sendmailforinvitefriend([FromBody] JObject parameter)
        {
            ServerLog.Log_QUA((System.Web.HttpContext.Current.Request.AppRelativeCurrentExecutionFilePath).ToString() + " " + parameter.ToString() + "status" + "call");
            //JavaScriptSerializer js = new JavaScriptSerializer();
            //string[] persons = js.Deserialize<string[]>(parameter["dataemail"]["email_list_send"].ToString());


            emailSendFrined objsendmail = new emailSendFrined();
            string          result = ""; bool resultSendEmail = false;
            bool            security_flag = false;

            try
            {
                if (parameter["dataemail"]["email_list_send"].ToString() != "")
                {
                    objsendmail = parameter["dataemail"].ToObject <emailSendFrined>();
                }


                if (objsendmail.email_list_send != null && objsendmail.email_list_send.Length > 0)
                {
                    for (int i = 0; i < objsendmail.email_list_send.Length; i++)
                    {
                        resultSendEmail = sendinvitemail(objsendmail.email_list_send[i]);
                    }
                }



                if (resultSendEmail == true)
                {
                    ServerLog.Log_QUA((System.Web.HttpContext.Current.Request.AppRelativeCurrentExecutionFilePath).ToString() + " " + parameter.ToString() + "status" + "Pass");
                    return(BLGeneralUtil.return_ajax_string("1", "Thanks for your referral"));
                }
                else
                {
                    ServerLog.Log_QUA((System.Web.HttpContext.Current.Request.AppRelativeCurrentExecutionFilePath).ToString() + " " + parameter.ToString() + "status" + "Fail");
                    return(BLGeneralUtil.return_ajax_string("0", "please Enter Email ID"));
                }
            }
            catch (Exception ex)
            {
                ServerLog.Log_QUA((System.Web.HttpContext.Current.Request.AppRelativeCurrentExecutionFilePath).ToString() + " " + parameter.ToString() + "status" + ex.StackTrace);
                return(BLGeneralUtil.return_ajax_string("0", "some thing went wrong"));
            }
            //return result;
        }