Beispiel #1
0
        [Test] public void mapTMServerUrl()
        {
            Assert.AreEqual(SendEmails.TM_Server_URL, TMConsts.DEFAULT_TM_LOCALHOST_SERVER_URL);
            var context = HttpContextFactory.Context.mock();
            var request = HttpContextFactory.Request;

            Assert.IsNotNull(context);
            Assert.IsNotNull(request);
            Assert.IsFalse(request.IsSecureConnection);
            var serverName = 10.randomLetters();
            var serverPort = 60000.random().str();

            request.ServerVariables["Server_Name"] = serverName;
            request.ServerVariables["Server_Port"] = serverPort;
            Assert.AreEqual(request.ServerVariables["Server_Name"], serverName);
            Assert.AreEqual(request.ServerVariables["Server_Port"], serverPort);

            //request.IsSecureConnection = false;
            SendEmails.TM_Server_URL = null;
            var expectedServer = "http://{0}:{1}".format(serverName, serverPort);
            var serverUrl      = SendEmails.mapTMServerUrl();

            Assert.AreEqual(serverUrl, expectedServer);
            Assert.AreEqual(serverUrl, SendEmails.TM_Server_URL);
            SendEmails.TM_Server_URL = TMConsts.DEFAULT_TM_LOCALHOST_SERVER_URL;
        }
Beispiel #2
0
        public ActionResult Create(BusinessLayer.CustomerDetail values)
        {
            if (ModelState.IsValid)
            {
                // try
                //{ Check if this new email already exists on DB
                if (!dbset.ConfirmEmailIsUnique(values.Email.ToString()))
                {
                    var order  = new BusinessLayer.CustomerDetail();
                    var cartid = sc.GetCartId(this.HttpContext);

                    //Create new member into the database
                    sc.CreateMember(values);//customerDetail

                    //send admin an email to call and confirm new user
                    BusinessLayer.SendEmails sendmail = new SendEmails();
                    sendmail.NewCustomerEmail(values);


                    //Update tblUserProfile with correct UserName
                    sc.UpdatetblUserProfileWithCurrentUserName(values.Email.Trim(), cartid);

                    return(RedirectToAction("Index", "ShoppingCart"));
                }
                else
                {
                    ViewBag.StateId = new SelectList(dbset.States, "StateId", "StateName");
                    return(View("NotUniqueEmailIndex"));
                }
            }
            ViewBag.StateId = new SelectList(dbset.States, "StateId", "StateName");

            return(View());
        }
Beispiel #3
0
        public string UsernameAndPasswordUpdate(CSC425Context db, String IPAddress)
        {
            // Check to make sure a user exists with the given name or email address
            var user = db.Users.Where(u => u.Username.ToLower().Equals(CurrentUsername.ToLower())).FirstOrDefault();

            if (user == null)
            {
                return(JsonConvert.SerializeObject(new ReturnCode(404, "Not Found", "Username is invalid")));
            }

            SendEmails email = new SendEmails();

            var salt   = Security.Generate(128);
            var secret = Security.Generate(64);

            // Change username/password
            user.Username     = NewUsername;
            user.EmailAddress = NewEmailAddress;
            user.Password     = Security.SHA256(Security.Pepper + Password + salt);
            user.Salt         = salt;
            user.IsVerified   = false;
            user.SecretKey    = secret;
            db.SaveChangesAsync();

            email.SendMessage(new System.Net.Mail.MailAddress(user.EmailAddress, user.Username), "Please verify your account on Rohzek's Note Service", $"Hello!\n\nPlease click this link to verify your account: https://rohzek.cf:8080/api/v1/verify?verification_code={user.SecretKey}");

            return(JsonConvert.SerializeObject(new SessionIDHolder(user.Username, user.SessionId)));
        }
        public async Task <int> ValidEmail([FromBody] Users obj)
        {
            try
            {
                List <Users> lstUser = await this._usersBAL.ValidEmail(obj);

                if (lstUser.Count > 0)
                {
                    SendEmails sendEmails = new SendEmails(_usersBAL, _IEmailTemplateBAL, _IOrderBAL);
                    Users      objUsers   = new Users();
                    objUsers.UserID = lstUser[0].UserID;
                    sendEmails.setMailContent(objUsers, EStatus.PasswordReset.ToString());
                    return(1);
                }
                else
                {
                    return(-1);
                }
            }
            catch (Exception ex)
            {
                Logger.LogError($"Something went wrong inside UsersController ValidEmail action: {ex.Message}");
                return(-1);
            }
        }
Beispiel #5
0
        public async Task <int> UserRegistration([FromBody] Users obj)
        {
            try
            {
                int res = await this._usersBAL.UserRegistration(obj);

                if (res > 1)
                {
                    if (obj.UserDocument != null)
                    {
                        _utilities.SaveUserDocumentImages(res, obj.UserDocument, webRootPath);
                    }

                    SendEmails sendEmails = new SendEmails(_usersBAL, _IEmailTemplateBAL, _IOrderBAL);
                    Users      objUsers   = new Users();
                    objUsers.UserID = res;
                    sendEmails.setMailContent(objUsers, EStatus.Registration.ToString());
                }
                return(res);
            }
            catch (Exception ex)
            {
                ErrorLogger.Log($"Something went wrong inside UsersController UserRegistration action: {ex.Message}");
                ErrorLogger.Log(ex.StackTrace);

                Logger.LogError($"Something went wrong inside UsersController UserRegistration action: {ex.Message}");
                return(-1);
            }
        }
        public async Task <int> ResetPassword([FromBody] Users obj)
        {
            try
            {
                int res = await this._usersBAL.ResetPassword(obj);

                if (res > 0)
                {
                    SendEmails sendEmails = new SendEmails(_usersBAL, _IEmailTemplateBAL, _IOrderBAL);
                    Users      objUsers   = new Users();
                    objUsers.UserID = obj.UserID;
                    sendEmails.setMailContent(objUsers, EStatus.PasswordResetConfirmation.ToString());
                    return(1);
                }
                else
                {
                    return(-1);
                }
            }
            catch (Exception ex)
            {
                Logger.LogError($"Something went wrong inside UsersController ResetPassword action: {ex.Message}");
                return(-1);
            }
        }
Beispiel #7
0
        public SendEmails Get(Int64 ixSendEmail)
        {
            SendEmails sendemails = _context.SendEmails.AsNoTracking().Where(x => x.ixSendEmail == ixSendEmail).First();

            sendemails.People = _context.People.Find(sendemails.ixPerson);

            return(sendemails);
        }
        public void SetUp()
        {
            var secretData = tmXmlDatabase.UserData.SecretData;

            sendEmails = new SendEmails();
            Assert.IsNotNull(sendEmails);
            Assert.IsNull(sendEmails.Smtp_Password, "In UnitTests SendEmails SMTP password should not be set");
            Assert.IsTrue(sendEmails.serverNotConfigured(), "In UnitTests serverNotConfigured should be in offline mode");
        }
Beispiel #9
0
        public void SetUp()
        {
            SendEmails.Disable_EmailEngine = false;
            SendEmails.Send_Emails_As_Sync = true;

            sendEmails = new SendEmails();
            Assert.IsNotNull(sendEmails);
            Assert.AreEqual(sendEmails.Smtp_Password, "", "In UnitTests SendEmails SMTP password should not be set");
            Assert.IsTrue(sendEmails.serverNotConfigured(), "In UnitTests serverNotConfigured should be in offline mode");
        }
