Пример #1
0
 protected void BindPermanentStatus()
 {
     ddlPermamnent.DataSource     = objCrewAdmin.CRUD_PermanentStatus("", "R", 0, 0, null, null, null, 1, 100, ref i, ref i);
     ddlPermamnent.DataValueField = "ID";
     ddlPermamnent.DataTextField  = "Status";
     ddlPermamnent.DataBind();
     ddlPermamnent.Items.Insert(0, new ListItem("-SELECT-", "0"));
 }
Пример #2
0
    protected void onDeleteStatus(object source, CommandEventArgs e)
    {
        try
        {
            int            rowcount = 0; int Result = 1;
            BLL_Crew_Admin objBLL = new BLL_Crew_Admin();
            DataTable      dt     = objBLL.CRUD_PermanentStatus("", "D", GetSessionUserID(), Convert.ToInt32(e.CommandArgument.ToString()), "", "", null, null, null, ref rowcount, ref Result).Tables[0];
            if (Result > 0)
            {
                ScriptManager.RegisterStartupScript(Page, Page.GetType(), "ShowMessage", "alert('Record deleted successfully')", true);
            }

            BindPermamnentStatus();
        }
        catch (Exception ex) { UDFLib.WriteExceptionLog(ex); }
    }
Пример #3
0
    protected void btnSavePermanent_Click(object sender, EventArgs e)
    {
        int Result = 1;

        try
        {
            if (Convert.ToInt32(hdnStatusID.Value) > 0)
            {
                int            rowcount = 0;
                BLL_Crew_Admin objBLL   = new BLL_Crew_Admin();
                DataTable      dt       = objBLL.CRUD_PermanentStatus(txtPermanent.Text.Trim(), "U", GetSessionUserID(), Convert.ToInt32(hdnStatusID.Value), "", "", null, null, null, ref rowcount, ref Result).Tables[0];

                ///Result == 2 Already exists
                if (Result < 0)
                {
                    ScriptManager.RegisterStartupScript(Page, Page.GetType(), "AlreadyExists", "alert('The selected status already exist in the system');showModal('divAddStatus', false);", true);
                }
                else if (Result > 0)
                {
                    ScriptManager.RegisterStartupScript(Page, Page.GetType(), "AlreadyExists", "alert('" + UDFLib.GetException("SuccessMessage/UpdateMessage") + "');hideModal('divAddStatus');", true);
                    BindPermamnentStatus();
                }
            }
            else
            {
                int            rowcount = 0;
                BLL_Crew_Admin objBLL   = new BLL_Crew_Admin();
                DataTable      dt       = objBLL.CRUD_PermanentStatus(txtPermanent.Text.Trim(), "I", GetSessionUserID(), 0, "", "", null, null, null, ref rowcount, ref Result).Tables[0];

                ///Result == 2 Already exists
                if (Result < 0)
                {
                    ScriptManager.RegisterStartupScript(Page, Page.GetType(), "AlreadyExists", "alert('The selected status already exist in the system');showModal('divAddStatus', false);", true);
                }
                else if (Result > 0)
                {
                    ScriptManager.RegisterStartupScript(Page, Page.GetType(), "AlreadyExists", "alert('" + UDFLib.GetException("SuccessMessage/SaveMessage") + "');hideModal('divAddStatus');", true);
                    BindPermamnentStatus();
                }
            }
        }
        catch (Exception ex)
        {
            UDFLib.WriteExceptionLog(ex);
        }
    }
Пример #4
0
    protected void BindPermamnentStatus()
    {
        try
        {
            int    rowcount      = ucCustomPagerPermanent.isCountRecord;
            int    Result        = 1;
            string sortbycoloumn = (ViewState["SORTBYCOLOUMN"] == null) ? null : (ViewState["SORTBYCOLOUMN"].ToString());
            int?   sortdirection = null; if (ViewState["SORTDIRECTION"] != null)
            {
                sortdirection = Int32.Parse(ViewState["SORTDIRECTION"].ToString());
            }

            BLL_Crew_Admin objBLL = new BLL_Crew_Admin();
            DataSet        dt     = objBLL.CRUD_PermanentStatus("", "R", 0, 0, txtPermanentFilter.Text != "" ? txtPermanentFilter.Text : null, sortbycoloumn, sortdirection
                                                                , ucCustomPagerPermanent.CurrentPageIndex, ucCustomPagerPermanent.PageSize, ref rowcount, ref Result);

            if (dt != null)
            {
                if (ucCustomPagerPermanent.isCountRecord == 1)
                {
                    ucCustomPagerPermanent.CountTotalRec = rowcount.ToString();
                    ucCustomPagerPermanent.BuildPager();
                }
                if (dt.Tables[0].Rows.Count > 0)
                {
                    gvPermanentStatus.DataSource = dt.Tables[0];
                    gvPermanentStatus.DataBind();
                }
                else
                {
                    gvPermanentStatus.DataSource = null;
                    gvPermanentStatus.DataBind();
                }
            }
        }
        catch (Exception ex)
        {
            UDFLib.WriteExceptionLog(ex);
        }
    }