Beispiel #1
0
    protected void btnAddCatrgory_Click(object sender, EventArgs e)
    {
        string FileName = null;
        int    Parent   = Convert.ToInt32(hfNode.Value);
        int    Type     = 2;
        int    Id       = 0;

        if (txtCategoryName.Text.Trim() == "")
        {
            string js1 = "alert('Name is mandatory.');showModal('dvCategory');";
            ScriptManager.RegisterStartupScript(this, this.GetType(), "showModalJS", js1, true);
            return;
        }


        if (Session["Mode"].ToString() == "NEW")
        {
            Id = 0;
        }
        if (Session["Mode"].ToString() == "EDIT")
        {
            Id = Convert.ToInt32(hfNode.Value);
        }
        if (Session["Mode"] != null)
        {
            BLL_LMS_Training.INSUPD_VESSEL_VIDEOS(Id, Type, txtCategoryName.Text, null, FileName, Parent, Convert.ToInt32(Session["USERID"]));
            string js = "hideModal('dvCategory');";
            ScriptManager.RegisterStartupScript(this, this.GetType(), "hideModalJS", js, true);
            Session["FileName"] = null;
            Session["Mode"]     = null;
        }
    }
Beispiel #2
0
    protected void btnAddItem_Click(object sender, EventArgs e)
    {
        if (Session["Mode"].ToString().ToUpper() == "NEW".ToUpper())
        {
            hfFileName.Value = null;
        }
        string FileName         = null;
        string OriginalFileName = null;
        int    Parent           = Convert.ToInt32(hfNode.Value);
        int    Type             = 3;
        int    Id = 0;

        if (hfPar.Value != "#")
        {
            if (Session["FileName"] == null)
            {
                FileName = hfFileName.Value;
            }
            else
            {
                FileName = Session["FileName"].ToString();
            }

            Type = 3;
        }
        if (txtItemName.Text.Trim() == "")
        {
            string js1 = "alert('Name is mandatory.');showModal('dvItem');";
            ScriptManager.RegisterStartupScript(this, this.GetType(), "showModalJS", js1, true);
            return;
        }
        if (FileName.Trim() == "")
        {
            string js1 = "alert('File is mandatory.');showModal('dvItem');";
            ScriptManager.RegisterStartupScript(this, this.GetType(), "showModalJS", js1, true);
            return;
        }
        if (Session["OriginalFileName"] == null)
        {
            OriginalFileName = "";
        }
        else
        {
            OriginalFileName = Session["OriginalFileName"].ToString();
        }
        if (Session["Mode"].ToString() == "NEW")
        {
            Id = 0;
        }
        if (Session["Mode"].ToString() == "EDIT")
        {
            Id = Convert.ToInt32(hfNode.Value);
        }
        if (Session["Mode"] != null)
        {
            BLL_LMS_Training.INSUPD_VESSEL_VIDEOS(Id, Type, txtItemName.Text, OriginalFileName, FileName, Parent, Convert.ToInt32(Session["USERID"]));
            string js = "hideModal('dvItem');";
            ScriptManager.RegisterStartupScript(this, this.GetType(), "hideModalJS", js, true);
            Session["FileName"] = null;
            Session["Mode"]     = null;
        }
    }