Ejemplo n.º 1
0
    public void BindFolder()
    {
        try
        {
            DataTable dtFolders = BLL_QMSDB_Folders.QMSDBFoldes_List(null, null, null, null, UDFLib.ConvertIntegerToNull(Request.QueryString["DocID"].ToString()));
            ddlFolderList.DataSource     = dtFolders;
            ddlFolderList.DataTextField  = "FOLDER_NAME";
            ddlFolderList.DataValueField = "FOLDER_ID";
            ddlFolderList.DataBind();

            ddlFolderName.DataSource     = dtFolders;
            ddlFolderName.DataTextField  = "FOLDER_NAME";
            ddlFolderName.DataValueField = "FOLDER_ID";
            ddlFolderName.DataBind();

            ddlFolderName.SelectedValue = Request.QueryString["DocID"].ToString();
            if (dtFolders.Rows.Count > 0)
            {
                BindTrvFolder(dtFolders);
                GenerateUL(dtFolders);
            }
        }
        catch (Exception ex)
        {
        }
    }
Ejemplo n.º 2
0
 protected void btnAccessSave_Click(object sender, EventArgs e)
 {
     try
     {
         foreach (GridViewRow gvr in dvFolderUserAccess.Rows)
         {
             if ((gvr.FindControl("chkAll") as CheckBox).Checked == true || (gvr.FindControl("chkView") as CheckBox).Checked == true || (gvr.FindControl("chkAdd") as CheckBox).Checked == true || (gvr.FindControl("chkEdit") as CheckBox).Checked == true || (gvr.FindControl("chkDelete") as CheckBox).Checked == true)
             {
                 string lblDepartment = ((Label)gvr.FindControl("lblDeptId")).Text;
                 string lblUserId     = ((Label)gvr.FindControl("lblUerId")).Text;;
                 string fldFloderId   = ((Label)gvr.FindControl("lblFolderId")).Text;
                 if ((gvr.FindControl("chkAll") as CheckBox).Checked == true)
                 {
                     int i = BLL_QMSDB_Folders.QMSDBFoldes_Insert_UserAccess(UDFLib.ConvertIntegerToNull(lblDepartment), UDFLib.ConvertIntegerToNull(lblUserId), UDFLib.ConvertIntegerToNull(fldFloderId), 1, 1, 1, 1, UDFLib.ConvertIntegerToNull(Session["USERID"].ToString()));
                 }
                 else
                 {
                     int chkView   = (gvr.FindControl("chkView") as CheckBox).Checked == true ? 1 : 0;
                     int chkAdd    = (gvr.FindControl("chkAdd") as CheckBox).Checked == true ? 1 : 0;
                     int chkEdit   = (gvr.FindControl("chkEdit") as CheckBox).Checked == true ? 1 : 0;
                     int chkDelete = (gvr.FindControl("chkDelete") as CheckBox).Checked == true ? 1 : 0;
                     int i         = BLL_QMSDB_Folders.QMSDBFoldes_Insert_UserAccess(UDFLib.ConvertIntegerToNull(lblDepartment), UDFLib.ConvertIntegerToNull(lblUserId), UDFLib.ConvertIntegerToNull(fldFloderId), chkView, chkAdd, chkEdit, chkDelete, UDFLib.ConvertIntegerToNull(Session["USERID"].ToString()));
                 }
             }
         }
         BindFolderToUserAccess();
     }
     catch (Exception ex)
     {
     }
 }
Ejemplo n.º 3
0
 public void BindHeader()
 {
     try
     {
         DataTable FleetDT = BLL_QMSDB_Folders.QMSDBHeaderList();
         ddlHeaderTemplate.DataSource     = FleetDT;
         ddlHeaderTemplate.DataTextField  = "HEADERNAME";
         ddlHeaderTemplate.DataValueField = "HEADERID";
         ddlHeaderTemplate.DataBind();
         ddlHeaderTemplate.Items.Insert(0, new ListItem("- Select -", "0"));
     }
     catch (Exception ex)
     {
     }
 }
