private async void DismissB_Click(object sender, RoutedEventArgs e)
        {
            TranslateTransform tt = new TranslateTransform();

            this.RenderTransform = tt;
            StackPanel      sp = this.Parent as StackPanel;
            DoubleAnimation dismissAnimation = new DoubleAnimation();

            dismissAnimation.To                = sp.ActualWidth + this.ActualWidth;
            dismissAnimation.Duration          = TimeSpan.FromMilliseconds(DismissAnimationDuration);
            dismissAnimation.AccelerationRatio = 0.5;
            tt.BeginAnimation(TranslateTransform.XProperty, dismissAnimation);
            await Task.Delay(DismissAnimationDuration);

            sp.Children.Remove(this);
            DatabaseConnectivity dc = new DatabaseConnectivity();

            dc.Connect();
            MySqlCommand command = new MySqlCommand();

            command.Parameters.AddWithValue("@id", NotificationId);
            dc.Execute(command, "DELETE FROM notifications WHERE NotificationId=@id");
            dc.Unconnect();
            if (sp.Children.Count == 1)
            {
                MainWindow.Instance.NotificationsG.Visibility = Visibility.Collapsed;
            }
        }
        protected void btnSave_Click(object sender, EventArgs e)
        {
            TextBox      txtUserID        = DetailsView1.FindControl("txtUserID") as TextBox;
            TextBox      txtUserName      = DetailsView1.FindControl("txtUserName") as TextBox;
            DropDownList dropUserRole     = DetailsView1.FindControl("dropUserRole") as DropDownList;
            TextBox      txtUserStatus    = DetailsView1.FindControl("txtUserStatus") as TextBox;
            TextBox      txtUserLoginDate = DetailsView1.FindControl("txtUserLoginDate") as TextBox;
            TextBox      txtWrongAttempts = DetailsView1.FindControl("txtWrongAttempts") as TextBox;
            int          userID           = Convert.ToInt32(txtUserID.Text.ToString());
            string       userName         = txtUserName.Text.ToString();
            string       userRole         = dropUserRole.SelectedValue.ToString();
            string       userStatus       = txtUserStatus.Text.ToString();
            string       userLoginDate    = txtUserLoginDate.Text.ToString();
            string       wrongAttempts    = txtWrongAttempts.Text.ToString();

            Debug.WriteLine("");
            Debug.WriteLine("Data From Grid:");
            Debug.WriteLine("User ID: " + userID);
            Debug.WriteLine("User Name: " + userName);
            Debug.WriteLine("User Type: " + userRole);
            Debug.WriteLine("User Status: " + userStatus);
            Debug.WriteLine("User Login Date: " + userLoginDate);
            Debug.WriteLine("User Wrong Attempts: " + wrongAttempts);
            DatabaseConnectivity dbcon = new DatabaseConnectivity();
            int res = dbcon.setAUser(userID, userName, userRole, userStatus, userLoginDate, wrongAttempts);

            //nt ResultQuery = dbcon.setAClient(userID, userName, userRole, userStatus, userLoginDate, wrongAttempts);
            //Console.WriteLine("<script>alert(" + ResultQuery + "record has been updated." + ")</script>");
            //ClientScript.RegisterStartupScript(this.GetType(), DateTime.Now.ToString(), "<script>alert(" + ResultQuery + "record has been updated." + ")</script>", true);
            //ScriptManager.RegisterStartupScript(this, this.GetType(), DateTime.Now.ToString(), "<script>alert(" + ResultQuery +")</script>", true);
            DetailsView1.Visible = false;
            //DetailsView1.Style.Add("display", "none");
            _BindService();
        }
        protected void GridView1_RowUpdating(object sender, GridViewUpdateEventArgs e)
        {
            DatabaseConnectivity dbcon = new DatabaseConnectivity();
            String ClientName          = GridView1.DataKeys[e.RowIndex].Value.ToString();

            _BindService();
        }
Exemple #4
0
        protected void btnSave_Click(object sender, EventArgs e)
        {
            string _username = txtUserName.Text.ToString();
            string _userrole = dropUserRole.SelectedValue.ToString();
            string _password = Convert.ToString(System.Convert.ToBase64String(System.Text.Encoding.UTF8.GetBytes(txtPasscode.Text.ToString())));

            //var base64EncodedBytes = System.Convert.FromBase64String(base64EncodedData);
            //return System.Text.Encoding.UTF8.GetString(base64EncodedBytes);
            if (_username != null)
            {
                Debug.WriteLine("");
                Debug.WriteLine("Username: "******"User Role: " + _userrole);
                Debug.WriteLine("Password: "******"Query Status: " + res);
                if (res == 1)
                {
                    lblSubmission.Visible = true;
                    rowUserName.Visible   = false;
                    rowUserRole.Visible   = false;
                    rowPasscode.Visible   = false;
                    rowRePasscode.Visible = false;
                    rowSubmit.Visible     = false;
                }
            }
            else
            {
                Debug.WriteLine("alert(Please Enter Product Name.)");
            }
        }
Exemple #5
0
        protected void btnSave_Click(object sender, EventArgs e)
        {
            string title = txtCTypeTitle.Text.ToString();
            string desc  = txtCTypeDesc.Text.ToString();

            if (title != null)
            {
                Debug.WriteLine("");
                Debug.WriteLine("User CType Title: " + title);
                Debug.WriteLine("User CType Description: " + desc);
                DatabaseConnectivity dbcon = new DatabaseConnectivity();
                int res = dbcon.insertClientType(title, desc);
                Debug.WriteLine("Query Status: " + res);
                if (res == 1)
                {
                    lblSubmission.Visible = true;
                    rowCTypeTitle.Visible = false;
                    rowCTypeDesc.Visible  = false;
                    rowSubmit.Visible     = false;
                }
            }
            else
            {
                Debug.WriteLine("alert(Please Enter User Role Title.)");
            }
        }
        protected void Page_Load(object sender, EventArgs e)
        {
            serializer = new System.Web.Script.Serialization.JavaScriptSerializer();

            if (Request.Cookies["UserID"] != null) // && Request.Cookies["Password"] != null
            {
                //String[] cookies = Request.Cookies.AllKeys;
                String userid   = Request.Cookies.Get("UserID").Value;
                String password = Request.Cookies.Get("Password").Value;
                Debug.WriteLine("User Loggedin with UserID: " + userid + " and Pwd: " + password);

                DatabaseConnectivity dbcon = new DatabaseConnectivity();
                //string[] clientList = dbcon.getClientList();
                //clientList = new[] {"BAFL", "HBL", "HBL AMC", "PMRC", "ABL"};
            }
            //if()
            //try
            //{
            //    if (Session["UserID"] != null)
            //    {
            //        lblUser.Text = "Hi " + Session["UserID"];
            //    }
            //    else
            //    {
            //        Response.Redirect("~/Default.aspx", true);
            //    }

            //}
            //catch (Exception ex)
            //{
            //    Debug.WriteLine(ex.Message);
            //}
        }
        protected void btnSave_Click(object sender, EventArgs e)
        {
            TextBox txtClientId   = DetailsView1.FindControl("txtClientID") as TextBox;
            TextBox txtClientName = DetailsView1.FindControl("txtClientName") as TextBox;
            TextBox txtClientDesc = DetailsView1.FindControl("txtClientDesc") as TextBox;
            int     ClientID      = Convert.ToInt32(txtClientId.Text.ToString());
            string  ClientName    = txtClientName.Text.ToString();
            string  ClientDesc    = txtClientDesc.Text.ToString();

            Debug.WriteLine("");
            Debug.WriteLine("Data From Grid:");
            Debug.WriteLine("EnvType ID: " + ClientID);
            Debug.WriteLine("EnvType Title: " + ClientName);
            Debug.WriteLine("EnvType Desc: " + ClientDesc);
            DatabaseConnectivity dbcon = new DatabaseConnectivity();
            int ResultQuery            = dbcon.setEnvType(ClientID, ClientName, ClientDesc);

            //Console.WriteLine("<script>alert(" + ResultQuery + "record has been updated." + ")</script>");
            //ClientScript.RegisterStartupScript(this.GetType(), DateTime.Now.ToString(), "<script>alert(" + ResultQuery + "record has been updated." + ")</script>", true);
            //ScriptManager.RegisterStartupScript(this, this.GetType(), DateTime.Now.ToString(), "<script>alert(" + ResultQuery +")</script>", true);
            DetailsView1.Visible = false;
            this.Page_Load(null, null);
            //UpdatePanel1.Update();
            //UpdatePanel1.Update();
            //DetailsView1.Style.Add("display", "none");
        }
        protected void GridView1_RowUpdating(object sender, GridViewUpdateEventArgs e)
        {
            //if (!Page.IsPostBack)
            //{
            DatabaseConnectivity dbcon = new DatabaseConnectivity();
            String ClientName          = GridView1.DataKeys[e.RowIndex].Value.ToString();

            //int queryResult = dbcon.updateClientPatches2(dbcon.get);
            //int userid = Convert.ToInt32(GridView1.DataKeys[e.RowIndex].Value.ToString());
            //GridViewRow row = (GridViewRow)GridView1.Rows[e.RowIndex];
            //Label lblID = (Label)row.FindControl("lblClientName");
            ////TextBox txtname=(TextBox)gr.cell[].control[];
            //TextBox textName = (TextBox)row.Cells[0].Controls[0];
            //TextBox textadd = (TextBox)row.Cells[1].Controls[0];
            //TextBox textc = (TextBox)row.Cells[2].Controls[0];
            ////TextBox textadd = (TextBox)row.FindControl("txtadd");
            ////TextBox textc = (TextBox)row.FindControl("txtc");
            //GridView1.EditIndex = -1;
            //Debug.WriteLine("Query Result: " + queryResult);
            //Debug.WriteLine(textName.Text + "\n" + textadd.Text + "\n" + textc.Text + "\n");
            //conn.Open();
            ////SqlCommand cmd = new SqlCommand("SELECT * FROM detail", conn);
            //SqlCommand cmd = new SqlCommand("update detail set name='" + textName.Text + "',address='" + textadd.Text + "',country='" + textc.Text + "'where id='" + userid + "'", conn);
            //cmd.ExecuteNonQuery();
            //conn.Close();
            //gvbind();
            // }
            _BindService();
        }
        protected void btnDelete_Click(object sender, EventArgs e)
        {
            DatabaseConnectivity dbcon = new DatabaseConnectivity();
            int ClientID = Convert.ToInt32(dropPatchClientName.SelectedValue);
            int res      = dbcon.deleteAClient(ClientID);

            rowPatchClientName.Visible = false;
            rowSubmit.Visible          = false;
            lblSubmission.Visible      = true;
        }
        private void _BindService()
        {
            DatabaseConnectivity dbcon   = new DatabaseConnectivity();
            List <Patch>         service = dbcon.getAllUpdatedClientPatches(Convert.ToInt32(dropProduct.SelectedValue), Convert.ToInt32(dropEnvironment.SelectedValue));

            if (service.Count > 0 && service != null)
            {
                GridView1.DataSource = service;
                GridView1.DataBind();
            }
        }
        private void _BindService()
        {
            DatabaseConnectivity   dbcon   = new DatabaseConnectivity();
            List <EnvironmentType> service = dbcon.getEnvTypeList();

            if (service.Count > 0 && service != null)
            {
                GridView1.DataSource = service;
                GridView1.DataBind();
            }
        }
        private void _BindService()
        {
            DatabaseConnectivity dbcon   = new DatabaseConnectivity();
            List <Product>       service = dbcon.getProductList();

            if (service.Count > 0 && service != null)
            {
                GridView1.DataSource = service;
                GridView1.DataBind();
            }
        }
        protected void btnDelete_Click(object sender, EventArgs e)
        {
            DatabaseConnectivity dbcon = new DatabaseConnectivity();
            int clientType             = Convert.ToInt32(dropClientType.SelectedValue);
            int res = dbcon.deleteClientType(clientType);

            rowClientType.Visible = false;
            rowSubmit.Visible     = false;
            lblSubmission.Visible = true;
            lblSubmission.Text    = "Delete User Role Query is successfully executed with the Response Code: " + (res == 1 ? "0200 OK" : (res == -1 ? "0203 NOT OK" : "0500 SERVER ERROR"));
        }
        private void _BindService()
        {
            DatabaseConnectivity dbcon = new DatabaseConnectivity();
            List <HelloWorld.App_Code.Environment> service = dbcon.getAllEnvironments();

            if (service.Count > 0 && service != null)
            {
                GridView1.DataSource = service;
                GridView1.DataBind();
            }
        }
        protected void btnSave_Click(object sender, EventArgs e)
        {
            TextBox txtProductId       = DetailsView1.FindControl("txtProductID") as TextBox;
            TextBox txtProductName     = DetailsView1.FindControl("txtProductName") as TextBox;
            TextBox txtProductDesc     = DetailsView1.FindControl("txtProductDesc") as TextBox;
            TextBox txtProductVersion  = DetailsView1.FindControl("txtProductVersion") as TextBox;
            TextBox txtProductType     = DetailsView1.FindControl("txtProductType") as TextBox;
            TextBox txtProductCategory = DetailsView1.FindControl("txtProductCategory") as TextBox;
            TextBox txtProductRating   = DetailsView1.FindControl("txtProductRating") as TextBox;
            TextBox txtProductUserID   = DetailsView1.FindControl("txtProductUserID") as TextBox;
            TextBox txtProductPassword = DetailsView1.FindControl("txtProductPassword") as TextBox;
            TextBox txtProductPOC      = DetailsView1.FindControl("txtProductPOC") as TextBox;
            TextBox txtProductEmail    = DetailsView1.FindControl("txtProductEmail") as TextBox;
            TextBox txtProductComment  = DetailsView1.FindControl("txtProductComment") as TextBox;
            int     ProductID          = Convert.ToInt32(txtProductId.Text.ToString());
            string  ProductName        = txtProductName.Text.ToString();
            string  ProductDesc        = txtProductDesc.Text.ToString();
            string  ProductVersion     = txtProductVersion.Text.ToString();
            string  ProductType        = txtProductType.Text.ToString();
            string  ProductCategory    = txtProductCategory.Text.ToString();
            string  ProductRating      = txtProductRating.Text.ToString();
            string  ProductUserID      = txtProductUserID.Text.ToString();
            string  ProductPassword    = txtProductPassword.Text.ToString();
            string  ProductPOC         = txtProductPOC.Text.ToString();
            string  ProductEmail       = txtProductEmail.Text.ToString();
            string  ProductComment     = txtProductComment.Text.ToString();

            Debug.WriteLine("");
            Debug.WriteLine("Data From Grid:");
            Debug.WriteLine("ProductID: " + ProductID);
            Debug.WriteLine("ProductName: " + ProductName);
            Debug.WriteLine("ProductDesc: " + ProductDesc);
            Debug.WriteLine("ProductVersion: " + ProductVersion);
            Debug.WriteLine("ProductType: " + ProductType);
            Debug.WriteLine("ProductCategory: " + ProductCategory);
            Debug.WriteLine("ProductRating: " + ProductRating);
            Debug.WriteLine("ProductUserID: " + ProductUserID);
            Debug.WriteLine("ProductPassword: "******"ProductPOC: " + ProductPOC);
            Debug.WriteLine("ProductEmail: " + ProductEmail);
            Debug.WriteLine("ProductComment: " + ProductComment);
            DatabaseConnectivity dbcon = new DatabaseConnectivity();
            int ResultQuery            = dbcon.setAProduct(ProductID, ProductName, ProductDesc, ProductVersion, ProductType, ProductCategory, ProductRating, ProductUserID, ProductPassword, ProductPOC, ProductEmail, ProductComment);

            DetailsView1.Visible = false;
        }