Beispiel #10
0
        protected override async Task ExecuteAsync(CancellationToken stoppingToken)
        {
            using var scopeAWS = _serviceScopeFactory.CreateScope();
            var AWSConfig = scopeAWS.ServiceProvider.GetRequiredService <IConfiguration>();

            // abre a conexao com  AWS passando as credenciais pelo appsettings.json
            IAmazonSQS sqs = new AmazonSQSClient(AWSConfig["AWS:awsAccessKeyId"], AWSConfig["AWS:awsSecretAccessKey"], RegionEndpoint.SAEast1);

            // faz a busca da url da fila pelo seu nome
            var queueUrl = sqs.GetQueueUrlAsync(AWSConfig["AWS:QueueUrl"]).Result.QueueUrl;
            var receiveMessageRequest = new ReceiveMessageRequest
            {
                MaxNumberOfMessages = 10,       // numero de MSG que vai buscar de uma vez
                QueueUrl            = queueUrl, // url da fila
                WaitTimeSeconds     = 20,       // tempo que vai ficar aguardando uma MSG ficar disponivel
            };



            while (!stoppingToken.IsCancellationRequested)
            {
                // sendgrid
                using var scope = _serviceScopeFactory.CreateScope();
                var sendGridClient = scope.ServiceProvider.GetRequiredService <ISendGridClient>();
                var configuration  = scope.ServiceProvider.GetRequiredService <IConfiguration>();

                // AWS
                var receiveMenssageResponse = sqs.ReceiveMessageAsync(receiveMessageRequest).Result;
                if (receiveMenssageResponse.Messages.Count > 0)
                {// se tiver mensagens para ler
                    foreach (var mensagens in receiveMenssageResponse.Messages)
                    {
                        try
                        {
                            // carrega o json da fila com os parametros:assunto, remetente, destinatario, conteudo
                            var DadosMSG = JsonConvert.DeserializeObject <email>(mensagens.Body);

                            // envio da mensagem
                            if (SendEmails.Send(sendGridClient, DadosMSG))
                            {// mensage foi enviada com sucesso é eliminada da fila
                                DeleteMSG(queueUrl, mensagens.ReceiptHandle, sqs);
                            }
                        }
                        catch (Exception ex)
                        {
                            throw (ex.InnerException);
                        }
                    }
                }

                await Task.Delay(TimeSpan.FromMinutes(1), cancellationToken);
            }
        }
Beispiel #11
0
        public static int           newUser(this TM_UserData userData, string username, string password, string email, string firstname, string lastname, string note, string title, string company, string country, string state, List <UserTag> userTags, int groupId)
        {
            if (userData.isNull())
            {
                return(-1);
            }

            var userId = Math.Abs(Guid.NewGuid().hash());

            "Creating new user: {0} with id {1}".debug(username, userId);

            if (groupId < 1)                                    //set default user type
            {
                groupId = 2;                                    //by default new users are of type 2 (i.e. Reader)
            }
            else
            {
                UserRole.ManageUsers.demand();  // only users with UserRole.ManageUsers should be able to create non-default users
            }
            var tmUser = new TMUser {
                UserID    = userId,
                UserName  = username,
                FirstName = firstname,
                LastName  = lastname,
                Company   = (company),
                Country   = country,
                State     = state,
                GroupID   = groupId,
                Title     = title,
                EMail     = email ?? "",
                UserTags  = userTags
            };

            var tmConfig = TMConfig.Current;

            tmUser.AccountStatus.UserEnabled    = tmConfig.newAccountsEnabled();
            tmUser.AccountStatus.ExpirationDate = tmConfig.currentExpirationDate();

            tmUser.SecretData.PasswordHash = tmUser.createPasswordHash(password);
            userData.TMUsers.Add(tmUser);

            if (TMConfig.Current.windowsAuthentication_Enabled().isFalse())
            {
                SendEmails.SendNewUserEmails("New user created: {0}".format(tmUser.UserName), tmUser);
            }

            tmUser.logUserActivity("New User", "");     // this will trigger tmUser.event_User_Updated();

            //tmUser.event_User_Updated(); //tmUser.saveTmUser();
            //userData.triggerGitCommit();
            return(userId);
        }
Beispiel #12
0
 /// <summary>
 /// 执行开始发送命令
 /// </summary>
 private void PlayExecuteSend()
 {
     try
     {
         status = 1;
         string htmlurl = iniCls.IniReadValue("SMTP", "htmlUrl");
         strBody = htmlurl == "" ? htmlEditor1.Text.Trim() : SendEmails.GetHtmlSource(htmlurl);//;//邮件内容
         this.btnSend.Enabled = false;
         comboBox1.Enabled    = false;
         th = new Thread(new ThreadStart(Sends));
         th.IsBackground = true;
         th.Start();
     }
     catch (Exception ex) { MessageBox.Show(ex.Message); }
 }
Beispiel #13
0
        public Test_SendEmail_SMTP()
        {
            tmQAConfig = TM_QA_Config.Current;
            if (tmQAConfig.isNull())
            {
                Assert.Ignore("TM_QA_ConfigFile.Current was null (so no SMTP config values");
            }

            userData.SecretData.SMTP_Server        = tmQAConfig.SMTP_Server;
            userData.SecretData.SMTP_UserName      = tmQAConfig.SMTP_UserName;
            userData.SecretData.SMTP_Password      = tmQAConfig.SMTP_Password;
            tmConfig.TMSecurity.Default_AdminEmail = tmQAConfig.Default_AdminEmail;

            sendEmails = new SendEmails();
        }
Beispiel #14
0
 public async Task SendEmails(SendEmails sendEmails)
 {
     if (sendEmails.EmailRecipients != null)
     {
         var viewModel = new SimpleEmailViewModel
         {
             EmailContent = sendEmails.EmailContent,
             EmailTitle   = sendEmails.Title
         };
         foreach (var emailRecipient in sendEmails.EmailRecipients)
         {
             var body = await _razorViewToStringRenderer.RenderViewToStringAsync("/Views/Emails/General/SimpleEmail.cshtml", viewModel);
             await AddNotification(body, new EmailConf(emailRecipient), sendEmails.Subject, sendEmails.Attachment);
         }
     }
 }
Beispiel #15
0
        // GET: SerderEmails
        public ActionResult EnviarEmail(int userId, string NomeCadastrante = "Pastora XXX")
        {
            Usuario user     = new UsuarioBLL().GetUsuarioById(userId);
            string  operacao = "Email enviado com sucesso!";

            try
            {
                SendEmails.Enviar(string.Format(Corpo.ToString(), NomeCadastrante, user.Password), user.Email);
            }
            catch (Exception ex)
            {
                operacao = string.Concat("[ERRO] ", ex.Message);
            }

            return(Json(operacao));
        }