Ejemplo n.º 4
0
 protected void BindFolderToUserAccess()
 {
     if (TreeView1.SelectedNode != null)
     {
         int       rowcount  = ucCustomPagerItems.isCountRecord;
         string    NodeValue = TreeView1.SelectedNode.Value;
         DataTable dt        = BLL_QMSDB_Folders.QMSDBFoldes_UserAccess(UDFLib.ConvertIntegerToNull(lstDept.SelectedValue), UDFLib.ConvertIntegerToNull(lstUser.SelectedValue), UDFLib.ConvertIntegerToNull(NodeValue), ucCustomPagerItems.CurrentPageIndex, ucCustomPagerItems.PageSize, ref rowcount);
         dvFolderUserAccess.DataSource = dt;
         dvFolderUserAccess.DataBind();
         if (ucCustomPagerItems.isCountRecord == 1)
         {
             ucCustomPagerItems.CountTotalRec = rowcount.ToString();
             ucCustomPagerItems.BuildPager();
         }
     }
 }
Ejemplo n.º 5
0
 protected void BindFolderToVEsssel()
 {
     if (trvFolder.SelectedNode != null)
     {
         int       rowcount  = ucCustomPager1.isCountRecord;
         string    NodeValue = trvFolder.SelectedNode.Value;
         DataTable dt        = BLL_QMSDB_Folders.QMSDBFoldes_VesselAccess((DataTable)Session["sFleet"], (DataTable)Session["sVesselCode"], UDFLib.ConvertIntegerToNull(NodeValue), ucCustomPager1.CurrentPageIndex, ucCustomPager1.PageSize, ref rowcount);
         gvFolderAccessVessel.DataSource = dt;
         gvFolderAccessVessel.DataBind();
         if (ucCustomPager1.isCountRecord == 1)
         {
             ucCustomPager1.CountTotalRec = rowcount.ToString();
             ucCustomPager1.BuildPager();
         }
     }
 }
Ejemplo n.º 6
0
 protected void btnRenameFolder_Click(object sender, EventArgs e)
 {
     try
     {
         if (txtFolderName.Text.Trim() == "")
         {
             lblMessage.Text = "Please enter folder name.";
             return;
         }
         int    i   = BLL_QMSDB_Folders.Upd_QMSDBFoldes_Rename(int.Parse(ddlFolderList.SelectedValue), txtFolderName.Text, 1, UDFLib.ConvertIntegerToNull(Session["USERID"].ToString()));
         String msg = String.Format("alert('Folder name has changed');");
         ScriptManager.RegisterStartupScript(Page, Page.GetType(), "msg", msg, true);
         ScriptManager.RegisterStartupScript(this, this.GetType(), "reloadparent", "parent.RealoadParent();", true);
     }
     catch (Exception ex)
     {
     }
 }
Ejemplo n.º 7
0
 protected void btnVesselSave_Click(object sender, EventArgs e)
 {
     try
     {
         foreach (GridViewRow gvr in gvFolderAccessVessel.Rows)
         {
             if ((gvr.FindControl("chkVessel") as CheckBox).Checked == true)
             {
                 string lblFleet    = ((Label)gvr.FindControl("lblFleet")).Text;
                 string VesselId    = ((Label)gvr.FindControl("lblVesselId")).Text;;
                 string fldFloderId = ((Label)gvr.FindControl("lblFolderId")).Text;
                 int    i           = BLL_QMSDB_Folders.QMSDBFoldes_Insert_Vessel(UDFLib.ConvertIntegerToNull(lblFleet), UDFLib.ConvertIntegerToNull(VesselId), UDFLib.ConvertIntegerToNull(fldFloderId), UDFLib.ConvertIntegerToNull(Session["USERID"].ToString()), 1);
             }
         }
         BindFolderToVEsssel();
     }
     catch (Exception ex)
     {
     }
 }