Exemple #16
0
        protected void btnSave_Click(object sender, EventArgs e)
        {
            string _productName         = txtProductName.Text.ToString();
            string _productDesc         = txtProductDesc.Text.ToString();
            string _productVersion      = txtProductVersion.Text.ToString();
            string _productType         = txtProductType.Text.ToString();
            string _productCategory     = txtProductCategory.Text.ToString();
            string _productRating       = txtProductRating.Text.ToString();
            string _productUserID       = txtProductUserID.Text.ToString();
            string _productPassword     = txtProductPassword.Text.ToString();
            string _productPOC          = txtProductPOC.Text.ToString();
            string _productSupportEmail = txtProductSupportEmail.Text.ToString();
            string _productComments     = txtProductComments.Text.ToString();

            if (_productName != null)
            {
                Debug.WriteLine("");
                Debug.WriteLine("Product Name: " + _productName);
                Debug.WriteLine("Product Desc: " + _productDesc);
                DatabaseConnectivity dbcon = new DatabaseConnectivity();
                int res = dbcon.insertProduct(_productName, _productDesc, _productVersion, _productType, _productCategory, _productRating, _productUserID, _productPassword, _productPOC, _productSupportEmail, _productComments);
                Debug.WriteLine("Query Status: " + res);
                if (res == 1)
                {
                    lblSubmission.Visible          = true;
                    rowProductName.Visible         = false;
                    rowProductDesc.Visible         = false;
                    rowProductType.Visible         = false;
                    rowProductCategory.Visible     = false;
                    rowProductComments.Visible     = false;
                    rowProductUserID.Visible       = false;
                    rowProductPassword.Visible     = false;
                    rowProductPOC.Visible          = false;
                    rowProductRating.Visible       = false;
                    rowProductSupportEmail.Visible = false;
                    rowProductVersion.Visible      = false;
                    rowSubmit.Visible = false;
                }
            }
            else
            {
                Debug.WriteLine("alert(Please Enter Product Name.)");
            }
        }
        protected void Login_Clicked(object sender, EventArgs e)
        {
            string userID      = dropUserId.Text.ToString();
            string password    = txtPassword.Text.ToString();
            bool   loginStatus = false;

            Debug.WriteLine("UserID is: " + userID);
            Debug.WriteLine("Password is: " + password);
            if (userID != "Select UserID" && userID != "")
            {
                DatabaseConnectivity dbcon    = new DatabaseConnectivity();
                List <User>          userList = dbcon.getAuthUsers();
                foreach (var item in userList)
                {
                    if (userID.Equals(item.UserID) && password.Equals(item.Password))
                    {
                        loginStatus       = true;
                        Session["UserID"] = userID;
                        break;
                    }
                    else
                    {
                    }
                }

                if (loginStatus)
                {
                    lblStatus.Text     = "Response Code: ";
                    lblStatusCode.Text = "0200";
                    Response.Redirect("~/ProtectedPages/Dashboard.aspx");
                }
                else
                {
                    lblStatus.Text     = "Response Code: ";
                    lblStatusCode.Text = "0401";
                }
            }
            else
            {
                lblStatus.Text     = "Response Code: ";
                lblStatusCode.Text = "0401";
            }
        }
        protected void btnSave_Click(object sender, EventArgs e)
        {
            string _patchTitle      = txtPatchTitle.Text;
            string _patchDesc       = txtPatchDesc.Text;
            string _patchNumber     = txtPatchNumber.Text;
            string _patchDeployedBy = txtPatchDeployedBy.Text;
            int    _patchQATested   = checkIsQAPassedYes.Checked == true ? 1 : 0;

            _patchQATested = checkIsQAPassedNo.Checked == true ? 0 : 1;
            string _patchDependency    = txtPatchDependency.Text;
            int    _patchClientID      = Convert.ToInt32(dropPatchClientName.SelectedItem.Value);
            int    _patchProductID     = Convert.ToInt32(dropProductName.SelectedItem.Value);
            int    _patchEnvironmentID = Convert.ToInt32(dropEnvironmentType.SelectedItem.Value);

            Debug.WriteLine("Patch Title: " + _patchTitle);
            Debug.WriteLine("Patch Description: " + _patchDesc);
            Debug.WriteLine("Patch Number: " + _patchNumber);
            Debug.WriteLine("Patch Deployed By: " + _patchDeployedBy);
            Debug.WriteLine("Patch QA Passed " + _patchQATested);
            Debug.WriteLine("Patch Dependency " + _patchDependency);
            Debug.WriteLine("Patch Client ID " + _patchClientID);
            Debug.WriteLine("Patch Product ID: " + _patchProductID);
            Debug.WriteLine("Patch Environment ID: " + _patchEnvironmentID);

            DatabaseConnectivity db = new DatabaseConnectivity();
            int res = db.insertPatch(_patchTitle, _patchDesc, _patchNumber, _patchDeployedBy, Convert.ToDateTime(txtPatchCreatedDate.Text), Convert.ToDateTime(txtPatchDeployedDate.Text), _patchQATested, _patchDependency, _patchClientID, _patchProductID, _patchEnvironmentID);

            Debug.WriteLine("Query Result: " + res);
            rowPatchTitle.Visible        = false;
            rowPatchDesc.Visible         = false;
            rowPatchNumber.Visible       = false;
            rowPatchDeployedBy.Visible   = false;
            rowPatchCreatedDate.Visible  = false;
            rowPatchDeployedDate.Visible = false;
            rowPatchIsQAPassed.Visible   = false;
            rowPatchDependency.Visible   = false;
            rowPatchClientName.Visible   = false;
            rowProductName.Visible       = false;
            rowEnvironmentType.Visible   = false;
            rowSubmit.Visible            = false;
            lblSubmission.Visible        = true;
            lblSubmission.Text           = "Release has been saved with the Response Code: " + (res == 1 ? "0200 OK." : "0500 Error.");
        }