Beispiel #16
0
    protected void SendMailStaffFac()
    {
        string Mesag = "";

        Mesag = Mesag + "<table style='font-family:Verdana;font-size:16px;font-Weight:Bold;'><tr><td>Missed Call Notification Details</td></tr><tr><td><br/></td></tr></table>";

        Mesag = Mesag + "<br/><table style='font-family:Verdana;font-size:12px;'><tr><td>Dear Sir/Madam,</td></tr><tr><td><br/></td></tr></table>";

        Mesag = Mesag + "<br/><table style='font-family:Verdana;font-size:12px;'><tr><td>Kindly be informed that you have missed call notification in your AdminExam Module.</td></tr><tr><td><br/></td></tr></table>";

        Mesag = Mesag + "<br/><table>";
        Mesag = Mesag + "<table border='1' bgcolor='#f0eace' style='font-family:Verdana;font-size:12px;'>";
        Mesag = Mesag + "<tr><td colspan='2' align='center' style='font-size:14px'>Missed Call Notification Details</td></tr>";

        Mesag = Mesag + "<tr><td>Caller Category</td><td>" + ddlCallerCategory.SelectedItem.Text + "</td></tr>";
        Mesag = Mesag + "<tr><td>First Name</td><td>" + ddlTitle.SelectedItem.Text + "." + txtFirstName.Text.ToUpper() + "</td></tr>";
        Mesag = Mesag + "<tr><td>Middle Name</td><td>" + txtMiddleName.Text.ToUpper() + "</td></tr>";
        Mesag = Mesag + "<tr><td>Last Name</td><td>" + txtLastName.Text.ToUpper() + "</td></tr>";
        Mesag = Mesag + "<tr><td>Date</td><td>" + txtCallDate.Text + "</td></tr>";
        Mesag = Mesag + "<tr><td>Message for Whom</td><td>" + ddlForwardedTo.SelectedItem.Text + "</td></tr>";
        Mesag = Mesag + "<tr><td>Remarks</td><td>" + txtRemarks.Text.ToUpper() + "</td></tr></table>";

        Mesag = Mesag + "<br/><br/><table style='font-family:Verdana;font-size:12px;'><tr><td>Thanks & Regards</td></tr>";
        Mesag = Mesag + "<tr><td style='font-family:Verdana;font-size:11px;'>" + Session["Name"].ToString().ToUpper() + "</td></tr></table>";

        String  Str_FromMail = "";
        String  Str_ToMail   = "";
        DataSet ds;

        AttendanceDataAcessLayer AD = new AttendanceDataAcessLayer();

        ds = new DataSet();

        SqlParameter[] param = new SqlParameter[2];
        param[0] = new SqlParameter("@ToId", Convert.ToInt32(ddlForwardedTo.SelectedValue));
        param[1] = new SqlParameter("@FromId", Session["EmpId"].ToString());

        ds = AD.getDataByParam(param, "Sp_ViewMailId");

        if (ds.Tables[0].Rows.Count > 0)
        {
            Str_ToMail   = ds.Tables[0].Rows[0]["ToMail"].ToString().ToLower();
            Str_FromMail = ds.Tables[0].Rows[0]["FromMail"].ToString().ToLower();
        }
        SendEmails.SendEmail2(Str_FromMail, Str_ToMail, "Missed Call Notification Details", Mesag, Str_FromMail);
        //SendEmails.SendEmail2("*****@*****.**", "*****@*****.**", "Missed Call Notification Details", Mesag, "");
    }
        public async Task <int> UpdateOrderDetailStatus([FromBody] OrderStatusHistory[] obj)
        {
            try
            {
                //return await this._IOrderBAL.UpdateOrderDetailStatus(obj);
                int res = 0;
                foreach (var item in obj)
                {
                    res = await this._IOrderBAL.UpdateOrderDetailStatus(item);
                }

                SendEmails sendEmails = new SendEmails(_usersBAL, _IEmailTemplateBAL, _IOrderBAL);
                SendEmails.webRootPath = webRootPath;

                Users objUser = new Users();
                objUser.OrderID = obj[0].OrderId.ToString();
                //objUser.UserID = obj[0].CreatedBy;
                objUser.UserID         = UserService.LoggedInUser;
                objUser.OrderID        = Convert.ToString(obj[0].OrderId);
                objUser.OrderDetailsID = obj[0].OrderDetailsID.ToString();

                //if (obj[0].OrderStatusId == 1)
                //    sendEmails.setMailContent(objUser, EStatus.NewOrderCompletion.ToString());

                if (obj[0].OrderStatusId == 2)
                {
                    sendEmails.setMailContent(objUser, EStatus.NewOrderProcess.ToString());
                }
                if (obj[0].OrderStatusId == 3)
                {
                    sendEmails.setMailContent(objUser, EStatus.DispatchedConfirmation.ToString());
                }
                if (obj[0].OrderStatusId == 4)
                {
                    sendEmails.setMailContent(objUser, EStatus.DeliveredConfirmation.ToString());
                }

                return(res);
            }
            catch (Exception ex)
            {
                ErrorLogger.Log($"Something went wrong inside OrderController UpdateOrderDetailStatus action: {ex.Message}");
                ErrorLogger.Log(ex.StackTrace);
                Logger.LogError($"Something went wrong inside OrderController UpdateOrderDetailStatus action: {ex.Message}");
                return(-1);
            }
        }
        public async Task <int> SaveOrder([FromBody] Order obj)
        {
            try
            {
                int orderId = await this._IOrderBAL.SaveOrder(obj);

                SendEmails sendEmails = new SendEmails(_usersBAL, _IEmailTemplateBAL, _IOrderBAL);
                SendEmails.webRootPath = webRootPath;
                Users objUser = new Users();
                objUser.OrderID = orderId.ToString();
                objUser.UserID  = obj.UserID;
                sendEmails.setMailContent(objUser, EStatus.NewOrderCompletion.ToString());
                return(orderId);
            }
            catch (Exception ex)
            {
                Logger.LogError($"Something went wrong inside OrderController SaveOrder action: {ex.Message}");
                return(-1);
            }
        }
Beispiel #19
0
        public string Signup(CSC425Context db, String IPAddress)
        {
            var user = db.Users.Where(u => u.EmailAddress.ToLower().Equals(Email.ToLower())).FirstOrDefault();

            if (user == null)
            {
                user = db.Users.Where(u => u.Username.ToLower().Equals(Username.ToLower())).FirstOrDefault();

                if (user == null)
                {
                    SendEmails email = new SendEmails();

                    var salt           = Security.Generate(128);
                    var secret         = Security.Generate(64);
                    var passwordToSave = Security.SHA256(Security.Pepper + Password + salt);

                    // Create new user
                    user = new Users();

                    user.Username       = Username;
                    user.EmailAddress   = Email;
                    user.Salt           = salt;
                    user.Password       = passwordToSave;
                    user.UserRole       = "User";
                    user.CreationIp     = IPAddress;
                    user.VerificationIp = "0.0.0.0";
                    user.Use2Fa         = false;
                    user.LoginAttempts  = 0;
                    user.SecretKey      = secret;

                    db.Users.Add(user);
                    db.SaveChangesAsync();

                    email.SendMessage(new System.Net.Mail.MailAddress(user.EmailAddress, user.Username), "Please verify your account on Rohzek's Note Service", $"Hello!\n\nPlease click this link to verify your account: http://rohzek.cf:8080/api/v1/verify?verification_code={user.SecretKey}");

                    return(JsonConvert.SerializeObject(new ReturnCode(100, "Continue", "User created successfully, awaiting email verification")));
                }
            }

            return(JsonConvert.SerializeObject(new ReturnCode(409, "Conflict", $"User with username: {Username} and/or Email Address: {Email} already exists.")));
        }
        public async Task <int> UpdateUser([FromBody] Users obj)
        {
            try
            {
                var res = await this._usersBAL.UpdateUser(obj);

                if (obj.StatusId == 2)
                {
                    SendEmails sendEmails = new SendEmails(_usersBAL, _IEmailTemplateBAL, _IOrderBAL);
                    Users      objUsers   = new Users();
                    objUsers.UserID = obj.UserID;
                    sendEmails.setMailContent(objUsers, EStatus.RegistrationApproval.ToString());
                }
                return(Convert.ToInt32(res));
            }
            catch (Exception ex)
            {
                Logger.LogError($"Something went wrong inside UsersController UpdateUser action: {ex.Message}");
                return(-1);
            }
        }
        private void btSendEmail_Click(object sender, EventArgs e)
        {
            var listItens = new List <string>();

            foreach (var item in listBoxMsg.Items)
            {
                listItens.Add(item.ToString());
            }
            var arquivo = new SendEmails();

            try
            {
                arquivo.SendMail(listItens);
                MessageBox.Show("E-mail enviado com sucesso!");
            }
            catch (Exception)
            {
                throw;
            }

            resetarBotoes();
        }
        public async Task <string> SaveOrder([FromBody] Order obj)
        {
            try
            {
                obj.UserID = UserService.LoggedInUser;
                List <Order> lst = await this._IOrderBAL.SaveOrder(obj);

                SendEmails sendEmails = new SendEmails(_usersBAL, _IEmailTemplateBAL, _IOrderBAL);
                SendEmails.webRootPath = webRootPath;
                Users objUser = new Users();
                objUser.OrderID = lst[0].OrderId.ToString();
                objUser.UserID  = obj.UserID;
                objUser.GUID    = lst[0].GUID;
                sendEmails.setMailContent(objUser, EStatus.NewOrderCompletion.ToString());
                return(lst[0].GUID);
            }
            catch (Exception ex)
            {
                ErrorLogger.Log($"Something went wrong inside OrderController SaveOrder action: {ex.Message}");
                ErrorLogger.Log(ex.StackTrace);
                Logger.LogError($"Something went wrong inside OrderController SaveOrder action: {ex.Message}");
                return(null);
            }
        }
