Example #1
0
        /*Name of Function : <<sendASNMailtoBuyer>  Author :<<Prasanna>>
         * Date of Creation <<27-11-2020>>
         * Purpose : <<Sending mail method>>
         * Review Date :<<>>   Reviewed By :<<>>*/
        public bool sendASNMailtoBuyer(int ASNId)
        {
            try
            {
                VSCMEntities vscm         = new VSCMEntities();
                var          mpripaddress = ConfigurationManager.AppSettings["UI_IpAddress"];
                mpripaddress = mpripaddress + "SCM/ASNView/" + ASNId + "";
                using (var db = new YSCMEntities())                 //ok
                {
                    RemoteASNShipmentHeader ASNHeader = vscm.RemoteASNShipmentHeaders.Where(li => li.ASNId == ASNId).FirstOrDefault();
                    EmailSend emlSndngList            = new EmailSend();
                    emlSndngList.FrmEmailId = ConfigurationManager.AppSettings["fromemail"];
                    emlSndngList.Subject    = "ASNCreated";
                    emlSndngList.Body       = "<html><head></head><body><div class='container'><p>Click below link to view details</p></div><br/><div><b  style='color:#40bfbf;'>TO View Details: <a href='" + mpripaddress + "'>" + mpripaddress + "</a></b></div><br /><div><b  style='color:#40bfbf;'></a></b></body></html>";
                    if (!string.IsNullOrEmpty(ConfigurationManager.AppSettings["ASNToEmail"]))
                    {
                        emlSndngList.ToEmailId = ConfigurationManager.AppSettings["ASNToEmail"];
                    }
                    if (!string.IsNullOrEmpty(ConfigurationManager.AppSettings["ASNCCEmail"]))
                    {
                        emlSndngList.CC = ConfigurationManager.AppSettings["ASNCCEmail"];
                    }

                    if ((!string.IsNullOrEmpty(emlSndngList.FrmEmailId) && !string.IsNullOrEmpty(emlSndngList.FrmEmailId)) && (emlSndngList.FrmEmailId != "NULL" && emlSndngList.ToEmailId != "NULL"))
                    {
                        this.sendEmail(emlSndngList);
                    }
                }
            }
            catch (Exception ex)
            {
                log.ErrorMessage("EmailTemplate", "sendASNMailtoBuyer", ex.Message + "; " + ex.StackTrace.ToString());
            }
            return(true);
        }
Example #2
0
 public IHttpActionResult InsertandEditAsn([FromBody] RemoteASNShipmentHeader model)
 {
     return(Ok(_asnBusinessAccess.InsertandEditAsn(model)));
 }
Example #3
0
        // public readonly IASNDA _asnDataAcess;
        //public ASNBA(IASNDA ASNDA)
        //{
        //    this._asnDataAcess = ASNDA;
        //}
        //ASNDA _asnDataAcess = new ASNDA();

        public int InsertandEditAsn(RemoteASNShipmentHeader model)
        {
            return(_asnDataAcess.InsertandEditAsn(model));
        }