Exemple #19
0
        static void Main()
        {
            Application.EnableVisualStyles();
            Application.SetCompatibleTextRenderingDefault(false);
            if (Application.UserAppDataRegistry.GetValue("remeberMe") != null)
            {
                Dashboard dashboard = new Dashboard();
                dashboard.Show();
            }
            else
            {
                Login login = new Login();
                login.Show();
            }

            DatabaseConnectivity databaseConnectivity = new DatabaseConnectivity();

            databaseConnectivity.connectionValidator();
            Application.Run();
        }
        protected void btnDelete_Click(object sender, EventArgs e)
        {
            DatabaseConnectivity dbcon = new DatabaseConnectivity();
            string title        = txtPatchTitle.Text.ToString();
            string patchNumber  = txtPatchNumber.Text.ToString();
            string createdDate  = txtPatchCreatedDate.Text.ToString();
            string deployedDate = txtPatchDeployedDate.Text.ToString();
            string clientID     = dropPatchClientName.SelectedValue;
            string environment  = dropEnvironmentType.SelectedValue;
            string product      = dropProductName.SelectedValue;
            int    res          = dbcon.deleteARelease(title, patchNumber, createdDate, deployedDate, clientID, environment, product);

            rowPatchTitle.Visible        = false;
            rowPatchNumber.Visible       = false;
            rowPatchCreatedDate.Visible  = false;
            rowPatchDeployedDate.Visible = false;
            rowPatchClientName.Visible   = false;
            rowEnvironmentType.Visible   = false;
            rowProductName.Visible       = false;
            rowSubmit.Visible            = false;
            lblSubmission.Visible        = true;
        }