Beispiel #23
0
        public int StoreExpenditureXmlToDB(string path, EmailSettings emailSettings)
        {
            MySql.Data.MySqlClient.MySqlTransaction myTransaction = null;
            XmlDocument xmldoc = new XmlDocument();

            xmldoc.Load(path);
            XmlNamespaceManager nsmgr = new XmlNamespaceManager(xmldoc.NameTable);
            DataSet             ds    = new DataSet();
            XmlReader           xmlFile;

            xmlFile = XmlReader.Create(path, new XmlReaderSettings());
            ds.ReadXml(xmlFile);
            XmlAttributeCollection attrColl = xmldoc.DocumentElement.Attributes;
            var xmlnsattribute        = attrColl.GetNamedItem("xmlns").Value;
            var MsgDtTmattribute      = attrColl.GetNamedItem("MsgDtTm").Value;
            var MessageIdattribute    = attrColl.GetNamedItem("MessageId").Value;
            var Sourceattribute       = attrColl.GetNamedItem("Source").Value;
            var Destinationattribute  = attrColl.GetNamedItem("Destination").Value;
            var StateNameattribute    = attrColl.GetNamedItem("StateName").Value;
            var RecordsCountattribute = attrColl.GetNamedItem("RecordsCount").Value;
            var NetAmountSumattribute = attrColl.GetNamedItem("NetAmountSum").Value;
            List <Expenditure> strli  = new List <Expenditure>();

            foreach (DataRow dr in ds.Tables[1].Rows)
            {
                strli.Add(new Expenditure
                {
                    fin_year1      = Convert.ToInt32(dr[0].ToString()),
                    fin_year2      = Convert.ToInt32(dr[1].ToString()),
                    statecode      = Convert.ToInt32(dr[2].ToString()),
                    budgetcode     = Convert.ToInt64(dr[3].ToString()),
                    objectheadcode = dr[4].ToString(),
                    ddocode        = dr[5].ToString(),
                    vouchernumber  = Convert.ToInt32(dr[6].ToString()),
                    date           = DateTime.ParseExact(dr[7].ToString(), "dd/MM/yyyy",
                                                         System.Globalization.CultureInfo.CurrentUICulture.DateTimeFormat),
                    grossamount      = Convert.ToDecimal(dr[8].ToString()),
                    deductionamount  = Convert.ToDecimal(dr[9].ToString()),
                    netamount        = Convert.ToDecimal(dr[10].ToString()),
                    stateexpuniqueid = Convert.ToInt32(dr[11].ToString()),
                    payeecount       = Convert.ToInt32(dr[12].ToString()),
                    paydetail        = dr[13].ToString(),
                    payeedetails     = dr[14].ToString(),
                    xmlns            = Convert.ToString(xmlnsattribute),
                    MsgDtTm          = Convert.ToString(MsgDtTmattribute),
                    MessageId        = Convert.ToString(MessageIdattribute),
                    Source           = Convert.ToString(Sourceattribute),
                    Destination      = Convert.ToString(Destinationattribute),
                    StateName        = Convert.ToString(StateNameattribute),
                    RecordsCount     = Convert.ToString(RecordsCountattribute),
                    NetAmountSum     = Convert.ToString(NetAmountSumattribute),
                });
            }
            myTransaction = _MyConnection._MyConnection.BeginTransaction(IsolationLevel.ReadUncommitted);
            _MyCommand.Add_Transaction(myTransaction);
            foreach (var expenditure in strli)
            {
                _MyCommand.Clear_CommandParameter();
                _MyCommand.Add_Parameter_WithValue("prm_fin_year1", expenditure.fin_year1);
                _MyCommand.Add_Parameter_WithValue("prm_fin_year2", expenditure.fin_year2);
                _MyCommand.Add_Parameter_WithValue("prm_statecode", expenditure.statecode);
                _MyCommand.Add_Parameter_WithValue("prm_budgetcode", expenditure.budgetcode);
                _MyCommand.Add_Parameter_WithValue("prm_objectheadcode", expenditure.objectheadcode);
                _MyCommand.Add_Parameter_WithValue("prm_ddocode", expenditure.ddocode);
                _MyCommand.Add_Parameter_WithValue("prm_vouchernumber", expenditure.vouchernumber);
                _MyCommand.Add_Parameter_WithValue("prm_date", expenditure.date);
                _MyCommand.Add_Parameter_WithValue("prm_grossamount", expenditure.grossamount);
                _MyCommand.Add_Parameter_WithValue("prm_deductionamount", expenditure.deductionamount);
                _MyCommand.Add_Parameter_WithValue("prm_netamount", expenditure.netamount);
                _MyCommand.Add_Parameter_WithValue("prm_stateexpuniqueid", expenditure.stateexpuniqueid);
                _MyCommand.Add_Parameter_WithValue("prm_payeecount", expenditure.payeecount);
                _MyCommand.Add_Parameter_WithValue("prm_paydetail", expenditure.paydetail);
                _MyCommand.Add_Parameter_WithValue("prm_payeedetails", expenditure.payeedetails);
                //_MyCommand.Add_Parameter_WithValue("", expenditure.xmlns);
                _MyCommand.Add_Parameter_WithValue("prm_msgdttm", expenditure.MsgDtTm);
                _MyCommand.Add_Parameter_WithValue("prm_messageid", expenditure.MessageId);
                _MyCommand.Add_Parameter_WithValue("prm_source", expenditure.Source);
                _MyCommand.Add_Parameter_WithValue("prm_destination", expenditure.Destination);
                _MyCommand.Add_Parameter_WithValue("prm_statename", expenditure.StateName);
                _MyCommand.Add_Parameter_WithValue("prm_recordscount", expenditure.RecordsCount);
                _MyCommand.Add_Parameter_WithValue("prm_netamountsum", expenditure.NetAmountSum);
                _MyCommand.Select_Scalar("insertsifmsexpendituredetails", System.Data.CommandType.StoredProcedure);
            }
            myTransaction.Commit();
            int        ab   = 1;
            SendEmails mail = new SendEmails();

            mail.mailer(emailSettings);
            return(ab);
        }
    protected void btnverifyemail_Click(object sender, EventArgs e)
    {
        try
        {
            string Id                = Request.QueryString["Id"].ToString();
            int    userid1           = 0;
            StudentRegistrationDAL s = new StudentRegistrationDAL();
            try
            {
                userid1 = int.Parse(Session["EMPID"].ToString());
            }
            catch
            {
                userid1 = userid;
            }

            DataTable RegisterNo1 = s.InsertStudentMailVerifyLogs(int.Parse(Id), userid1, txtEmailID.Text, "INSCHECK");
            if (RegisterNo1.Rows[0][0].ToString().Contains("1") == true)
            {
                lblMesag.Text      = "Mail Already send on  -" + RegisterNo1.Rows[0][1].ToString();
                lblMesag.ForeColor = System.Drawing.Color.Red;
                return;
            }

            string FromEmail = "*****@*****.**"; // tblEmpMaster from Session EmapId >> Emp Email Address
            string mailids   = txtEmailID.Text;
            mailids = mailids + "," + Session["Emailid"].ToString();
            string ToEmail = mailids;
            string Subject = "Registration Details";
            string Body    = "";
            //string CC = txtEmailID.Text;
            string CC      = "";
            string Message = "";
            Subject = "Welcome to Skyline University College";
            Message = "<table> <tbody>";
            Message = Message + "<tr><td colspan=2>Welcome to Skyline University College!!!</td>";
            Message = Message + "</tr><tr><td colspan=2><br /></td>";
            Message = Message + "</tr><tr><td colspan=2>Kindly reply on this email to confirm your email id for official correspondence with Skyline University College in future.</td>";
            Message = Message + "</tr><tr><td colspan=2><br /></td>";

            Message = Message + "<tr><td colspan=2>" + "Best Regards," + "</td></tr>";
            Message = Message + "<tr><td colspan=2>" + "Skyline University College" + "</td></tr>";
            Message = Message + "<tr><td colspan=2>" + "University City of Sharjah, Sharjah" + "</td></tr>";
            Message = Message + "<tr><td colspan=2>" + "P.O. Box: 1797, Sharjah, U.A.E" + "</td></tr>";
            Message = Message + "<tr><td colspan=2>" + "Tel. : 971-6-5441155, Fax.: 971-6-5441166" + "</td></tr>";
            Message = Message + "<tr><td colspan=2>" + "Email: [email protected]" + "</td></tr>";
            Message = Message + "</td></tr></tbody></table>";
            Body    = Message;


            try
            {
                DataTable RegisterNo = s.InsertStudentMailVerifyLogs(int.Parse(Id), userid1, txtEmailID.Text, "INSERT");
                if (RegisterNo.Rows[0][0].ToString().Contains("1") == true)
                {
                    try
                    {
                        SendEmails.SendEmail(FromEmail, ToEmail, Subject, Body, CC);
                        lblMesag.Text      = "Verification Mail send to Student";
                        lblMesag.ForeColor = System.Drawing.Color.Green;
                    }

                    catch
                    {
                        //DataTable RegisterNo1 = s.InsertStudentMailVerifyLogs(int.Parse(Id), int.Parse(Session["EMPID"].ToString()), txtEmailID.Text, "DELETE");
                        lblMesag.Text      = "Mail not send.";
                        lblMesag.ForeColor = System.Drawing.Color.Red;
                    }
                }
            }
            catch
            {
                lblMesag.Text      = "Mail not send.";
                lblMesag.ForeColor = System.Drawing.Color.Red;
            }
        }
        catch
        {
        }
    }
