Exemplo n.º 1
0
    public void BindGrid()
    {
        try
        {
            int rowcount = ucCustomPager1.isCountRecord;
            //string sortbycoloumn = (ViewState["SORTBYCOLOUMN"] == null) ? null : (ViewState["SORTBYCOLOUMN"].ToString());
            //int? sortdirection = null; if (ViewState["SORTDIRECTION"] != null) sortdirection = Int32.Parse(ViewState["SORTDIRECTION"].ToString());
            int    DepartmentId = Convert.ToInt32(ddlDepartment.SelectedValue);
            string SearchText   = txtSearchText.Text;

            DataTable dt = objINFO.GET_Dept_FolderList(DepartmentId, SearchText, ucCustomPager1.CurrentPageIndex, ucCustomPager1.PageSize, ref rowcount);


            if (ucCustomPager1.isCountRecord == 1)
            {
                ucCustomPager1.CountTotalRec = rowcount.ToString();
                ucCustomPager1.BuildPager();
            }

            if (dt.Rows.Count > 0)
            {
                GridViewDocType.DataSource = dt;
                GridViewDocType.DataBind();
            }
        }
        catch { }
    }
Exemplo n.º 2
0
    protected void btnSaveDocType_Click(object sender, EventArgs e)
    {
        try
        {
            if (txtDocType.Text.Trim().Equals(""))
            {
                string js = "Document Name is mandatory!";
                ScriptManager.RegisterStartupScript(this, this.GetType(), "msgNoFile", "alert('" + js + "');", true);
                return;
            }
            else
            {
                int AlertDays      = 0;
                int AddToChecklist = 0;
                int VoyageDoc      = 0;
                int Vessel_Flag    = 0;

                int ExpiryMandatory = 0;
                if (chkExpiryMandatory.Checked == true)
                {
                    ExpiryMandatory = 1;
                }

                if (txtAlertDays.Text.Trim().Length > 0)
                {
                    AlertDays = int.Parse(txtAlertDays.Text);
                }

                if (chkCheckList.Checked == true)
                {
                    AddToChecklist = 1;
                }

                if (chkVoyageDoc.Checked == true)
                {
                    VoyageDoc = 1;
                }
                Vessel_Flag = 0;
                DataTable dt = new DataTable();
                dt.Columns.Add("PID", typeof(int));
                foreach (ListItem chkitem in chkVesselFlagList.Items)
                {
                    if (chkitem.Selected.Equals(true))
                    {
                        dt.Rows.Add(int.Parse(chkitem.Value));
                    }
                }

                int responseid = objBLL.InsertDocType(txtDocType.Text.Trim(), AlertDays, AddToChecklist, VoyageDoc, Vessel_Flag, ExpiryMandatory, dt, Convert.ToInt32(Session["USERID"]));
                GridViewDocType.DataBind();

                string js = "closeDivAddDocType();";
                ScriptManager.RegisterStartupScript(this, this.GetType(), "close", js, true);
            }
        }
        catch (Exception ex)
        {
            lblMessage.Text = ex.Message;
        }
    }