Ejemplo n.º 8
0
 protected void btnSave_Click(object sender, EventArgs e)
 {
     try
     {
         if (txtFolderName.Text.Trim() == "")
         {
             lblMessage.Text = "Please enter folder name.";
             return;
         }
         int    i   = BLL_QMSDB_Folders.QMSDBFoldes_Insert(UDFLib.ConvertIntegerToNull(ddlFolderList.SelectedValue), txtFolderName.Text, 1, UDFLib.ConvertIntegerToNull(Session["USERID"].ToString()));
         String msg = String.Format("alert('Folder has created');");
         ScriptManager.RegisterStartupScript(Page, Page.GetType(), "msg", msg, true);
         ScriptManager.RegisterStartupScript(this, this.GetType(), "reloadparent", "parent.RealoadParent();", true);
     }
     catch (Exception ex)
     {
         string js = "alert('" + ex.Message.Replace("'", "") + "');";
         Page.ClientScript.RegisterStartupScript(GetType(), "script", js, true);
     }
 }
Ejemplo n.º 9
0
    /// <summary>
    /// this is method uses for the load & bind the treeview control from database.
    /// </summary>
    public void LoadtreeView()
    {
        //DataTable dtFolders = objQMS.getFolderList(87);
        //DataTable dtFiles = objQMS.getFileList(87);
        DataTable dtFolders = BLL_QMSDB_Folders.QMSDBFoldes_List(null, null, null, Convert.ToInt32(Session["USERID"]), null);
        DataTable dtFiles   = BLL_QMSDB_Folders.QMSDBFoldes_ProcedureList(null, null, null, Convert.ToInt32(Session["USERID"]), null);

        //this is for the root node
        if (dtFolders.Rows.Count == 0)
        {
            TreeNode parentNode = new TreeNode("DOCUMENTS", "DOCUMENTS", getNodeImageURL("Parent.FDC"));
            parentNode.NavigateUrl  = "AddNewFile.aspx?Path=DOCUMENTS&DocID=1";
            parentNode.Target       = "docPreview";
            parentNode.SelectAction = TreeNodeSelectAction.Select;
            parentNode.Expand();
            BrowseTreeView.Nodes.Add(parentNode);
        }
        else
        {
            TreeNode parentNode = new TreeNode(dtFolders.Rows[0]["FOLDER_NAME"].ToString(), dtFolders.Rows[0]["FOLDER_NAME"].ToString(), getNodeImageURL("Parent.FDC"));
            parentNode.NavigateUrl  = "AddNewFile.aspx?Path=DOCUMENTS&DocID=1";
            parentNode.Target       = "docPreview";
            parentNode.SelectAction = TreeNodeSelectAction.Select;
            parentNode.Expand();
            BrowseTreeView.Nodes.Add(parentNode);
        }
        if (dtFolders.Rows.Count > 0)
        {
            foreach (DataRow dr in dtFolders.Rows)
            {
                CreateChildNode(dr["XNPATH"].ToString(), dr["FOLDER_NAME"].ToString(), 1, Convert.ToInt32(dr["FOLDER_ID"].ToString()));
            }
        }
        if (dtFiles.Rows.Count > 0)
        {
            foreach (DataRow dr in dtFiles.Rows)
            {
                CreateChildNode(dr["XNPATH"].ToString(), dr["FOLDER_NAME"].ToString(), 0, Convert.ToInt32(dr["FOLDER_ID"].ToString()));
            }
        }
    }
    public void BindFolder()
    {
        try
        {
            DataTable dtFolders = BLL_QMSDB_Folders.QMSDBFoldes_List(null, null, null, null, 1);


            //ddlFolderName.DataSource = dtFolders;
            //ddlFolderName.DataTextField = "XNPATH";
            //ddlFolderName.DataValueField = "FOLDER_ID";
            //ddlFolderName.DataBind();

            if (dtFolders.Rows.Count > 0)
            {
                //ddlFolderName.SelectedValue = "1";
                BindTrvFolder(dtFolders);
                //GenerateUL(dtFolders);
            }
        }
        catch (Exception ex)
        {
        }
    }