Beispiel #25
0
 public async Task SendEmails([FromBody] SendEmails sendEmails)
 {
     await _emailTemplateServices.SendEmails(sendEmails);
 }
    protected void btnUpdate_Click(object sender, EventArgs e)
    {
        try
        {
            //pnlForStudent.Visible = true;
            StudentRegistrationDAL s = new StudentRegistrationDAL();
            int submenuid            = 0;

            try
            {
                if (int.Parse(ddlStudentStatus.SelectedValue) == 6)
                {
                    if (int.Parse(DrpNQ.SelectedValue) == 0)
                    {
                        lblMesag.Text      = "Please Select  Not Interested Reason!";
                        lblMesag.ForeColor = System.Drawing.Color.Red;
                        return;
                    }
                    else
                    {
                        submenuid = int.Parse(DrpNQ.SelectedValue);
                    }
                }
                else
                {
                    submenuid = 0;
                }
            }

            catch
            {
                submenuid = 0;
            }


            if (txtRemarks.Text != "")
            {
                try
                {
                    string Result = s.InsertFollowUpExisting(Request.QueryString["Id"].ToString(), DateTime.Parse(txtCallDate.Text), ddlStudentStatus.SelectedValue, ddlForwardedTo1.SelectedValue, txtRemarks.Text, int.Parse(Session["EMPID"].ToString()), submenuid);

                    if (Result == "error")
                    {
                        lblMesag.Text      = "Try again !!!";
                        lblMesag.ForeColor = System.Drawing.Color.Red;
                        return;
                    }


                    try
                    {
                        string MissedCall = Request.QueryString["A"].ToString();
                        if (Request.QueryString["A"] != null)
                        {
                            if (MissedCall == "F")
                            {
                                string Result1 = s.UpdateFollowUpschedule(Request.QueryString["Id"].ToString());
                            }



                            if (MissedCall == "V")
                            {
                                string Result2 = s.UpdateVisitschedule(Request.QueryString["Id"].ToString());
                            }
                        }
                    }
                    catch
                    {
                    }



                    try
                    {
                        s.InsertOtherFollowup(int.Parse(Request.QueryString["Id"].ToString()), chkPaymentMode.Checked, chkProvCerticate.Checked, int.Parse(Session["EmpId"].ToString()));
                        s.InsertFollowupschedule(int.Parse(Request.QueryString["Id"].ToString()), txtFromDate.Text, int.Parse(Session["EmpId"].ToString()));
                    }
                    catch
                    {
                    }

                    try
                    {
                        if (int.Parse(ddlStudentStatus.SelectedValue) == 1)
                        {
                            s.InsertVisitschedule(int.Parse(Request.QueryString["Id"].ToString()), txtVisitDate.Text, int.Parse(Session["EmpId"].ToString()));
                        }
                    }
                    catch
                    {
                    }


                    string confirmValue = Request.Form["confirm_value"];
                    if (confirmValue == "Yes")
                    {
                        if (chkEmail.Checked == true)
                        {
                            string ToEmail = txtEmailID.Text;
                            string Name    = txtFirstName.Text + ",";
                            string Mesag   = "";
                            Mesag = "<table>";
                            Mesag = Mesag + "<tr><td>" + "Dear " + ddlTitle.SelectedItem.Text + " " + Name;
                            Mesag = Mesag + "</td></tr><tr><td>";
                            Mesag = Mesag + "</td></tr><tr><td>";
                            Mesag = Mesag + "</td></tr> <tr><td> Greetings from Skyline University College (SUC)!";
                            Mesag = Mesag + "</td></tr><tr><td>";
                            Mesag = Mesag + "</td></tr><tr><td>" + "Thank you for sparing your time for the follow up call made by  " + txtAttendedBy.Text + "your admission counselor from SUC. We hope that all your queries have been answered. We look forward to receiving you at the university for further guidance on your pursuit of higher education.";
                            Mesag = Mesag + "</td></tr><tr><td>";
                            Mesag = Mesag + "</td></tr><tr><td>Visit our website www.skylineuniversity.ac.ae for more info";
                            Mesag = Mesag + "</td></tr><tr><td>";
                            Mesag = Mesag + "</td></tr><tr><td>" + "Best regards,";
                            Mesag = Mesag + "</td></tr><tr><td>" + "Marketing & Admissions Dept";
                            Mesag = Mesag + "</td></tr><tr><td>" + "Skyline University College";
                            //Mesag = Mesag + "</td></tr><tr><td>" + "Best regards,";
                            //Mesag = Mesag + "</td></tr><tr><td>" + txtAttendedBy.Text;
                            //Mesag = Mesag + "</td></tr><tr><td>" + "Skyline University College";
                            //Mesag = Mesag + "</td></tr><tr><td>" + "University City of Sharjah, Sharjah";
                            //Mesag = Mesag + "</td></tr><tr><td>" + "P.O. Box: 1797, Sharjah, U.A.E";
                            //Mesag = Mesag + "</td></tr><tr><td>" + "Tel. : 971-6-5441155, Fax.: 971-6-5441166";
                            //Mesag = Mesag + "</td></tr><tr><td>" + "Email: [email protected]";
                            Mesag = Mesag + "</td></tr></tr></tbody></table></p><p></p>";

                            SendEmails.SendEmail2("*****@*****.**", ToEmail, "Registration Follow Up", Mesag, "");
                            //SendEmails.SendEmail2("*****@*****.**", ToEmail, "Registration Follow Up", Mesag, "");
                        }


                        if (chkEmail1.Checked == true)
                        {
                            string ToEmail = txtEmailID.Text;
                            string Name    = txtFirstName.Text + ",";
                            string Mesag   = "";
                            Mesag = "<table>";
                            Mesag = Mesag + "<tr><td>" + "Dear " + ddlTitle.SelectedItem.Text + " " + Name;
                            Mesag = Mesag + "</td></tr><tr><td>";
                            Mesag = Mesag + "</td></tr><tr><td>";
                            Mesag = Mesag + "</td></tr> <tr><td> Greetings from Skyline University College (SUC)!";
                            Mesag = Mesag + "</td></tr><tr><td>";
                            Mesag = Mesag + "</td></tr><tr><td>" + "we were unable to reach you and follow up on your admission query. Kindly feel free to contact us for any clarification. Call +97165441155 Thank you";
                            Mesag = Mesag + "</td></tr><tr><td>";
                            Mesag = Mesag + "</td></tr><tr><td>Visit our website www.skylineuniversity.ac.ae for more info";
                            Mesag = Mesag + "</td></tr><tr><td>";
                            Mesag = Mesag + "</td></tr><tr><td>" + "Best regards,";
                            Mesag = Mesag + "</td></tr><tr><td>" + "Marketing & Admissions Dept";
                            Mesag = Mesag + "</td></tr><tr><td>" + "Skyline University College";
                            //Mesag = Mesag + "</td></tr><tr><td>" + "Best regards,";
                            //Mesag = Mesag + "</td></tr><tr><td>" + txtAttendedBy.Text;
                            //Mesag = Mesag + "</td></tr><tr><td>" + "Skyline University College";
                            //Mesag = Mesag + "</td></tr><tr><td>" + "University City of Sharjah, Sharjah";
                            //Mesag = Mesag + "</td></tr><tr><td>" + "P.O. Box: 1797, Sharjah, U.A.E";
                            //Mesag = Mesag + "</td></tr><tr><td>" + "Tel. : 971-6-5441155, Fax.: 971-6-5441166";
                            //Mesag = Mesag + "</td></tr><tr><td>" + "Email: [email protected]";
                            Mesag = Mesag + "</td></tr></tr></tbody></table></p><p></p>";
                            SendEmails.SendEmail2("*****@*****.**", ToEmail, "Registration Follow Up", Mesag, "");
                        }


                        if (chkSms.Checked == true)
                        {
                            SMSCAPI obj = new SMSCAPI();
                            string  strPostResponse;
                            //strPostResponse = obj.SendSMS("", "", "+" + txtMobileNo.Text, "Thank you for attending " + txtAttendedBy.Text + "'s call. We are glad to guide you further.  Visit  www.skylineuniversity.ac.ae for more information.");
                            //strPostResponse = obj.SendSMS("", "", "+971556460999", "Thank you for attending " + txtAttendedBy.Text + "'s call. We are glad to guide you further.  Visit  www.skylineuniversity.ac.ae for more information.");
                        }
                        if (chkSms1.Checked == true)
                        {
                            string  Name = txtFirstName.Text + ",";
                            SMSCAPI obj  = new SMSCAPI();
                            string  strPostResponse;
                            //strPostResponse = obj.SendSMS("", "", "+" + txtMobileNo.Text, " We were unable to reach you and follow up on your admission query. Kindly feel free to contact us for any clarification. Call +97165441155 Thank you..Visit  www.skylineuniversity.ac.ae for more information.");
                            //strPostResponse = obj.SendSMS("", "", "+971503530812", "we were unable to reach you and follow up on your admission query. Kindly feel free to contact us for any clarification. Call +97165441155 Thank you.Visit  www.skylineuniversity.ac.ae for more information.");
                        }
                    }
                }

                catch
                {
                }
                lblMesag.Text      = "Sucessfully Updated!!!";
                lblMesag.ForeColor = System.Drawing.Color.Blue;
                //alertmessage.Show("Data Updated Successfully!");
                //Response.Redirect("FollowUpReport.aspx", false);
                FillGridView();
            }
            else
            {
                lblMesag.Text      = "Remarks Required";
                lblMesag.ForeColor = System.Drawing.Color.Red;
                return;
            }
        }
        catch
        {
            //alertmessage.Show("Please Try Again!");
            lblMesag.Text      = "Try Again!";
            lblMesag.ForeColor = System.Drawing.Color.Red;
        }
    }
    protected void btnSave_Click(object sender, EventArgs e)
    {
        try
        {
            StudentRegistrationDAL s = new StudentRegistrationDAL();
            String Body = "";
            string AIPC = "NA";
            if (rdbAIPC120.Checked == true)
            {
                AIPC = "120 HOURS";
            }
            else if (rdbAIPC190.Checked == true)
            {
                AIPC = "190 HOURS";
            }

            string Mathcrashcourse = "NA";
            if (chkYesMath.Checked == true)
            {
                Mathcrashcourse = "YES";
            }
            else if (chkNoMath.Checked == true)
            {
                Mathcrashcourse = "NO";
            }


            if ((int.Parse(Session["DepId"].ToString()) == 32) || (int.Parse(Session["DepId"].ToString()) == 4) || (int.Parse(Session["DepId"].ToString()) == 2))
            {
                string Result = s.InsertAdminCheckList(Request.QueryString["Id"].ToString(), lblExamType.Text, txtToeflScore.Text, txtMathScore.Text, Mathcrashcourse, txtScoreMaths.Text, AIPC, txtResultAIPC.Text, chkNoIELP.Checked,
                                                       txtResultIELP.Text, txtFwType.Text, chkYesProof.Checked, txtProof.Text, txtFWAmount.Text, lblToc.Text, txtTOCAmount.Text, txtNoOfCourses.Text, lblVisaType.Text,
                                                       lblHostelStatus.Text, txtAdminRemarks.Text, txtFinanceRemarks.Text, txtGeneralRemarks.Text, int.Parse(Session["EmpId"].ToString()), "");
                if (Result == "Sucess")
                {
                    lblMesag.Text      = "Sucessfully Submitted";
                    lblMesag.ForeColor = System.Drawing.Color.Blue;
                    // newlyadded for mail

                    if (int.Parse(Session["DepId"].ToString()) == 4)
                    {
                        Body = "Admin Checklist is completed by Admin Department for the Registration No : " + s.GetRegNo(Request.QueryString["Id"].ToString()) + " Kindly Verify the Checklist";
                        SendEmails.SendEmail("*****@*****.**", "*****@*****.**", "AdminChecklist Stud ID - " + s.GetRegNo(Request.QueryString["Id"].ToString()), Body, "");
                    }
                    if (int.Parse(Session["DepId"].ToString()) == 2)
                    {
                        if (lblFeewaiver.Text == "YES")
                        {
                            Body = "Admin Checklist is completed by Finance Department for the Registration No : " + s.GetRegNo(Request.QueryString["Id"].ToString()) + " Kindly Verify the Checklist";
                            SendEmails.SendEmail("*****@*****.**", "*****@*****.**", "AdminChecklist Stud ID - " + s.GetRegNo(Request.QueryString["Id"].ToString()), Body, "");
                        }
                    }
                    if (int.Parse(Session["DepId"].ToString()) == 32)
                    {
                        Body = "Admin Checklist is completed by COEC Office for the  Registration No : " + s.GetRegNo(Request.QueryString["Id"].ToString());
                        SendEmails.SendEmail("*****@*****.**", "*****@*****.**", "AdminChecklist Stud ID - " + s.GetRegNo(Request.QueryString["Id"].ToString()), Body, "");
                    }
                }
                else
                {
                    lblMesag.Text      = "Please try again!";
                    lblMesag.ForeColor = System.Drawing.Color.Blue;
                }
            }
            else
            {
                lblMesag.Text      = "Not Authorized!";
                lblMesag.ForeColor = System.Drawing.Color.Blue;
            }
        }
        catch
        {
        }
    }
