Ejemplo n.º 1
0
        protected void btnSave_Click(object sender, EventArgs e)
        {
            if (Session["ShoppingCart"] != null && String.IsNullOrWhiteSpace(Convert.ToString(Session["ShoppingCart"])))
            {
                string saveListName = txtListNm.Text;
                string userID       = String.Empty;

                if (Session["UserID"] != null && String.IsNullOrWhiteSpace(Convert.ToString(Session["UserID"])))
                {
                    userID = Convert.ToString(Session["UserID"]);

                    //Check if the savelist name is already used or not.
                    bool isUnique = objBAL.CheckSaveListName(saveListName, userID);

                    if (isUnique)
                    {
                        string saveListID = objBAL.CreateSaveList(saveListName, userID);
                    }
                    else
                    {
                        lblMsg.Text = "Save list name already used";
                    }
                }
            }
        }