Exemple #21
0
        protected void btnSave_Click(object sender, EventArgs e)
        {
            TextBox      txtClientId    = DetailsView1.FindControl("txtClientID") as TextBox;
            TextBox      txtClientName  = DetailsView1.FindControl("txtClientName") as TextBox;
            DropDownList txtClientType  = DetailsView1.FindControl("dropClientType") as DropDownList;
            TextBox      txtClientDesc  = DetailsView1.FindControl("txtClientDesc") as TextBox;
            CheckBox     chkClientStill = DetailsView1.FindControl("chkClientStill") as CheckBox;
            TextBox      txtPOCName     = DetailsView1.FindControl("txtPOCName") as TextBox;
            TextBox      txtPOCEmail    = DetailsView1.FindControl("txtPOCEmail") as TextBox;
            TextBox      txtPOCPhone    = DetailsView1.FindControl("txtPOCPhone") as TextBox;
            int          ClientID       = Convert.ToInt32(txtClientId.Text.ToString());
            string       ClientName     = txtClientName.Text.ToString();
            string       ClientType     = txtClientType.SelectedValue.ToString();
            string       ClientDesc     = txtClientDesc.Text.ToString();
            bool         ClientStill    = chkClientStill.Checked;
            string       ClientPOC      = txtPOCName.Text.ToString();
            string       ClientPOCEmail = txtPOCEmail.Text.ToString();
            string       ClientPOCPhone = txtPOCPhone.Text.ToString();

            Debug.WriteLine("");
            Debug.WriteLine("Data From Grid:");
            Debug.WriteLine("ClientID: " + ClientID);
            Debug.WriteLine("ClientName: " + ClientName);
            Debug.WriteLine("ClientType: " + ClientType);
            Debug.WriteLine("ClientDesc: " + ClientDesc);
            Debug.WriteLine("ClientStill: " + ClientStill);
            Debug.WriteLine("ClientPOC: " + ClientPOC);
            Debug.WriteLine("ClientPOCEmail: " + ClientPOCEmail);
            Debug.WriteLine("ClientPOCPhone: " + ClientPOCPhone);
            DatabaseConnectivity dbcon = new DatabaseConnectivity();
            int ResultQuery            = dbcon.setAClient(ClientID, ClientName, ClientType, ClientDesc, ClientStill, ClientPOC, ClientPOCEmail, ClientPOCPhone);

            //Console.WriteLine("<script>alert(" + ResultQuery + "record has been updated." + ")</script>");
            //ClientScript.RegisterStartupScript(this.GetType(), DateTime.Now.ToString(), "<script>alert(" + ResultQuery + "record has been updated." + ")</script>", true);
            //ScriptManager.RegisterStartupScript(this, this.GetType(), DateTime.Now.ToString(), "<script>alert(" + ResultQuery +")</script>", true);
            DetailsView1.Visible = false;
            //DetailsView1.Style.Add("display", "none");
        }
        protected void btnSave_Click(object sender, EventArgs e)
        {
            string ClientName        = txtClientName.Text.ToString();
            string ClientType        = dropClientType.SelectedValue.ToString();
            string ClientDescription = txtClientDesc.Text.ToString();
            string POCName           = txtPOCName.Text.ToString();
            string POCEmail          = txtPOCEmail.Text.ToString();
            string POCPhone          = txtPOCPhone.Text.ToString();

            if (ClientName != null)
            {
                Debug.WriteLine("");
                Debug.WriteLine("Client Name: " + ClientName);
                Debug.WriteLine("Client Type: " + ClientType);
                Debug.WriteLine("Client Description: " + ClientDescription);
                Debug.WriteLine("Client POCName: " + POCName);
                Debug.WriteLine("Client POCEmail: " + POCEmail);
                Debug.WriteLine("Client POCPhone: " + POCPhone);
                DatabaseConnectivity dbcon = new DatabaseConnectivity();
                int res = dbcon.insertClient(ClientName, ClientType, ClientDescription, POCName, POCEmail, POCPhone);
                Debug.WriteLine("Query Status: " + res);
                if (res == 1)
                {
                    lblSubmission.Visible = true;
                    rowCLientName.Visible = false;
                    rowCLientType.Visible = false;
                    rowCLientDesc.Visible = false;
                    rowPOCName.Visible    = false;
                    rowPOCEmail.Visible   = false;
                    rowPOCPhone.Visible   = false;
                    rowSubmit.Visible     = false;
                }
            }
            else
            {
                Debug.WriteLine("alert(Please Enter Client Name.)");
            }
        }
        private async void ClearAllNotificationB_Click(object sender, RoutedEventArgs e)
        {
            if (NotificationsSP.Children.Count != 0)
            {
                TranslateTransform tt = new TranslateTransform();
                NotificationsSP.RenderTransform = tt;
                DoubleAnimation clearAllAnimation = new DoubleAnimation();
                clearAllAnimation.To = NotificationsSP.ActualWidth * 2;
                clearAllAnimation.AccelerationRatio = 0.5;
                clearAllAnimation.Duration          = TimeSpan.FromMilliseconds(ClearAllAnimationDuration);
                tt.BeginAnimation(TranslateTransform.XProperty, clearAllAnimation);
                await Task.Delay(ClearAllAnimationDuration);

                NotificationsSP.Children.Clear();
                DatabaseConnectivity dc = new DatabaseConnectivity();
                dc.Connect();
                MySqlCommand command = new MySqlCommand();
                command.Parameters.AddWithValue("@id", UserIdLB.Content);
                dc.Execute(command, "DELETE FROM notifications WHERE AccountId=@id");
                dc.Unconnect();
            }
            NotificationsG.Visibility = Visibility.Collapsed;
        }
        protected void btnSave_Click(object sender, EventArgs e)
        {
            Debug.WriteLine("Index");
            DatabaseConnectivity dbcon = new DatabaseConnectivity();
            string  title           = "Demo Title Manual";
            string  desc            = "Demo desc Manual";
            TextBox txtpatchNumber  = DetailsView1.FindControl("txtPatchHotNumber") as TextBox;
            TextBox txtDeployedBy   = DetailsView1.FindControl("txtPatchDeployedBy") as TextBox;
            TextBox txtCreatedDate  = DetailsView1.FindControl("txtPatchCreatedDate") as TextBox;
            TextBox txtDeployedDate = DetailsView1.FindControl("txtPatchDeployedDate") as TextBox;
            TextBox txtStatus       = DetailsView1.FindControl("txtPatchStatus") as TextBox;
            TextBox txtClient       = DetailsView1.FindControl("lblClientName") as TextBox;
            int     clientID        = dbcon.getClientId(txtClient.Text);
            string  patchNumber     = txtpatchNumber.Text.ToString();
            string  deployedBy      = txtDeployedBy.Text.ToString();
            string  createdDate     = txtCreatedDate.Text.ToString();
            string  deployedDate    = txtDeployedDate.Text.ToString();
            string  status          = txtStatus.Text.ToString();
            int     productID       = Convert.ToInt32(dropProduct.SelectedValue);
            int     envType         = Convert.ToInt32(dropEnvironment.SelectedValue);
            int     res             = dbcon.updatePatcheManually(title, desc, patchNumber, deployedBy, createdDate, deployedDate, status, clientID, productID, envType);

            DetailsView1.Visible = false;
        }
        protected void btnSearch_Click(object sender, EventArgs e)
        {
            tblInfo.Rows.Clear();

            //DatabaseConnectivity dbcon = new DatabaseConnectivity();
            int product     = Convert.ToInt32(DropProduct.Text);
            int environment = Convert.ToInt32(DropEnvType.Text);
            int client      = Convert.ToInt32(DropClientID.Text);

            Debug.WriteLine("-_Search Button Click_-");
            Debug.WriteLine(" Product:: " + product);
            Debug.WriteLine(" Environment:: " + environment);
            Debug.WriteLine(" Client:: " + client);

            //Start

            //Debug.WriteLine("Product: " + DropDownList1.Text);
            //Console.WriteLine("GGG");

            DatabaseConnectivity dbcon = new DatabaseConnectivity();

            List <Patch> latestPatchOfClient = dbcon.getPatchList(Convert.ToInt32(DropProduct.SelectedValue), Convert.ToInt32(DropEnvType.SelectedValue), Convert.ToInt32(DropClientID.SelectedValue));


            //HEADER COLUMN START

            TableRow rowHeader = new TableRow();

            TableCell cellClientNameHeader = new TableCell();

            cellClientNameHeader.BackColor = ColorTranslator.FromHtml("#004D40");
            cellClientNameHeader.ForeColor = ColorTranslator.FromHtml("#fff");
            cellClientNameHeader.Font.Name = "Arial Black";
            cellClientNameHeader.Font.Size = FontUnit.Parse("9");
            cellClientNameHeader.Style.Add("padding", "5px");
            cellClientNameHeader.Text            = "Client Name";
            cellClientNameHeader.HorizontalAlign = HorizontalAlign.Center;
            rowHeader.Cells.Add(cellClientNameHeader);
            TableCell cellClientTypeHeader = new TableCell();

            cellClientTypeHeader.BackColor = ColorTranslator.FromHtml("#004D40");
            cellClientTypeHeader.ForeColor = ColorTranslator.FromHtml("#fff");
            cellClientTypeHeader.Font.Name = "Arial Black";
            cellClientTypeHeader.Font.Size = FontUnit.Parse("9");
            cellClientTypeHeader.Style.Add("padding", "5px");
            cellClientTypeHeader.Text            = "Client Role";
            cellClientTypeHeader.HorizontalAlign = HorizontalAlign.Center;
            rowHeader.Cells.Add(cellClientTypeHeader);

            TableCell cellClientProductHeader = new TableCell();

            cellClientProductHeader.BackColor = ColorTranslator.FromHtml("#004D40");
            cellClientProductHeader.ForeColor = ColorTranslator.FromHtml("#fff");
            cellClientProductHeader.Font.Name = "Arial Black";
            cellClientProductHeader.Font.Size = FontUnit.Parse("9");
            cellClientProductHeader.Style.Add("padding", "5px");
            cellClientProductHeader.Text            = "Product";
            cellClientProductHeader.HorizontalAlign = HorizontalAlign.Center;
            rowHeader.Cells.Add(cellClientProductHeader);

            TableCell cellClientEnvTypeHeader = new TableCell();

            cellClientEnvTypeHeader.BackColor = ColorTranslator.FromHtml("#004D40");
            cellClientEnvTypeHeader.ForeColor = ColorTranslator.FromHtml("#fff");
            cellClientEnvTypeHeader.Font.Name = "Arial Black";
            cellClientEnvTypeHeader.Font.Size = FontUnit.Parse("9");
            cellClientEnvTypeHeader.Style.Add("padding", "5px");
            cellClientEnvTypeHeader.Text            = "Environment";
            cellClientEnvTypeHeader.HorizontalAlign = HorizontalAlign.Center;
            rowHeader.Cells.Add(cellClientEnvTypeHeader);

            TableCell cellClientPOCHeader = new TableCell();

            cellClientPOCHeader.BackColor = ColorTranslator.FromHtml("#004D40");
            cellClientPOCHeader.ForeColor = ColorTranslator.FromHtml("#fff");
            cellClientPOCHeader.Font.Name = "Arial Black";
            cellClientPOCHeader.Font.Size = FontUnit.Parse("9");
            cellClientPOCHeader.Style.Add("padding", "5px");
            cellClientPOCHeader.Text            = "Contact Person";
            cellClientPOCHeader.HorizontalAlign = HorizontalAlign.Center;
            rowHeader.Cells.Add(cellClientPOCHeader);

            TableCell cellClientPOCNameHeader = new TableCell();

            cellClientPOCNameHeader.BackColor = ColorTranslator.FromHtml("#004D40");
            cellClientPOCNameHeader.ForeColor = ColorTranslator.FromHtml("#fff");
            cellClientPOCNameHeader.Font.Name = "Arial Black";
            cellClientPOCNameHeader.Font.Size = FontUnit.Parse("9");
            cellClientPOCNameHeader.Style.Add("padding", "5px");
            cellClientPOCNameHeader.Text            = "Total Releases";
            cellClientPOCNameHeader.HorizontalAlign = HorizontalAlign.Center;
            rowHeader.Cells.Add(cellClientPOCNameHeader);

            TableCell cellPatchHotNumberHeader = new TableCell();

            cellPatchHotNumberHeader.BackColor = ColorTranslator.FromHtml("#004D40");
            cellPatchHotNumberHeader.ForeColor = ColorTranslator.FromHtml("#fff");
            cellPatchHotNumberHeader.Font.Name = "Arial Black";
            cellPatchHotNumberHeader.Font.Size = FontUnit.Parse("9");
            cellPatchHotNumberHeader.Style.Add("padding", "5px");
            cellPatchHotNumberHeader.Text            = "Latest Release ";
            cellPatchHotNumberHeader.HorizontalAlign = HorizontalAlign.Center;
            rowHeader.Cells.Add(cellPatchHotNumberHeader);

            TableCell cellPatchQATestedHeader = new TableCell();

            cellPatchQATestedHeader.BackColor = ColorTranslator.FromHtml("#004D40");
            cellPatchQATestedHeader.ForeColor = ColorTranslator.FromHtml("#fff");
            cellPatchQATestedHeader.Font.Name = "Arial Black";
            cellPatchQATestedHeader.Font.Size = FontUnit.Parse("9");
            cellPatchQATestedHeader.Style.Add("padding", "5px");
            cellPatchQATestedHeader.Text            = "QA";
            cellPatchQATestedHeader.HorizontalAlign = HorizontalAlign.Center;
            rowHeader.Cells.Add(cellPatchQATestedHeader);

            TableCell cellPatchDeployedDateHeader = new TableCell();

            cellPatchDeployedDateHeader.BackColor = ColorTranslator.FromHtml("#004D40");
            cellPatchDeployedDateHeader.ForeColor = ColorTranslator.FromHtml("#fff");
            cellPatchDeployedDateHeader.Font.Name = "Arial Black";
            cellPatchDeployedDateHeader.Font.Size = FontUnit.Parse("9");
            cellPatchDeployedDateHeader.Style.Add("padding", "5px");
            cellPatchDeployedDateHeader.Text            = "Deployed Date";
            cellPatchDeployedDateHeader.HorizontalAlign = HorizontalAlign.Center;
            rowHeader.Cells.Add(cellPatchDeployedDateHeader);

            //
            TableCell cellPatchPassedByTimeHeader = new TableCell();

            cellPatchPassedByTimeHeader.BackColor = ColorTranslator.FromHtml("#004D40");
            cellPatchPassedByTimeHeader.ForeColor = ColorTranslator.FromHtml("#fff");
            cellPatchPassedByTimeHeader.Font.Name = "Arial Black";
            cellPatchPassedByTimeHeader.Font.Size = FontUnit.Parse("9");
            cellPatchPassedByTimeHeader.Style.Add("padding", "5px");
            cellPatchPassedByTimeHeader.Text            = "Days Passed";
            cellPatchPassedByTimeHeader.HorizontalAlign = HorizontalAlign.Center;
            rowHeader.Cells.Add(cellPatchPassedByTimeHeader);

            TableCell cellPatchStatusHeader = new TableCell();

            cellPatchStatusHeader.BackColor       = ColorTranslator.FromHtml("#004D40");
            cellPatchStatusHeader.ForeColor       = ColorTranslator.FromHtml("#fff");
            cellPatchStatusHeader.HorizontalAlign = HorizontalAlign.Center;
            cellPatchStatusHeader.Font.Name       = "Arial Black";
            cellPatchStatusHeader.Font.Size       = FontUnit.Parse("9");
            cellPatchStatusHeader.Style.Add("padding", "5px");
            cellPatchStatusHeader.Text            = "STATUS";
            cellPatchStatusHeader.HorizontalAlign = HorizontalAlign.Center;
            rowHeader.Cells.Add(cellPatchStatusHeader);
            //
            //TableCell cellPatchFileServer = new TableCell();
            //cellPatchFileServer.ForeColor = Color.Black;
            //cellPatchFileServer.Text = "";
            //cellPatchFileServer.HorizontalAlign = HorizontalAlign.Right;
            //row.Cells.Add(cellPatchFileServer);
            //
            //TableCell cellPatchIP = new TableCell();
            //cellPatchIP.ForeColor = Color.Black;
            //cellPatchIP.Text = "";
            //cellPatchIP.HorizontalAlign = HorizontalAlign.Right;
            //row.Cells.Add(cellPatchIP);
            //
            //
            //TableCell cellPatchDependency = new TableCell();
            //cellPatchDependency.ForeColor = Color.Black;
            //cellPatchDependency.Text = "";
            //cellPatchDependency.HorizontalAlign = HorizontalAlign.Right;
            //row.Cells.Add(cellPatchDependency);
            //
            TableCell cellAppLinkHeader = new TableCell();

            cellAppLinkHeader.BackColor       = ColorTranslator.FromHtml("#004D40");
            cellAppLinkHeader.ForeColor       = ColorTranslator.FromHtml("#fff");
            cellAppLinkHeader.HorizontalAlign = HorizontalAlign.Center;
            cellAppLinkHeader.Font.Name       = "Arial Black";
            cellAppLinkHeader.Font.Size       = FontUnit.Parse("9");
            cellAppLinkHeader.Style.Add("padding", "5px");
            cellAppLinkHeader.Text            = "Link";
            cellAppLinkHeader.HorizontalAlign = HorizontalAlign.Center;
            rowHeader.Cells.Add(cellAppLinkHeader);

            TableCell cellAppWorkingDirectoryHeader = new TableCell();

            cellAppWorkingDirectoryHeader.BackColor = ColorTranslator.FromHtml("#004D40");
            cellAppWorkingDirectoryHeader.ForeColor = ColorTranslator.FromHtml("#fff");
            cellAppWorkingDirectoryHeader.Font.Name = "Arial Black";
            cellAppWorkingDirectoryHeader.Font.Size = FontUnit.Parse("9");
            cellAppWorkingDirectoryHeader.Style.Add("padding", "5px");
            cellAppWorkingDirectoryHeader.Text            = "Dir";
            cellAppWorkingDirectoryHeader.HorizontalAlign = HorizontalAlign.Center;
            rowHeader.Cells.Add(cellAppWorkingDirectoryHeader);


            //
            tblInfo.Rows.Add(rowHeader);

            //HEADER COLUMN END
            TableRow rowHeaderNoRecord = new TableRow();

            Debug.WriteLine("Total Records: " + latestPatchOfClient.Count);
            if (latestPatchOfClient.Count == 0)
            {
                TableCell cellNoRecordFound = new TableCell();
                cellNoRecordFound.ForeColor       = Color.DarkGray;
                cellNoRecordFound.Font.Name       = "Arial";
                cellNoRecordFound.Font.Size       = FontUnit.Parse("9");
                cellNoRecordFound.ColumnSpan      = 13;
                cellNoRecordFound.Text            = "No Record Found.";
                cellNoRecordFound.HorizontalAlign = HorizontalAlign.Left;
                cellNoRecordFound.BackColor       = ColorTranslator.FromHtml("#E0F2F1");
                cellNoRecordFound.ForeColor       = ColorTranslator.FromHtml("#3E2723");
                cellNoRecordFound.Style.Add("font-names", "Arial");
                cellNoRecordFound.Style.Add("padding", "3px");
                rowHeaderNoRecord.Cells.Add(cellNoRecordFound);
                tblInfo.Rows.Add(rowHeaderNoRecord);
            }

            foreach (var item in latestPatchOfClient)
            {
                //Debug.WriteLine("Name:" + item.clientName + " | PatchHotNumber: " + item.patchHotNumber + " | PatchDeployedDate: " + item.patchDeployedDate + "\n");
                TableRow row = new TableRow();

                //Passed By Time Duration Calculation Logic
                Debug.WriteLine(item.patchNumberOfDaysPassed.GetType() + " - " + item.patchNumberOfDaysPassed.Length);
                Debug.WriteLine("=>" + item.patchNumberOfDaysPassed);
                int numberOfDaysPassed = 0;
                if (item.patchNumberOfDaysPassed == "")
                {
                    numberOfDaysPassed     = -1;
                    item.numberOfPatches   = "";
                    item.patchDeployedDate = "";
                    item.clientAppLink     = "";
                }
                else
                {
                    numberOfDaysPassed = Convert.ToInt32(item.patchNumberOfDaysPassed);
                }


                try
                {
                    switch (numberOfDaysPassed)
                    {
                    case 0:
                        row.BackColor = ColorTranslator.FromHtml("#f68787");
                        break;

                    case 1:
                        row.BackColor = ColorTranslator.FromHtml("#f8a978");
                        break;

                    case 2:
                        row.BackColor = ColorTranslator.FromHtml("#f1eb9a");
                        break;

                    case 3:
                        row.BackColor = ColorTranslator.FromHtml("#a4f6a5");
                        break;

                    case 4:
                        row.BackColor = ColorTranslator.FromHtml("#fff");
                        break;

                    case 5:
                        row.BackColor = ColorTranslator.FromHtml("#fff");
                        break;

                    case 6:
                        row.BackColor = ColorTranslator.FromHtml("#ffffff");
                        break;

                    case 7:
                        row.BackColor = ColorTranslator.FromHtml("#ffb6b9");
                        break;

                    case 8:
                        row.BackColor = ColorTranslator.FromHtml("#fff");
                        break;

                    case 9:
                        row.BackColor = ColorTranslator.FromHtml("#fff");
                        break;

                    case 10:
                        row.BackColor = ColorTranslator.FromHtml("#087");
                        break;
                    }


                    TableCell cellClientName = new TableCell();
                    cellClientName.ForeColor       = Color.DarkGray;
                    cellClientName.Font.Name       = "Arial";
                    cellClientName.Font.Size       = FontUnit.Parse("9");
                    cellClientName.Text            = item.clientName;
                    cellClientName.HorizontalAlign = HorizontalAlign.Left;
                    cellClientName.BackColor       = ColorTranslator.FromHtml("#E0F2F1");
                    cellClientName.ForeColor       = ColorTranslator.FromHtml("#3E2723");
                    cellClientName.Style.Add("font-names", "Arial");
                    cellClientName.Style.Add("padding", "3px");
                    //cellClientName.BorderColor = ColorTranslator.FromHtml("#000");
                    cellClientName.Font.Bold = false;
                    row.Cells.Add(cellClientName);
                    TableCell cellClientType = new TableCell();
                    cellClientType.ForeColor = ColorTranslator.FromHtml("#3E2723");
                    cellClientType.Font.Name = "Arial";
                    cellClientType.Font.Size = FontUnit.Parse("9");
                    cellClientType.Style.Add("padding", "3px");
                    cellClientType.Text            = item.clientType;
                    cellClientType.HorizontalAlign = HorizontalAlign.Right;
                    row.Cells.Add(cellClientType);

                    TableCell cellClientProduct = new TableCell();
                    cellClientProduct.ForeColor = ColorTranslator.FromHtml("#3E2723");
                    cellClientProduct.Font.Name = "Arial";
                    cellClientProduct.Font.Size = FontUnit.Parse("9");
                    cellClientProduct.Style.Add("padding", "3px");
                    cellClientProduct.Text            = item.patchProductID.Replace('_', ' ');
                    cellClientProduct.HorizontalAlign = HorizontalAlign.Right;
                    row.Cells.Add(cellClientProduct);

                    TableCell cellClientEnvType = new TableCell();
                    cellClientEnvType.ForeColor = ColorTranslator.FromHtml("#3E2723");
                    cellClientEnvType.Font.Name = "Arial";
                    cellClientEnvType.Font.Size = FontUnit.Parse("9");
                    cellClientEnvType.Style.Add("padding", "3px");
                    cellClientEnvType.Text            = item.clientEnvType;
                    cellClientEnvType.HorizontalAlign = HorizontalAlign.Right;
                    row.Cells.Add(cellClientEnvType);
                    TableCell cellClientPOC = new TableCell();
                    cellClientPOC.ForeColor = ColorTranslator.FromHtml("#3E2723");
                    cellClientPOC.Font.Name = "Arial";
                    cellClientPOC.Font.Size = FontUnit.Parse("9");
                    cellClientPOC.Style.Add("padding", "3px");
                    cellClientPOC.Text            = item.clientPOCName;
                    cellClientPOC.HorizontalAlign = HorizontalAlign.Right;
                    row.Cells.Add(cellClientPOC);
                    TableCell cellClientPOCName = new TableCell();
                    cellClientPOCName.ForeColor = ColorTranslator.FromHtml("#3E2723");
                    cellClientPOCName.Font.Name = "Arial";
                    cellClientPOCName.Font.Size = FontUnit.Parse("9");
                    cellClientPOCName.Style.Add("padding", "3px");
                    cellClientPOCName.Text            = item.numberOfPatches;
                    cellClientPOCName.HorizontalAlign = HorizontalAlign.Right;
                    row.Cells.Add(cellClientPOCName);
                    TableCell cellPatchHotNumber = new TableCell();
                    cellPatchHotNumber.ForeColor = ColorTranslator.FromHtml("#3E2723");
                    cellPatchHotNumber.Font.Name = "Arial";
                    cellPatchHotNumber.Font.Size = FontUnit.Parse("9");
                    cellPatchHotNumber.Style.Add("padding", "3px");
                    cellPatchHotNumber.Text            = item.patchHotNumber;
                    cellPatchHotNumber.HorizontalAlign = HorizontalAlign.Right;
                    row.Cells.Add(cellPatchHotNumber);

                    TableCell cellPatchQATested = new TableCell();
                    cellPatchQATested.ForeColor = ColorTranslator.FromHtml("#3E2723");
                    cellPatchQATested.Font.Name = "Arial";
                    cellPatchQATested.Font.Size = FontUnit.Parse("9");
                    cellPatchQATested.Style.Add("padding", "3px");
                    cellPatchQATested.Text            = item.patchQATested == "True" ? "Tested" : "Not Tested";
                    cellPatchQATested.HorizontalAlign = HorizontalAlign.Right;
                    row.Cells.Add(cellPatchQATested);
                    TableCell cellPatchDeployedDate = new TableCell();
                    cellPatchDeployedDate.ForeColor = ColorTranslator.FromHtml("#3E2723");
                    cellPatchDeployedDate.Font.Name = "Arial";
                    cellPatchDeployedDate.Font.Size = FontUnit.Parse("9");
                    cellPatchDeployedDate.Style.Add("padding", "3px");
                    //int spaceInDate = item.patchDeployedDate.IndexOf(' ');
                    //cellPatchDeployedDate.Text = item.patchDeployedDate.Substring(0, spaceInDate);
                    //Debug.WriteLine("Deployed Date: " + item.patchDeployedDate);
                    if (item.patchDeployedDate.ToString() != String.Empty)
                    {
                        //int a = item.patchDeployedDate.IndexOf(' ');
                        //cellPatchDeployedDate.Text = item.patchDeployedDate.Substring(0, a).ToString();
                        cellPatchDeployedDate.Text = item.patchDeployedDate.ToString();
                    }
                    cellPatchDeployedDate.HorizontalAlign = HorizontalAlign.Right;
                    row.Cells.Add(cellPatchDeployedDate);

                    //
                    TableCell cellPatchPassedByTime = new TableCell();
                    cellPatchPassedByTime.ForeColor = ColorTranslator.FromHtml("#3E2723");
                    cellPatchPassedByTime.Font.Name = "Arial";
                    cellPatchPassedByTime.Font.Size = FontUnit.Parse("9");
                    cellPatchPassedByTime.Style.Add("padding", "3px");
                    cellPatchPassedByTime.Text            = numberOfDaysPassed.ToString() == "-1" ? "" : numberOfDaysPassed.ToString() + " days ago.";
                    cellPatchPassedByTime.HorizontalAlign = HorizontalAlign.Right;
                    row.Cells.Add(cellPatchPassedByTime);
                    TableCell cellPatchStatus = new TableCell();
                    cellPatchStatus.ForeColor = ColorTranslator.FromHtml("#3E2723");
                    cellPatchStatus.Font.Name = "Arial";
                    cellPatchStatus.Font.Size = FontUnit.Parse("9");
                    cellPatchStatus.Style.Add("padding", "3px");
                    cellPatchStatus.Text            = item.patchStatus;
                    cellPatchStatus.HorizontalAlign = HorizontalAlign.Right;
                    row.Cells.Add(cellPatchStatus);
                    //
                    //TableCell cellPatchFileServer = new TableCell();
                    //cellPatchFileServer.ForeColor = Color.Black;
                    //cellPatchFileServer.Text = "";
                    //cellPatchFileServer.HorizontalAlign = HorizontalAlign.Right;
                    //row.Cells.Add(cellPatchFileServer);
                    //
                    //TableCell cellPatchIP = new TableCell();
                    //cellPatchIP.ForeColor = Color.Black;
                    //cellPatchIP.Text = "";
                    //cellPatchIP.HorizontalAlign = HorizontalAlign.Right;
                    //row.Cells.Add(cellPatchIP);
                    //
                    //
                    //TableCell cellPatchDependency = new TableCell();
                    //cellPatchDependency.ForeColor = Color.Black;
                    //cellPatchDependency.Text = "";
                    //cellPatchDependency.HorizontalAlign = HorizontalAlign.Right;
                    //row.Cells.Add(cellPatchDependency);
                    //
                    TableCell cellAppLink = new TableCell();
                    cellAppLink.ForeColor = ColorTranslator.FromHtml("#3E2723");
                    cellAppLink.Font.Name = "Arial";
                    cellAppLink.Font.Size = FontUnit.Parse("9");
                    if (item.clientAppLink.ToString() != String.Empty)
                    {
                        cellAppLink.Text = "<a target=\"_blank\" href=\"" + item.clientAppLink + "\" >" + "LINK" + "</a>";
                    }
                    cellAppLink.HorizontalAlign = HorizontalAlign.Center;
                    row.Cells.Add(cellAppLink);

                    TableCell cellAppWorkingDirectory = new TableCell();
                    cellAppWorkingDirectory.ForeColor = ColorTranslator.FromHtml("#3E2723");
                    cellAppWorkingDirectory.Font.Name = "Arial";
                    cellAppWorkingDirectory.Font.Size = FontUnit.Parse("9");
                    if (item.clientAppLink.ToString() != String.Empty)
                    {
                        try
                        {
                            string wd = "file:" + item.patchWorkingDirectory + "\\Web.config";
                            //Debug.WriteLine("Working Directory: " + wd);
                            //cellAppWorkingDirectory.Text = "<button  id=\"FancyBtn\" type=\"button\" runat=\"server\" onclick=\"myDir_Click()\" value=\"View\" >" + "LINK" + "</button";
                            cellAppWorkingDirectory.Text = "<a target=\"_blank\" href=\"" + wd + "\" download>" + "LINK" + "</a>";
                        }
                        catch (Exception) { }
                    }
                    cellAppWorkingDirectory.HorizontalAlign = HorizontalAlign.Center;
                    row.Cells.Add(cellAppWorkingDirectory);


                    //
                    tblInfo.Rows.Add(row);
                }
                catch (Exception ex)
                {
                    Debug.WriteLine("Exception: " + ex.Message);
                }
            }

            //End
        }
        protected void btnSave_Click(object sender, EventArgs e)
        {
            Debug.WriteLine("Index!");
            TextBox txtenvID       = DetailsView1.FindControl("txtEnvironmentID") as TextBox;
            TextBox txtClientName  = DetailsView1.FindControl("txtClientName") as TextBox;
            TextBox txtProductName = DetailsView1.FindControl("txtProductName") as TextBox;
            TextBox txtEnvironmentAppServerEnvType = DetailsView1.FindControl("txtEnvironmentAppServerEnvType") as TextBox;
            TextBox txtDBServerEnvType             = DetailsView1.FindControl("txtDBServerEnvType") as TextBox;
            TextBox txtAppServerName                     = DetailsView1.FindControl("txtAppServerName") as TextBox;
            TextBox txtAppServerOS                       = DetailsView1.FindControl("txtAppServerOS") as TextBox;
            TextBox txtAppServerOSBuild                  = DetailsView1.FindControl("txtAppServerOSBuild") as TextBox;
            TextBox txtAppServerIsX86Version             = DetailsView1.FindControl("txtAppServerIsX86Version") as TextBox;
            TextBox txtAppServerIsVirtual                = DetailsView1.FindControl("txtAppServerIsVirtual") as TextBox;
            TextBox txtAppServerProcessor                = DetailsView1.FindControl("txtAppServerProcessor") as TextBox;
            TextBox txtAppServerMemory                   = DetailsView1.FindControl("txtAppServerMemory") as TextBox;
            TextBox txtAppServerWebBrowser               = DetailsView1.FindControl("txtAppServerWebBrowser") as TextBox;
            TextBox txtAppServerWebBrowserVersion        = DetailsView1.FindControl("txtAppServerWebBrowserVersion") as TextBox;
            TextBox txtAppServerWorkingDirectoryLocation = DetailsView1.FindControl("txtAppServerWorkingDirectoryLocation") as TextBox;
            TextBox txtAppHyperLink                      = DetailsView1.FindControl("txtAppHyperLink") as TextBox;
            TextBox txtAppServerIP                       = DetailsView1.FindControl("txtAppServerIP") as TextBox;
            TextBox txtAppServerPort                     = DetailsView1.FindControl("txtAppServerPort") as TextBox;
            TextBox txtAppServerDependency               = DetailsView1.FindControl("txtAppServerDependency") as TextBox;
            TextBox txtDBServerName                      = DetailsView1.FindControl("txtDBServerName") as TextBox;
            TextBox txtDBServerIsX86Version              = DetailsView1.FindControl("txtDBServerIsX86Version") as TextBox;
            TextBox txtDBServerIsVirtual                 = DetailsView1.FindControl("txtDBServerIsVirtual") as TextBox;
            TextBox txtDBServerMemory                    = DetailsView1.FindControl("txtDBServerMemory") as TextBox;
            TextBox txtDBServerProcessor                 = DetailsView1.FindControl("txtDBServerProcessor") as TextBox;
            TextBox txtDBServerOS                = DetailsView1.FindControl("txtDBServerOS") as TextBox;
            TextBox txtDBServerOSBuild           = DetailsView1.FindControl("txtDBServerOSBuild") as TextBox;
            TextBox txtDBServerDirectoryLocation = DetailsView1.FindControl("txtDBServerDirectoryLocation") as TextBox;
            TextBox txtDBMDFFileLocation         = DetailsView1.FindControl("txtDBMDFFileLocation") as TextBox;
            TextBox txtDBMDFFileSize             = DetailsView1.FindControl("txtDBMDFFileSize") as TextBox;
            TextBox txtDBLDFFileLocation         = DetailsView1.FindControl("txtDBLDFFileLocation") as TextBox;
            TextBox txtDBLDFFileSize             = DetailsView1.FindControl("txtDBLDFFileSize") as TextBox;
            TextBox txtDBServerIP                = DetailsView1.FindControl("txtDBServerIP") as TextBox;
            TextBox txtDBServerPort              = DetailsView1.FindControl("txtDBServerPort") as TextBox;
            TextBox txtDBServerDependency        = DetailsView1.FindControl("txtDBServerDependency") as TextBox;
            int     EnvID       = Convert.ToInt32(txtenvID.Text.ToString());
            string  ClientName  = txtClientName.Text.ToString();
            int     ClientID    = Convert.ToInt32(2);
            string  ProductName = txtProductName.Text.ToString();
            int     ProductID   = Convert.ToInt32(4);
            string  EnvironmentAppServerEnvType = txtEnvironmentAppServerEnvType.Text.ToString();
            int     AppServerEnvType            = Convert.ToInt32(1);
            string  DBServerEnvType             = txtDBServerEnvType.Text.ToString();
            int     DBServerEnvTypeID           = Convert.ToInt32(1);
            string  AppServerName                     = txtAppServerName.Text.ToString();
            string  AppServerOS                       = txtAppServerOS.Text.ToString();
            Int64   AppServerOSBuild                  = Convert.ToInt64(txtAppServerOSBuild.Text.ToString());
            Boolean AppServerIsX86Version             = Convert.ToBoolean(txtAppServerIsX86Version.Text.ToString());
            Boolean AppServerIsVirtual                = Convert.ToBoolean(txtAppServerIsVirtual.Text.ToString());
            string  AppServerProcessor                = txtAppServerProcessor.Text.ToString();
            int     AppServerMemory                   = Convert.ToInt32(txtAppServerMemory.Text.ToString());
            string  AppServerWebBrowser               = txtAppServerWebBrowser.Text.ToString();
            int     AppServerWebBrowserVersion        = Convert.ToInt32(txtAppServerWebBrowserVersion.Text.ToString());
            string  AppServerWorkingDirectoryLocation = txtAppServerWorkingDirectoryLocation.Text.ToString();
            string  AppHyperLink                      = txtAppHyperLink.Text.ToString();
            string  AppServerIP                       = txtAppServerIP.Text.ToString();
            int     AppServerPort                     = Convert.ToInt32(txtAppServerPort.Text.ToString());
            string  AppServerDependency               = txtAppServerDependency.Text.ToString();
            string  DBServerName                      = txtDBServerName.Text.ToString();
            Boolean DBServerIsX86Version              = Convert.ToBoolean(txtDBServerIsX86Version.Text.ToString());
            Boolean DBServerIsVirtual                 = Convert.ToBoolean(txtDBServerIsVirtual.Text.ToString());
            int     DBServerMemory                    = Convert.ToInt32(txtDBServerMemory.Text.ToString());
            string  DBServerProcessor                 = txtDBServerProcessor.Text.ToString();
            string  DBServerOS                = txtDBServerOS.Text.ToString();
            Int64   DBServerOSBuild           = Convert.ToInt64(txtDBServerOSBuild.Text.ToString());
            string  DBServerDirectoryLocation = txtDBServerDirectoryLocation.Text.ToString();
            string  DBMDFFileLocation         = txtDBMDFFileLocation.Text.ToString();
            Int64   DBMDFFileSize             = Convert.ToInt64(txtDBMDFFileSize.Text.ToString());
            string  DBLDFFileLocation         = txtDBLDFFileLocation.Text.ToString();
            Int64   DBLDFFileSize             = Convert.ToInt64(txtDBLDFFileSize.Text.ToString());
            string  DBServerIP                = txtDBServerIP.Text.ToString();
            int     DBServerPort              = Convert.ToInt32(txtDBServerPort.Text.ToString());
            string  DBServerDependency        = txtDBServerDependency.Text.ToString();

            Debug.WriteLine("");
            Debug.WriteLine("Data From Detail View:");
            Debug.WriteLine("Environment ID: " + EnvID);
            Debug.WriteLine("ClientName: " + ClientName);
            Debug.WriteLine("Product Name: " + ProductName);
            Debug.WriteLine("App Server Env Type: " + EnvironmentAppServerEnvType);
            Debug.WriteLine("DB Server Env Type: " + DBServerEnvType);
            Debug.WriteLine("App Server Name: " + AppServerName);
            Debug.WriteLine("App Server OS: " + AppServerOS);
            Debug.WriteLine("App Server OS Build: " + AppServerOSBuild);
            DatabaseConnectivity dbcon = new DatabaseConnectivity();
            int ResultQuery            = dbcon.setAnEnvironment(EnvID, ClientID, ProductID, AppServerEnvType, DBServerEnvTypeID, AppServerName, AppServerOS, AppServerOSBuild, AppServerIsX86Version, AppServerIsVirtual, AppServerProcessor, AppServerMemory, AppServerWebBrowser, AppServerWebBrowserVersion, AppServerWorkingDirectoryLocation, AppHyperLink, AppServerIP, AppServerPort, AppServerDependency, DBServerName, DBServerIsX86Version, DBServerIsVirtual, DBServerMemory, DBServerProcessor, DBServerOS, DBServerOSBuild, DBServerDirectoryLocation, DBMDFFileLocation, DBMDFFileSize, DBLDFFileLocation, DBLDFFileSize, DBServerIP, DBServerPort, DBServerDependency);

            //Console.WriteLine("<script>alert(" + ResultQuery + "record has been updated." + ")</script>");
            //ClientScript.RegisterStartupScript(this.GetType(), DateTime.Now.ToString(), "<script>alert(" + ResultQuery + "record has been updated." + ")</script>", true);
            //ScriptManager.RegisterStartupScript(this, this.GetType(), DateTime.Now.ToString(), "<script>alert(" + ResultQuery +")</script>", true);
            DetailsView1.Visible = false;
            //DetailsView1.Style.Add("display", "none");
            _BindService();
        }