Beispiel #28
0
    public void SendEmail()
    {
        //For Email
        string  ToEmail = txtEmailID.Text;
        string  Name    = txtFirstName.Text + ",";
        string  Mesag   = "";
        SMSCAPI obj     = new SMSCAPI();
        string  strPostResponse;

        if (ddlStudentStatus.SelectedValue == "2")
        {
            Mesag = "<table>";
            Mesag = Mesag + "<tr><td>" + "Dear " + ddlTitle.SelectedItem.Text + " " + Name;
            Mesag = Mesag + "</td></tr><tr><td>";
            Mesag = Mesag + "</td></tr><tr><td>";
            Mesag = Mesag + "</td></tr><tr><td>";
            Mesag = Mesag + "</td></tr><tr><td>Greetings from Skyline University College (SUC)! ";
            Mesag = Mesag + "</td></tr><tr><td>";
            //Mesag = Mesag + "</td></tr><tr><td>" + "Thank you for calling Skyline University College, we hope that you were able to get all necessary information on your requirements from " + txtAttendedBy.Text + ", your admission counselor, if you need further information kindly feel free to get in touch with " + txtAttendedBy.Text + ". Looking forward to seeing you at the University";
            Mesag = Mesag + "</td></tr><tr><td>" + "Thank you for calling us. We hope that you were able to get all necessary information on your requirements from " + txtAttendedBy.Text + ", your admission counselor. If you need further information kindly feel free to get in touch with" + txtAttendedBy.Text + " Looking forward to seeing you at the University.";
            Mesag = Mesag + "</td></tr><tr><td>";
            Mesag = Mesag + "</td></tr><tr><td>Visit our website www.skylineuniversity.ac.ae for more info";
            Mesag = Mesag + "</td></tr><tr><td>";
            Mesag = Mesag + "</td></tr><tr><td>" + "Best regards,";
            //Mesag = Mesag + "</td></tr><tr><td>" + txtAttendedBy.Text;
            Mesag = Mesag + "</td></tr><tr><td>" + "Marketing & Admissions Dept";
            Mesag = Mesag + "</td></tr><tr><td>" + "Skyline University College";
            //Mesag = Mesag + "</td></tr><tr><td>" + "University City of Sharjah, Sharjah";
            //Mesag = Mesag + "</td></tr><tr><td>" + "P.O. Box: 1797, Sharjah, U.A.E";
            //Mesag = Mesag + "</td></tr><tr><td>" + "Tel. : 971-6-5441155, Fax.: 971-6-5441166";
            //Mesag = Mesag + "</td></tr><tr><td>" + "Email: [email protected]";
            Mesag = Mesag + "</td></tr></tr></tbody></table></p><p></p>";
            SendEmails.SendEmail2("*****@*****.**", ToEmail, "Skyline", Mesag, "");
            SendEmails.SendEmail2("*****@*****.**", ToEmail, "Skyline", Mesag, "");
            //strPostResponse = obj.SendSMS("", "", "+" + txtMobileNo.Text, "Thank you for enquiring about our Programs at SUC. For more information, please visit us between 9:30am and  9:30pm or visit  www.skylineuniversity.ac.ae");
            //strPostResponse = obj.SendSMS("", "", "+971556460999" , "Thank you for enquiring about our Programs at SUC. For more information, please visit us between 9:30am and  9:30pm or visit  www.skylineuniversity.ac.ae");
        }
        if (ddlStudentStatus.SelectedValue == "1")
        {
            string eventname = "";
            Mesag     = "<table>";
            Mesag     = Mesag + "<tr><td>" + "Dear " + ddlTitle.SelectedItem.Text + " " + Name;
            Mesag     = Mesag + "</td></tr><tr><td>";
            Mesag     = Mesag + "</td></tr><tr><td>";
            Mesag     = Mesag + "</td></tr><tr><td>";
            Mesag     = Mesag + "</td></tr> <tr><td>Greetings from Skyline University College (SUC)!";
            Mesag     = Mesag + "</td></tr><tr><td>";
            eventname = ddlExhibition.SelectedItem.Text;
            try
            {
                if ((eventname == "SELECT") || (eventname == "Select"))
                {
                    Mesag = Mesag + "</td></tr><tr><td>" + "Thank you for visiting us at our campus. We hope that you were able to get all the necessary information on your requirements from " + txtAttendedBy.Text + ", your admission counselor. If you need further information kindly feel free to get in touch with" + txtAttendedBy.Text;
                }
                else
                {
                    Mesag = Mesag + "</td></tr><tr><td>" + "Thank you for visiting us at " + eventname + " . We hope that you were able to get all the necessary information on your requirements from " + txtAttendedBy.Text + ", your admission counselor. If you need further information kindly feel free to get in touch with" + txtAttendedBy.Text;
                }
            }
            catch
            {
                Mesag = Mesag + "</td></tr><tr><td>" + "Thank you for visiting us at our campus. We hope that you were able to get all the necessary information on your requirements from " + txtAttendedBy.Text + ", your admission counselor. If you need further information kindly feel free to get in touch with" + txtAttendedBy.Text;
            }
            //Mesag = Mesag + "</td></tr><tr><td>" + "Thank you for visiting us at our campus. We hope that you were able to get all the necessary information on your requirements from " + txtAttendedBy.Text + ", your admission counselor. If you need further information kindly feel free to get in touch with" + txtAttendedBy.Text;
            Mesag = Mesag + "</td></tr><tr><td>";
            Mesag = Mesag + "</td></tr><tr><td>Visit our website www.skylineuniversity.ac.ae for more info";
            Mesag = Mesag + "</td></tr><tr><td>";
            Mesag = Mesag + "</td></tr><tr><td>" + "Best regards,";
            Mesag = Mesag + "</td></tr><tr><td>" + "Marketing & Admissions Dept";
            Mesag = Mesag + "</td></tr><tr><td>" + "Skyline University College";
            //Mesag = Mesag + "</td></tr><tr><td>" + txtAttendedBy.Text;
            //Mesag = Mesag + "</td></tr><tr><td>" + "Skyline University College";
            //Mesag = Mesag + "</td></tr><tr><td>" + "University City of Sharjah, Sharjah";
            //Mesag = Mesag + "</td></tr><tr><td>" + "P.O. Box: 1797, Sharjah, U.A.E";
            //Mesag = Mesag + "</td></tr><tr><td>" + "Tel. : 971-6-5441155, Fax.: 971-6-5441166";
            //Mesag = Mesag + "</td></tr><tr><td>" + "Email: [email protected]";
            Mesag = Mesag + "</td></tr></tr></tbody></table></p><p></p>";
            SendEmails.SendEmail2("*****@*****.**", ToEmail, "Skyline", Mesag, "");
            //SendEmails.SendEmail2("*****@*****.**", ToEmail, "Skyline", Mesag, "");
            try
            {
                if ((eventname == "SELECT") || (eventname == "Select"))
                {
                    //strPostResponse = obj.SendSMS("", "", "+" + txtMobileNo.Text, "Thank you for visiting us at "+ eventname +". For clarifications please contact the advising officer on +97165441155 or visit  www.skylineuniversity.ac.ae.");
                }
                else
                {
                    //strPostResponse = obj.SendSMS("", "", "+" + txtMobileNo.Text, "Thank you for enquiring about our Programs at `SUC. For clarifications please contact the advising officer on +97165441155 or visit  www.skylineuniversity.ac.ae.");
                }
            }
            catch
            {
                //strPostResponse = obj.SendSMS("", "", "+" + txtMobileNo.Text, "Thank you for enquiring about our Programs at `SUC. For clarifications please contact the advising officer on +97165441155 or visit  www.skylineuniversity.ac.ae.");
            }

            //strPostResponse = obj.SendSMS("", "", "+971556460999", "Thank you for enquiring about our Programs at SUC. For clarifications please contact the advising officer on +97165441155 or visit  www.skylineuniversity.ac.ae.");
        }


        if (ddlStudentStatus.SelectedValue == "9")
        {
            string eventname = "";
            Mesag     = "<table>";
            Mesag     = Mesag + "<tr><td>" + "Dear " + ddlTitle.SelectedItem.Text + " " + Name;
            Mesag     = Mesag + "</td></tr><tr><td>";
            Mesag     = Mesag + "</td></tr><tr><td>";
            Mesag     = Mesag + "</td></tr><tr><td>";
            Mesag     = Mesag + "</td></tr> <tr><td>Greetings from Skyline University College (SUC)!";
            Mesag     = Mesag + "</td></tr><tr><td>";
            eventname = ddlExhibition.SelectedItem.Text;
            try
            {
                Mesag = Mesag + "</td></tr><tr><td>" + "Thank you for visiting us at " + eventname + " . We hope that you were able to get all the necessary information on your requirements from " + txtAttendedBy.Text + ", your admission counselor. If you need further information kindly feel free to get in touch with " + txtAttendedBy.Text;
            }
            catch
            {
                Mesag = Mesag + "</td></tr><tr><td>" + "Thank you for visiting us at our campus. We hope that you were able to get all the necessary information on your requirements from " + txtAttendedBy.Text + ", your admission counselor. If you need further information kindly feel free to get in touch with " + txtAttendedBy.Text;
            }
            //Mesag = Mesag + "</td></tr><tr><td>" + "Thank you for visiting us at our campus. We hope that you were able to get all the necessary information on your requirements from " + txtAttendedBy.Text + ", your admission counselor. If you need further information kindly feel free to get in touch with" + txtAttendedBy.Text;
            Mesag = Mesag + "</td></tr><tr><td>";
            Mesag = Mesag + "</td></tr><tr><td>Visit our website www.skylineuniversity.ac.ae for more info";
            Mesag = Mesag + "</td></tr><tr><td>";
            Mesag = Mesag + "</td></tr><tr><td>" + "Best regards,";
            Mesag = Mesag + "</td></tr><tr><td>" + "Marketing & Admissions Dept";
            Mesag = Mesag + "</td></tr><tr><td>" + "Skyline University College";
            //Mesag = Mesag + "</td></tr><tr><td>" + txtAttendedBy.Text;
            //Mesag = Mesag + "</td></tr><tr><td>" + "Skyline University College";
            //Mesag = Mesag + "</td></tr><tr><td>" + "University City of Sharjah, Sharjah";
            //Mesag = Mesag + "</td></tr><tr><td>" + "P.O. Box: 1797, Sharjah, U.A.E";
            //Mesag = Mesag + "</td></tr><tr><td>" + "Tel. : 971-6-5441155, Fax.: 971-6-5441166";
            //Mesag = Mesag + "</td></tr><tr><td>" + "Email: [email protected]";
            Mesag = Mesag + "</td></tr></tr></tbody></table></p><p></p>";
            SendEmails.SendEmail2("*****@*****.**", ToEmail, "Skyline", Mesag, "");
            //SendEmails.SendEmail2("*****@*****.**", ToEmail, "Skyline", Mesag, "");
            try
            {
                //strPostResponse = obj.SendSMS("", "", "+" + txtMobileNo.Text, "Thank you for visiting us at " + eventname + ". For clarifications please contact the advising officer on +97165441155 or visit  www.skylineuniversity.ac.ae.");
            }
            catch
            {
                //strPostResponse = obj.SendSMS("", "", "+" + txtMobileNo.Text, "Thank you for enquiring about our Programs at `SUC. For clarifications please contact the advising officer on +97165441155 or visit  www.skylineuniversity.ac.ae.");
            }

            //strPostResponse = obj.SendSMS("", "", "+971556460999", "Thank you for enquiring about our Programs at SUC. For clarifications please contact the advising officer on +97165441155 or visit  www.skylineuniversity.ac.ae.");
        }
    }
