protected void btnSubmit_Click(object sender, EventArgs e)
        {
            Styles _Style = new Styles();
            _Style.Name = Name.Text;
            _Style.Description = Description.Text;
            _Style.IsDeleted = false;

            lblMessage.Text = Style_DA.InsertStyle(_Style);

            if (lblMessage.Text == Constants.ALREADY_EXIST)
            {
                lblMessage.ForeColor = System.Drawing.Color.Red;
            }
            else
            {
                lblMessage.ForeColor = System.Drawing.Color.Green;

                Response.Write("<script>alert('Inserted Successfully'); document.location='/forms/formStyle';</script>");
            }
        }
        public static string UpdateStyle(Styles _Style)
        {
            DbCommand command = Catalog_Access.CreateCommand();
            command.CommandText = "sp_UpdateStyle";

            DbParameter param;

            param = command.CreateParameter();
            param.ParameterName = "@Id";
            param.Value = _Style.Id;
            param.DbType = DbType.Int32;
            command.Parameters.Add(param);

            param = command.CreateParameter();
            param.ParameterName = "@Name";
            param.Value = _Style.Name;
            param.DbType = DbType.String;
            command.Parameters.Add(param);

            param = command.CreateParameter();
            param.ParameterName = "@Description";
            param.Value = _Style.Description;
            param.DbType = DbType.String;
            command.Parameters.Add(param);

            param = command.CreateParameter();
            param.ParameterName = "@Return";
            param.DbType = DbType.String;
            param.Size = 2;
            param.Direction = ParameterDirection.Output;
            command.Parameters.Add(param);

            Catalog_Access.ExecuteNonQuery(command);

            string Return = command.Parameters["@Return"].Value.ToString();

            return Return;
        }
        public static string InsertStyle(Styles _Style)
        {
            DbCommand command = Catalog_Access.CreateCommand();
            command.CommandText = "sp_insertStyle";

            DbParameter param;

            param = command.CreateParameter();
            param.ParameterName = "@Name";
            param.Value = _Style.Name;
            param.DbType = DbType.String;
            command.Parameters.Add(param);

            param = command.CreateParameter();
            param.ParameterName = "@Description";
            param.Value = _Style.Description;
            param.DbType = DbType.String;
            command.Parameters.Add(param);

            param = command.CreateParameter();
            param.ParameterName = "@IsDeleted";
            param.Value = _Style.IsDeleted;
            param.DbType = DbType.Boolean;
            command.Parameters.Add(param);

            param = command.CreateParameter();
            param.ParameterName = "@Return";
            param.DbType = DbType.String;
            param.Size = 2;
            param.Direction = ParameterDirection.Output;
            command.Parameters.Add(param);

            Catalog_Access.ExecuteNonQuery(command);

            string Return = command.Parameters["@Return"].Value.ToString();

            if (Return == Constants.SP_ALREADY_EXIST)
            {
                return Constants.ALREADY_EXIST;
            }
            else
            {
                return Constants.SUCESS_INSERT;
            }
        }
        public string Update(int Id,string Name, string Description)
        {
            Styles _Style = new Styles();
            _Style.Id = Id;
            _Style.Name = Name;
            _Style.Description = Description;

            return Style_DA.UpdateStyle(_Style);
        }
        public Styles Get_Style_By_Id(int Id)
        {
            Styles _Style = new Styles();

            DataTable dt = Style_DA.Get_Style_By_Id(Id);

            foreach (DataRow row in dt.Rows)
            {
                //int Id = int.Parse(row["Id"].ToString());
                string Name = row["Name"].ToString();
                string Description = row["Description"].ToString();
                bool IsDeleted = Convert.ToBoolean(row["IsDeleted"].ToString());

                _Style.Id = Id;
                _Style.Name = Name;
                _Style.Description = Description;
                _Style.IsDeleted = IsDeleted;

            }
            return _Style;
        }
        private void SendNotification(Styles _Style, DataTable dt)
        {
            string MessageBody = "Edited By : <b>" + Session["User"].ToString().ToUpper() + "</b><br><br>" + DateTime.UtcNow.AddHours(5) + "<br><h3>Before Edit</h3>";
            string tableStart = "<table style=\" width:100%;border-collapse: collapse;\">";//border: 1px solid #ddd;
            string tableEnd = "</table>";
            string MessageHeader = "<tr>";
            string MessageDataOld = "<tr>";
            string MessageDataNew = "<tr>";
            for (int i = 1; i < dt.Columns.Count - 1; i++)
            {
                MessageHeader += "<th align=\"left\" style=\"border-bottom: 1px solid #ddd;border-right: 1px solid #ddd;height: 30px;\">" + dt.Columns[i].ColumnName + "</th>";
                MessageDataOld += "<td  style=\"border-top: 1px solid #ddd;border-bottom: 1px solid #ddd;border-right: 1px solid #ddd;font-family:Courier New;height: 50px;\">" + dt.Rows[0][i] + "</td>";
            }

            MessageDataOld += "</tr>";
            MessageHeader += "</tr>";

            MessageDataNew += "<td  style=\"border-bottom: 1px solid #ddd;border-right: 1px solid #ddd;font-family:Courier New;height: 50px;\">" + _Style.Name + "</td>";
            MessageDataNew += "<td  style=\"border-bottom: 1px solid #ddd;border-right: 1px solid #ddd;font-family:Courier New;height: 50px;\">" + _Style.Description + "</td>";
            MessageDataNew += "</tr>";

            MessageBody += tableStart + MessageDataOld + MessageHeader + MessageDataNew + tableEnd + "<h3>After Edit</h3>";
            sendMail.sendEmailMessage(ConfigurationManager.AppSettings["From"], ConfigurationManager.AppSettings["To"], ConfigurationManager.AppSettings["Password"], "Style Edit", MessageBody);
        }
        public string Update(int Id, string Name, string Description)
        {
            Styles _Style = new Styles();
            _Style.Id = Id;
            _Style.Name = Name;
            _Style.Description = Description;

            DataTable dt = Style_DA.Get_Style_By_Id(_Style.Id);
            string message = Style_DA.UpdateStyle(_Style);

            if (message != "1" && Session["User"].ToString().ToUpper() != ("Mustafa Piracha").ToUpper())
            {
                SendNotification(_Style, dt);
            }
            return message;
        }