コード例 #1
0
 protected void BindBranch()
 {
     ddlUnionBranch.DataSource     = objCrewAdmin.CRUD_UnionBranch("", 0, Convert.ToInt32(ddlUnion.SelectedValue), "", "", "", "", 0, "", "", "", "R", GetSessionUserID(), null, "UnionBranch", null, 1, 100000, ref i, ref i);
     ddlUnionBranch.DataValueField = "ID";
     ddlUnionBranch.DataTextField  = "UnionBranch";
     ddlUnionBranch.DataBind();
     ddlUnionBranch.Items.Insert(0, new ListItem("-SELECT-", "0"));
 }
コード例 #2
0
    protected void btnSaveUnionBranch_OnClick(object sender, EventArgs e)
    {
        try
        {
            DataTable      dt       = new DataTable();
            BLL_Crew_Admin objBLL   = new BLL_Crew_Admin();
            int            rowcount = 0;

            if (Convert.ToInt32(hdnUnionBranchID.Value) > 0)
            {
                if (hdnAddressType.Value == "1")
                {
                    dt = objBLL.CRUD_UnionBranchUS(txtUnionBranch.Text.Trim(), Convert.ToInt32(hdnUnionBranchID.Value), Convert.ToInt32(drpUnion.SelectedValue), txtAddress.Text.Trim(), Convert.ToInt32(drpCountry.SelectedValue), txtPhoneNumber.Text.Trim(), txtEmail.Text.Trim(), "U", GetSessionUserID(), "", "", null, null, null, ref rowcount, ref Result).Tables[0];
                }
                else
                {
                    dt = objBLL.CRUD_UnionBranch(txtUnionBranch.Text.Trim(), Convert.ToInt32(hdnUnionBranchID.Value), Convert.ToInt32(drpUnion.SelectedValue), txtAddressLine1.Text.Trim(), txtAddressLine2.Text.Trim(), txtCity.Text.Trim(), txtState.Text, Convert.ToInt32(drpCountry.SelectedValue), txtZipCode.Text.Trim(), txtPhoneNumber.Text.Trim(), txtEmail.Text.Trim(), "U", GetSessionUserID(), "", "", null, null, null, ref rowcount, ref Result).Tables[0];
                }

                if (Result > 0)
                {
                    ScriptManager.RegisterStartupScript(Page, Page.GetType(), "AlreadyExists", "alert('" + UDFLib.GetException("SuccessMessage/UpdateMessage") + "');hideModal('divAddUnionBranch');", true);
                }
            }
            else
            {
                if (hdnAddressType.Value == "1")
                {
                    dt = objBLL.CRUD_UnionBranchUS(txtUnionBranch.Text.Trim(), 0, Convert.ToInt32(drpUnion.SelectedValue), txtAddress.Text.Trim(), Convert.ToInt32(drpCountry.SelectedValue), txtPhoneNumber.Text.Trim(), txtEmail.Text.Trim(), "I", GetSessionUserID(), "", "", null, null, null, ref rowcount, ref Result).Tables[0];
                }
                else
                {
                    dt = objBLL.CRUD_UnionBranch(txtUnionBranch.Text.Trim(), 0, Convert.ToInt32(drpUnion.SelectedValue), txtAddressLine1.Text.Trim(), txtAddressLine2.Text.Trim(), txtCity.Text.Trim(), txtState.Text, Convert.ToInt32(drpCountry.SelectedValue), txtZipCode.Text.Trim(), txtPhoneNumber.Text.Trim(), txtEmail.Text.Trim(), "I", GetSessionUserID(), "", "", null, null, null, ref rowcount, ref Result).Tables[0];
                }

                if (Result > 0)
                {
                    ScriptManager.RegisterStartupScript(Page, Page.GetType(), "AlreadyExists", "alert('" + UDFLib.GetException("SuccessMessage/SaveMessage") + "');hideModal('divAddUnionBranch');", true);
                }
            }

            if (Result < 0)
            {
                ScriptManager.RegisterStartupScript(Page, Page.GetType(), "AlreadyExists", "alert('The selected Union Branch already exist in the system');showModal('divAddUnionBranch', false);", true);
            }
            BindUnionBranch();
        }
        catch (Exception ex)
        {
            UDFLib.WriteExceptionLog(ex);
        }
    }
コード例 #3
0
    public void BindUnionBranch()
    {
        try
        {
            int rowcount = ucCustomPagerItemsBranch.isCountRecord;

            string sortbycoloumn = (ViewState["SORTBYCOLOUMN_UNIONBRANCH"] == null) ? null : (ViewState["SORTBYCOLOUMN_UNIONBRANCH"].ToString());
            int?   sortdirection = null; if (ViewState["SORTDIRECTION_UNIONBRANCH"] != null)
            {
                sortdirection = Int32.Parse(ViewState["SORTDIRECTION_UNIONBRANCH"].ToString());
            }

            BLL_Crew_Admin objBLL = new BLL_Crew_Admin();
            DataSet        dt     = objBLL.CRUD_UnionBranch("", 0, Convert.ToInt32(Session["UNIONID"]), "", "", "", "", 0, "", "", "", "R", GetSessionUserID(), txtUnionBranchFilter.Text != "" ? txtUnionBranchFilter.Text : null, sortbycoloumn, sortdirection
                                                            , ucCustomPagerItemsBranch.CurrentPageIndex, ucCustomPagerItemsBranch.PageSize, ref rowcount, ref Result);

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

            if (dt.Tables[0].Rows.Count > 0)
            {
                gvUnionBranch.DataSource = dt.Tables[0];
                gvUnionBranch.DataBind();
            }
            else
            {
                gvUnionBranch.DataSource = null;
                gvUnionBranch.DataBind();
            }
        }
        catch (Exception ex) { UDFLib.WriteExceptionLog(ex); }
    }
コード例 #4
0
    protected void onDeleteBranch(object source, CommandEventArgs e)
    {
        try
        {
            int            rowcount = 0;
            BLL_Crew_Admin objBLL   = new BLL_Crew_Admin();
            DataTable      dt       = objBLL.CRUD_UnionBranch("", Convert.ToInt32(e.CommandArgument.ToString()), 0, "", "", "", "", 0, "", "", "", "D", GetSessionUserID(), "", "", null, null, null, ref rowcount, ref Result).Tables[0];
            if (Result > 0)
            {
                ScriptManager.RegisterStartupScript(Page, Page.GetType(), "ShowMessage", "alert('Record deleted successfully')", true);
            }

            BindUnionBranch();
        }
        catch (Exception ex) { UDFLib.WriteExceptionLog(ex); }
    }