Ejemplo n.º 1
0
        protected void gridViewList_RowCommand(object sender, GridViewCommandEventArgs e)
        {
            string[] arg = new string[2];
            arg = e.CommandArgument.ToString().Split(';');

            if (e.CommandName == "EditRow")
            {
                ViewState["ZoneId"] = Convert.ToString(arg[0]);
                long ZoneId = Utility.GetLong(ViewState["ZoneId"]);

                ViewState["Update"] = "Update";

                LookupUtility.BindRegionLookup(ddlRegion, SessionContext);

                ZoneEntity entity = new ConfigrationRepository(SessionContext).GetZoneById(ZoneId).FirstOrDefault();

                Utility.SetLookupSelectedValue(ddlRegion, Convert.ToString(entity.RegionId));
                txtZoneName.Text = entity.ZoneName;

                DIVList.Visible = false;
                DIVDetail.Visible = true;
            }
            else if (e.CommandName == "DeleteRow")
            {
                ViewState["ZoneId"] = Convert.ToString(arg[0]);
                long ZoneId = Utility.GetLong(ViewState["ZoneId"]);

                ViewState["Delete"] = "Delete";

                ShowYesNoPopup("Are you sure you want to delete this Zone?");
            }
        }
Ejemplo n.º 2
0
        protected void Page_Load(object sender, EventArgs e)
        {
            MasterPage.YesClickHandler += MasterPage_YesClickHandler;

            if (Page.IsPostBack) return;

            LookupUtility.BindRegionLookup(ddlRegionSearch, SessionContext);

            FillGrid();
        }
Ejemplo n.º 3
0
        protected void btnAdd_Click(object sender, EventArgs e)
        {
            LookupUtility.BindRegionLookup(ddlRegion, SessionContext);

            ClearPageControl();

            ViewState["Add"] = "Add";

            DIVList.Visible   = false;
            DIVDetail.Visible = true;
        }
Ejemplo n.º 4
0
        protected void gridViewList_RowCommand(object sender, GridViewCommandEventArgs e)
        {
            string[] arg = new string[2];
            arg = e.CommandArgument.ToString().Split(';');

            if (e.CommandName == "EditRow")
            {
                ViewState["SiteId"] = Convert.ToString(arg[0]);
                long SiteId = Utility.GetLong(ViewState["SiteId"]);

                ViewState["Update"] = "Update";

                LookupUtility.BindRegionLookup(ddlRegion, SessionContext);

                SiteEntity entity = new ConfigrationRepository(SessionContext).GetSiteById(SiteId).FirstOrDefault();

                txtSiteName.Text = entity.SiteName;

                Utility.SetLookupSelectedValue(ddlRegion, Convert.ToString(entity.RegionId));
                ddlRegion_SelectedIndexChanged(null, null);

                Utility.SetLookupSelectedValue(ddlZone, Convert.ToString(entity.ZoneId));
                ddlZone_SelectedIndexChanged(null, null);

                Utility.SetLookupSelectedValue(ddlBranch, Convert.ToString(entity.BranchId));
                ddlBranch_SelectedIndexChanged(null, null);

                Utility.SetLookupSelectedValue(ddlHub, Convert.ToString(entity.HubId));
                ddlHub_SelectedIndexChanged(null, null);

                Utility.SetLookupSelectedValue(ddlCluster, Convert.ToString(entity.ClusterId));

                DIVList.Visible   = false;
                DIVDetail.Visible = true;
            }
            else if (e.CommandName == "DeleteRow")
            {
                ViewState["SiteId"] = Convert.ToString(arg[0]);
                long SiteId = Utility.GetLong(ViewState["SiteId"]);

                ViewState["Delete"] = "Delete";

                ShowYesNoPopup("Are you sure you want to delete this Site?");
            }
        }