Beispiel #29
0
    protected void btnUpdate_Click(object sender, EventArgs e)
    {
        try
        {
            StudentRegistrationDAL s = new StudentRegistrationDAL();

            if (txtRemarks.Text != "")
            {
                try
                {
                    StudentRegistrationDAL d = new StudentRegistrationDAL();
                    string RegNo             = d.GetRegNo1(Request.QueryString["Id"].ToString());
                    if (Session["DepId"].ToString() != "4")
                    {
                        DataTable dt        = d.GetCheckEmails(RegNo);
                        bool      IsPresent = false;
                        if (dt.Rows.Count == 1)
                        {
                            IsPresent = true;
                        }
                        if (IsPresent == true)
                        {
                            lblMesag.Text      = "Please contact Admin for Cancellation or postponed";
                            lblMesag.ForeColor = System.Drawing.Color.Red;
                            return;
                        }
                    }
                    string Result = s.InsertIpdateStatus(Request.QueryString["Id"].ToString(), DateTime.Parse(txtCallDate.Text), ddlStudentStatus.SelectedValue, txtRemarks.Text, int.Parse(Session["EMPID"].ToString()), int.Parse(ddlTerm.SelectedValue));
                    if (Result == "RegisterNo")
                    {
                        DataSet   ds = s.ProcSetProgramForCancel(Request.QueryString["Id"].ToString(), Session["EMPID"].ToString());
                        DataTable dtStudentDetails = ds.Tables[0];
                        DataTable dtEmail          = ds.Tables[1];
                        string    FromEmail        = dtEmail.Rows[0]["OFFICEEMAID"].ToString();
                        string    ToEmail          = "*****@*****.**";
                        string    Subject          = "Postponed / Cancel / Active Student Detail";
                        string    CC      = "[email protected],[email protected]";
                        string    Message = "";
                        Message = "<table style=background-color:#FAF1E7; text-transform:uppercase; border-color:#C67E7E; border=1><tbody>";
                        Message = Message + "<tr><td colspan=2><h3><font size=5>Postpond / Cancel / Actiive Student Detail</font></h3>";
                        Message = Message + "</td></tr><tr><td>REF NO </td><td>" + RegNo.ToUpper();
                        Message = Message + "</td></tr><tr><td>DATE </td><td>" + txtCallDate.Text.ToUpper();
                        Message = Message + "</td></tr><tr><td>NAME</td><td>" + txtName.Text.ToUpper();
                        Message = Message + "</td></tr><tr><td>PROCESSED BY</td><td>" + Session["Name"].ToString().ToUpper();
                        Message = Message + "</td></tr><tr><td>REMARKS</td><td>" + txtRemarks.Text.ToUpper();
                        Message = Message + "</td></tr><tr><td>STATUS</td><td>" + ddlStudentStatus.SelectedItem.Text.ToUpper();
                        Message = Message + "</td></tr><tr><td>PROGRAM</td><td>" + dtStudentDetails.Rows[0]["DegreeCode"].ToString().ToUpper();
                        Message = Message + "</td></tr><tr><td>SHIFT</td><td>" + dtStudentDetails.Rows[0]["Shift"].ToString().ToUpper();

                        if (ddlStudentStatus.SelectedValue == "P")
                        {
                            Message = Message + "</td></tr><tr><td>CURRENT TERM</td><td>" + dtStudentDetails.Rows[0]["TermName"].ToString().ToUpper();
                            Message = Message + "</td></tr><tr><td>POSTPONED TERM</td><td>" + ddlTerm.SelectedItem.Text.ToUpper();
                        }
                        else
                        {
                            Message = Message + "</td></tr><tr><td>TERM</td><td>" + dtStudentDetails.Rows[0]["TermName"].ToString().ToUpper();
                        }
                        Message = Message + "</td></tr></tr></tbody></table></p><p></p>";
                        ToEmail = "*****@*****.**";
                        SendEmails.SendEmail(FromEmail, ToEmail, Subject, Message, CC);
                        lblMesag.Text      = "Sucessfully Updated!!!";
                        lblMesag.ForeColor = System.Drawing.Color.Blue;
                    }
                    else
                    {
                        lblMesag.Text      = "Try Again";
                        lblMesag.ForeColor = System.Drawing.Color.Red;
                        return;
                    }
                }
                catch
                {
                    lblMesag.Text      = "Try Again";
                    lblMesag.ForeColor = System.Drawing.Color.Red;
                    return;
                }
            }
            else
            {
                lblMesag.Text      = "Remarks Required";
                lblMesag.ForeColor = System.Drawing.Color.Red;
                return;
            }
        }
        catch
        {
            lblMesag.Text      = "Try Again!";
            lblMesag.ForeColor = System.Drawing.Color.Red;
        }
    }