Exemple #27
0
        protected void Page_Load(object sender, EventArgs e)
        {
            //Debug.WriteLine("Product: " + DropDownList1.Text);
            //Console.WriteLine("GGG");

            DatabaseConnectivity dbcon = new DatabaseConnectivity();

            //PAMS for Parameter 1
            //Test Env For Parameter 2
            Debug.WriteLine("Product: " + DropDownList1.Text);
            int          product             = Convert.ToInt32(DropDownList1.Text);
            List <Patch> latestPatchOfClient = dbcon.getAllUpdatedClientPatches(product == 0 ? 1 : product, 3);

            //Debug.WriteLine("Records Count: " + latestPatchOfClient.Count);
            foreach (var item in latestPatchOfClient)
            {
                //Debug.WriteLine("Name:" + item.clientName + " | PatchHotNumber: " + item.patchHotNumber + " | PatchDeployedDate: " + item.patchDeployedDate + "\n");
                TableRow row = new TableRow();

                //Passed By Time Duration Calculation Logic
                //Debug.WriteLine("=>" + item.patchNumberOfDaysPassed);

                int numberOfDaysPassed = Convert.ToInt32(item.patchNumberOfDaysPassed == "" ? -1 : Convert.ToInt32(item.patchNumberOfDaysPassed));
                switch (numberOfDaysPassed)
                {
                case 0:
                    row.BackColor = ColorTranslator.FromHtml("#f68787");
                    break;

                case 1:
                    row.BackColor = ColorTranslator.FromHtml("#f8a978");
                    break;

                case 2:
                    row.BackColor = ColorTranslator.FromHtml("#f1eb9a");
                    break;

                case 3:
                    row.BackColor = ColorTranslator.FromHtml("#a4f6a5");
                    break;

                case 4:
                    row.BackColor = ColorTranslator.FromHtml("#fff");
                    break;

                case 5:
                    row.BackColor = ColorTranslator.FromHtml("#fff");
                    break;

                case 6:
                    row.BackColor = ColorTranslator.FromHtml("#ffffff");
                    break;

                case 7:
                    row.BackColor = ColorTranslator.FromHtml("#ffb6b9");
                    break;

                case 8:
                    row.BackColor = ColorTranslator.FromHtml("#fff");
                    break;

                case 9:
                    row.BackColor = ColorTranslator.FromHtml("#fff");
                    break;

                case 10:
                    row.BackColor = ColorTranslator.FromHtml("#087");
                    break;
                }

                TableCell cellClientName = new TableCell();
                cellClientName.Font.Size       = FontUnit.Smaller;
                cellClientName.ForeColor       = Color.Black;
                cellClientName.Text            = item.clientName;
                cellClientName.HorizontalAlign = HorizontalAlign.Right;
                row.Cells.Add(cellClientName);
                TableCell cellClientType = new TableCell();
                cellClientType.Font.Size       = FontUnit.Smaller;
                cellClientType.ForeColor       = Color.Black;
                cellClientType.Text            = item.clientType;
                cellClientType.HorizontalAlign = HorizontalAlign.Right;
                row.Cells.Add(cellClientType);
                TableCell cellClientEnvType = new TableCell();
                cellClientEnvType.Font.Size       = FontUnit.Smaller;
                cellClientEnvType.ForeColor       = Color.Black;
                cellClientEnvType.Text            = item.clientEnvType;
                cellClientEnvType.HorizontalAlign = HorizontalAlign.Right;
                row.Cells.Add(cellClientEnvType);
                TableCell cellClientPOC = new TableCell();
                cellClientPOC.Font.Size       = FontUnit.Smaller;
                cellClientPOC.ForeColor       = Color.Black;
                cellClientPOC.Text            = item.clientPOCName;
                cellClientPOC.HorizontalAlign = HorizontalAlign.Right;
                row.Cells.Add(cellClientPOC);
                TableCell cellClientPOCName = new TableCell();
                cellClientPOCName.Font.Size       = FontUnit.Smaller;
                cellClientPOCName.ForeColor       = Color.Black;
                cellClientPOCName.Text            = item.numberOfPatches;
                cellClientPOCName.HorizontalAlign = HorizontalAlign.Right;
                row.Cells.Add(cellClientPOCName);
                TableCell cellPatchHotNumber = new TableCell();
                cellPatchHotNumber.Font.Size       = FontUnit.Smaller;
                cellPatchHotNumber.ForeColor       = Color.Black;
                cellPatchHotNumber.Text            = item.patchHotNumber;
                cellPatchHotNumber.HorizontalAlign = HorizontalAlign.Right;
                row.Cells.Add(cellPatchHotNumber);
                TableCell cellAppLink = new TableCell();
                cellAppLink.Font.Size       = FontUnit.Smaller;
                cellAppLink.ForeColor       = Color.Black;
                cellAppLink.Text            = "<a target=\"_blank\" href=\"" + item.clientAppLink + "\" >" + item.clientAppLink + "</a>";
                cellAppLink.HorizontalAlign = HorizontalAlign.Right;
                row.Cells.Add(cellAppLink);
                TableCell cellPatchQATested = new TableCell();
                cellPatchQATested.Font.Size       = FontUnit.Smaller;
                cellPatchQATested.ForeColor       = Color.Black;
                cellPatchQATested.Text            = item.patchQATested == "1" ? "Tested" : "Not Tested";
                cellPatchQATested.HorizontalAlign = HorizontalAlign.Right;
                row.Cells.Add(cellPatchQATested);
                TableCell cellPatchDeployedDate = new TableCell();
                cellPatchDeployedDate.Font.Size = FontUnit.Smaller;
                cellPatchDeployedDate.ForeColor = Color.Black;
                //int spaceInDate = item.patchDeployedDate.IndexOf(' ');
                //cellPatchDeployedDate.Text = item.patchDeployedDate.Substring(0, spaceInDate);
                cellPatchDeployedDate.Text            = item.patchDeployedDate.ToString();
                cellPatchDeployedDate.HorizontalAlign = HorizontalAlign.Right;
                row.Cells.Add(cellPatchDeployedDate);

                //
                TableCell cellPatchPassedByTime = new TableCell();
                cellPatchPassedByTime.Font.Size       = FontUnit.Smaller;
                cellPatchPassedByTime.ForeColor       = Color.Black;
                cellPatchPassedByTime.Text            = numberOfDaysPassed + " Days Ago.";
                cellPatchPassedByTime.HorizontalAlign = HorizontalAlign.Right;
                row.Cells.Add(cellPatchPassedByTime);
                TableCell cellPatchStatus = new TableCell();
                cellPatchStatus.Font.Size       = FontUnit.Smaller;
                cellPatchStatus.ForeColor       = Color.Black;
                cellPatchStatus.Text            = item.patchStatus;
                cellPatchStatus.HorizontalAlign = HorizontalAlign.Right;
                row.Cells.Add(cellPatchStatus);
                //
                //TableCell cellPatchFileServer = new TableCell();
                //cellPatchFileServer.ForeColor = Color.Black;
                //cellPatchFileServer.Text = "";
                //cellPatchFileServer.HorizontalAlign = HorizontalAlign.Right;
                //row.Cells.Add(cellPatchFileServer);
                //
                //TableCell cellPatchIP = new TableCell();
                //cellPatchIP.ForeColor = Color.Black;
                //cellPatchIP.Text = "";
                //cellPatchIP.HorizontalAlign = HorizontalAlign.Right;
                //row.Cells.Add(cellPatchIP);
                //
                //
                //TableCell cellPatchDependency = new TableCell();
                //cellPatchDependency.ForeColor = Color.Black;
                //cellPatchDependency.Text = "";
                //cellPatchDependency.HorizontalAlign = HorizontalAlign.Right;
                //row.Cells.Add(cellPatchDependency);
                //


                //
                tblInfo.ControlStyle.Height = Unit.Pixel(28);
                tblInfo.Rows.Add(row);
            }
        }
        private async void ViewNotificationsB_Click(object sender, RoutedEventArgs e)
        {
            ClearAllNotificationB.Visibility = Visibility.Collapsed;
            NotificationsSP.Children.Clear();
            NotificationsSP.Children.Add(NotificationsLoaderCL);
            TranslateTransform tt = new TranslateTransform();

            tt.X = 0;
            tt.Y = 0;
            NotificationsSP.RenderTransform  = tt;
            NotificationsLoaderCL.Visibility = Visibility.Visible;
            NotificationsG.Visibility        = Visibility.Visible;
            NotificationsLoaderCL.Start();
            int count = 0;
            List <NotificationItem> notificationItems = new List <NotificationItem>();

            try
            {
                await Task.Run(new Action(() =>
                {
                    try
                    {
                        DatabaseConnectivity dc = new DatabaseConnectivity();
                        dc.Connect();
                        MySqlCommand command = new MySqlCommand();
                        this.Dispatcher.Invoke(() =>
                        {
                            command.Parameters.AddWithValue("@id", UserIdLB.Content);
                        });
                        dc.ExecuteReader(command, "SELECT * FROM notifications WHERE AccountId=@id");
                        MySqlDataReader reader = command.ExecuteReader();
                        while (reader.Read())
                        {
                            count++;
                            this.Dispatcher.Invoke(() =>
                            {
                                NotificationItem ni = new NotificationItem();
                                ni.Padding = new Thickness(10);
                                ni.Background = new SolidColorBrush((Color)ColorConverter.ConvertFromString("#FFF9F9F9"));
                                ni.Notification = reader["Message"].ToString();
                                ni.NotificationDate = Convert.ToDateTime(reader["Date"]);
                                ni.NotificationId = Convert.ToInt32(reader["NotificationId"]);
                                notificationItems.Add(ni);
                            });
                            DatabaseConnectivity dc1 = new DatabaseConnectivity();
                            dc1.Connect();
                            this.Dispatcher.Invoke(() =>
                            {
                                dc1.ExecuteNonQuery("UPDATE notifications Set IsRead=1 WHERE AccountId=" + UserIdLB.Content);
                            });
                            dc1.Unconnect();
                        }
                    }
                    catch (Exception)
                    {
                        this.Dispatcher.Invoke(() =>
                        {
                            ShowMessage("Check your internet connection and try again", MessageType.Error);
                        });
                        count = -1;
                    }
                }));
            }
            catch
            {
                NotificationsLoaderCL.Visibility = Visibility.Collapsed;
                NotificationsLoaderCL.Stop();
                ClearAllNotificationB.Visibility = Visibility.Visible;
                NotificationsG.Visibility        = Visibility.Collapsed;
                ShowMessage("Check your internet connection and try again", MessageType.Error);
            }
            if (!count.Equals(-1))
            {
                if (count.Equals(0))
                {
                    TextBlock tb = new TextBlock();
                    tb.Padding             = new Thickness(25);
                    tb.FontSize            = 15;
                    tb.Text                = "No Notification...";
                    tb.VerticalAlignment   = VerticalAlignment.Center;
                    tb.HorizontalAlignment = HorizontalAlignment.Center;
                    tb.FontFamily          = new FontFamily(new Uri(@"pack:\\,,,\Resources\Fonts\Nunito-SemiBold.ttf"), "Nunito SemiBold");
                    NotificationsSP.Children.Add(tb);
                    ClearAllNotificationB.Visibility = Visibility.Collapsed;
                }
                foreach (NotificationItem ni in notificationItems)
                {
                    NotificationsSP.Children.Insert(0, ni);
                }
                //for (int i = 0; i < CurrentNotificationsCount; i++)
                //{
                //    ControlTemplate template = notificationItems[i].Template;
                //    Border border = (Border)template.FindName("border", notificationItems[i]);
                //    border.Background = new SolidColorBrush((Color)ColorConverter.ConvertFromString("#FFE0EBFF")); ;
                //}
                NotificationsLoaderCL.Visibility = Visibility.Collapsed;
                NotificationsLoaderCL.Stop();
                if (!count.Equals(0))
                {
                    ClearAllNotificationB.Visibility = Visibility.Visible;
                }
            }
            else
            {
                NotificationsLoaderCL.Visibility = Visibility.Collapsed;
                NotificationsLoaderCL.Stop();
                NotificationsG.Visibility = Visibility.Collapsed;
            }
        }
        private async void CheckNotificationsCount()
        {
            if (!IsInternetAvailable())
            {
                ShowMessage("Check your internet connection and try again", MessageType.Error);
            }
            try
            {
                while (true)
                {
                    int count = 0;
                    await Task.Delay(200);

                    DatabaseConnectivity dc = new DatabaseConnectivity();
                    try
                    {
                        await Task.Run(() =>
                        {
                            if (dc.Connect())
                            {
                                MySqlCommand command = new MySqlCommand();
                                this.Dispatcher.Invoke(() =>
                                {
                                    command.Parameters.AddWithValue("@id", UserIdLB.Content);
                                });
                                dc.ExecuteReader(command, "SELECT * FROM notifications WHERE AccountId=@id and IsRead=0");
                                MySqlDataReader reader = command.ExecuteReader();
                                while (reader.Read())
                                {
                                    count++;
                                }
                                var template = ViewNotificationsB.Template;
                                TextBlock notificationCount = (TextBlock)template.FindName("NotificationCountTBl", ViewNotificationsB);
                                Border notificationBorder   = (Border)template.FindName("NotificationBorder", ViewNotificationsB);
                                if (count > 0)
                                {
                                    this.Dispatcher.Invoke(() =>
                                    {
                                        notificationBorder.Visibility = Visibility.Visible;
                                        notificationCount.Text        = count.ToString();
                                    });
                                }
                                else
                                {
                                    this.Dispatcher.Invoke(() =>
                                    {
                                        if (notificationBorder.Visibility == Visibility.Visible)
                                        {
                                            notificationBorder.Visibility = Visibility.Collapsed;
                                        }
                                    });
                                }
                                dc.Unconnect();
                            }
                            else
                            {
                            }
                        });
                    }
                    catch
                    {
                    }
                    CurrentNotificationsCount = count;
                }
            }
            catch
            {
                ShowMessage("Check your internet connection and try again", MessageType.Error);
            }
        }
        protected void btnSave_Click(object sender, EventArgs e)
        {
            int    ClientID                          = Convert.ToInt32(dropClientName.SelectedValue);
            int    ProductID                         = Convert.ToInt32(dropProductName.SelectedValue);
            int    AppEnvType                        = Convert.ToInt32(dropAppEnvType.SelectedValue);
            int    DBEnvType                         = Convert.ToInt32(dropDBEnvType.SelectedValue);
            string AppServerName                     = txtAppServerName.Text.ToString();
            string DBServerName                      = txtDBServerName.Text.ToString();
            string AppServerOS                       = txtAppServerOS.Text.ToString();
            string DBServerOS                        = txtDBServerOS.Text.ToString();
            double AppServerOSBuild                  = Convert.ToDouble(dropAppServerOSBuild.SelectedValue);
            double DBServerOSBuild                   = Convert.ToDouble(dropDBServerOSBuild.SelectedValue);
            string AppServerProcessor                = txtAppServerProcessor.Text.ToString();
            string DBServerProcessor                 = txtDBServerProcessor.Text.ToString();
            double AppServerMemory                   = Convert.ToDouble(dropAppServerMemory.SelectedValue);
            double DBServerMemory                    = Convert.ToDouble(dropDBServerMemory.SelectedValue);
            int    AppServerIsX86Version             = Convert.ToInt32(radAppServerIsX86.SelectedValue);
            int    DBServerIsX86Version              = Convert.ToInt32(radDBServerIsx86.SelectedValue);
            int    AppServerIsVirtual                = Convert.ToInt32(radAppServerIsVirtual.SelectedValue);
            int    DBServerIsVirtual                 = Convert.ToInt32(radDBServerIsVirtual.SelectedValue);
            string AppServerIP                       = txtAppServerIP.Text.ToString();
            string DBServerIP                        = txtDBServerIP.Text.ToString();
            double AppServerPort                     = Convert.ToInt32(txtAppServerPort.Text);
            double DBServerPort                      = Convert.ToInt32(txtDBServerPort.Text);
            string AppServerDependency               = txtAppServerDependency.Text.ToString();
            string DBServerDependency                = txtDBServerDependency.Text.ToString();
            string AppHyperLink                      = txtAppHyperLink.Text.ToString();
            string AppServerWebServer                = dropAppServerWebBrowser.SelectedValue.ToString();
            string AppServerWebServerVersion         = txtAppServerWebBrowserVersion.Text.ToString();
            string AppServerWorkingDirectoryLocation = txtAppServerWorkingDirectoryLocation.Text.ToString();
            string DBServerDirectoryLocation         = txtDBServerDirectoryLocation.Text.ToString();
            string DBMDFFileLocation                 = txtDBMDFFileLocation.Text.ToString();
            double DBMDFFileSize                     = Convert.ToDouble(txtDBMDFFileSize.Text);
            string DBLDFFileLocation                 = txtDBLDFFileLocation.Text.ToString();
            double DBLDFFileSize                     = Convert.ToDouble(txtDBLDFFileSize.Text);

            Debug.WriteLine("Environment Data Start: ");
            Debug.WriteLine("Client ID: " + ClientID);
            Debug.WriteLine("Product ID: " + ProductID);
            Debug.WriteLine("App Environment Type: " + AppEnvType);
            Debug.WriteLine("Database Environment Type: " + DBEnvType);
            Debug.WriteLine("App Server Name: " + AppServerName);
            Debug.WriteLine("Database Server Name: " + DBServerName);
            Debug.WriteLine("App Server OS: " + AppServerOS);
            Debug.WriteLine("Database Server OS: " + DBServerOS);
            Debug.WriteLine("App Server OS Build: " + AppServerOSBuild);
            Debug.WriteLine("DB Server OS Build: " + DBServerOSBuild);
            Debug.WriteLine("App Server Processor: " + AppServerProcessor);
            Debug.WriteLine("Database Server Processor: " + DBServerProcessor);
            Debug.WriteLine("App Server Memory: " + AppServerMemory);
            Debug.WriteLine("Database Server Memory: " + DBServerMemory);
            Debug.WriteLine("App Server IP: " + AppServerIP);
            Debug.WriteLine("Database Server IP: " + DBServerIP);
            Debug.WriteLine("App Server Port: " + AppServerPort);
            Debug.WriteLine("Database Server Port: " + DBServerPort);
            Debug.WriteLine("App Server Dependency: " + AppServerDependency);
            Debug.WriteLine("Database Server Dependency: " + DBServerDependency);
            Debug.WriteLine("App Server Web Server: " + AppServerWebServer);
            Debug.WriteLine("App Server Web Server Version: " + AppServerWebServerVersion);
            Debug.WriteLine("App Server Working Directory Location: " + AppServerWorkingDirectoryLocation);
            Debug.WriteLine("Database Server Directory Location: " + DBServerDirectoryLocation);
            Debug.WriteLine("Database MDF File Location: " + DBMDFFileLocation);
            Debug.WriteLine("Database MDF File Size: " + DBMDFFileSize);
            Debug.WriteLine("Database LDF File Location: " + DBLDFFileLocation);
            Debug.WriteLine("Database LDF File Size: " + DBLDFFileSize);
            Debug.WriteLine("Environment Data End.");

            DatabaseConnectivity dbcon = new DatabaseConnectivity();
            // insertEnvironment(ClientID,ProductID, AppEnvType, DBEnvType, AppServerName, AppServerOS, AppServerOSBuild, AppServerIsX86Version, AppServerIsVirtual, AppServerProcessor, int AppServerMemory, string AppServerWebBrowser, string AppServerWebBrowserVersion, striAppServerWorkingDirectoryLocation, string AppHyperLink, string AppServerIP, int AppServerPort, string AppServerDependency, string DBServerName, string DBServerOS, double DBerverOSBuild, int DBServerIsX86Version, int DBServerIsVirtual, string DBServerProcessor, int DBServerMemory, string DBServerWorkingDirectoryLocation, string DBMDFFileLocation, double DBMDFFileSize, string DBLDFFileLocation, double DBLDFFileSize, string DBServerIP, int DBServerPort, string DBServerDependency)
            int queryResult = dbcon.insertEnvironment(ClientID, ProductID, AppEnvType, DBEnvType, AppServerName, AppServerOS, AppServerOSBuild, AppServerIsX86Version, AppServerIsVirtual, AppServerProcessor, AppServerMemory, AppServerWebServer, AppServerWebServerVersion, AppServerWorkingDirectoryLocation, AppHyperLink, AppServerIP, AppServerPort, AppServerDependency, DBServerName, DBServerOS, DBServerOSBuild, DBServerIsX86Version, DBServerIsVirtual, DBServerProcessor, DBServerMemory, DBServerDirectoryLocation, DBMDFFileLocation, DBMDFFileSize, DBLDFFileLocation, DBLDFFileSize, DBServerIP, DBServerPort, DBServerDependency);

            Debug.WriteLine("Query Result: " + queryResult);



            if (queryResult == 1)
            {
                rowAppEnvType.Visible                        = false;
                rowAppHyperLink.Visible                      = false;
                rowAppServerDependency.Visible               = false;
                rowAppServerIP.Visible                       = false;
                rowAppServerIsVirtual.Visible                = false;
                rowAppServerIsX86.Visible                    = false;
                rowAppServerMemory.Visible                   = false;
                rowAppServerName.Visible                     = false;
                rowAppServerOS.Visible                       = false;
                rowAppServerOSBuild.Visible                  = false;
                rowAppServerPort.Visible                     = false;
                rowAppServerProcessor.Visible                = false;
                rowAppServerWebBrowser.Visible               = false;
                rowAppServerWebBrowserVersion.Visible        = false;
                rowAppServerWorkingDirectoryLocation.Visible = false;
                rowClientName.Visible                        = false;
                rowDBEnvType.Visible                 = false;
                rowDBLDFFileLocation.Visible         = false;
                rowDBLDFFileSize.Visible             = false;
                rowDBMDFFileLocation.Visible         = false;
                rowDBMDFFileSize.Visible             = false;
                rowDBServerDependency.Visible        = false;
                rowDBServerDirectoryLocation.Visible = false;
                rowDBServerIP.Visible                = false;
                rowDBServerIsVirtual.Visible         = false;
                rowDBServerIsx86.Visible             = false;
                rowDBServerMemory.Visible            = false;
                rowDBServerName.Visible              = false;
                rowDBServerPort.Visible              = false;
                rowDBServerProcessor.Visible         = false;
                rowIsEnvSameAsDB.Visible             = false;
                rowlblDBServerOS.Visible             = false;
                rowlblDBServerOSBuild.Visible        = false;
                rowProductName.Visible               = false;
                rowSubmit.Visible         = false;
                lblDatabaseHeader.Visible = false;
                lblSubmission.Visible     = true;
            }

            else
            {
                rowAppEnvType.Visible                        = false;
                rowAppHyperLink.Visible                      = false;
                rowAppServerDependency.Visible               = false;
                rowAppServerIP.Visible                       = false;
                rowAppServerIsVirtual.Visible                = false;
                rowAppServerIsX86.Visible                    = false;
                rowAppServerMemory.Visible                   = false;
                rowAppServerName.Visible                     = false;
                rowAppServerOS.Visible                       = false;
                rowAppServerOSBuild.Visible                  = false;
                rowAppServerPort.Visible                     = false;
                rowAppServerProcessor.Visible                = false;
                rowAppServerWebBrowser.Visible               = false;
                rowAppServerWebBrowserVersion.Visible        = false;
                rowAppServerWorkingDirectoryLocation.Visible = false;
                rowClientName.Visible                        = false;
                rowDBEnvType.Visible                 = false;
                rowDBLDFFileLocation.Visible         = false;
                rowDBLDFFileSize.Visible             = false;
                rowDBMDFFileLocation.Visible         = false;
                rowDBMDFFileSize.Visible             = false;
                rowDBServerDependency.Visible        = false;
                rowDBServerDirectoryLocation.Visible = false;
                rowDBServerIP.Visible                = false;
                rowDBServerIsVirtual.Visible         = false;
                rowDBServerIsx86.Visible             = false;
                rowDBServerMemory.Visible            = false;
                rowDBServerName.Visible              = false;
                rowDBServerPort.Visible              = false;
                rowDBServerProcessor.Visible         = false;
                rowIsEnvSameAsDB.Visible             = false;
                rowlblDBServerOS.Visible             = false;
                rowlblDBServerOSBuild.Visible        = false;
                rowProductName.Visible               = false;
                rowSubmit.Visible         = false;
                lblDatabaseHeader.Visible = false;
                lblSubmission.Visible     = true;
                lblSubmission.Text        = "Data Insertion Failed, Please Check Database Connection.";
            }
        }