private void LoadFLine() { if (!ReferenceEquals(Session[Constants.SESSION_SEARCH_CRITERIA], null)) { SearchCriteria searchCriteria = (SearchCriteria)Session[Constants.SESSION_SEARCH_CRITERIA]; if (!ReferenceEquals(searchCriteria, null)) { BuildSearchCriteria(searchCriteria); fwLocBLL commonBll = new fwLocBLL(); gvwLoc.PageIndex = searchCriteria.PageIndex; if (searchCriteria.PageSize > 0) { gvwLoc.PageSize = searchCriteria.PageSize; } gvwLoc.DataSource = fwLocBLL.GetfwLoc(searchCriteria); gvwLoc.DataBind(); } } }
protected void btnSave_Click(object sender, EventArgs e) { if (Page.IsValid) { //if (Convert.ToDecimal(txtWFrom.Text) > Convert.ToDecimal(txtWTo.Text)) //{ // ScriptManager.RegisterStartupScript(this, typeof(Page), "alert", "<script>javascript:void alert('" + ResourceManager.GetStringWithoutName("ERR00077") + "');</script>", false); // return; //} string mode; oLineBll = new fwLocBLL(); oLineEntity = new fwLocationEntity(); //oUserEntity = (UserEntity)Session[Constants.SESSION_USER_INFO]; // This section has been commented temporarily mode = "U"; if (hdnFLocID.Value.ToInt() == 0) { mode = "A"; } oLineEntity.LocName = txtLocation.Text.ToString(); oLineEntity.locID = hdnFLocID.ToInt(); oLineEntity.LocAddress.Pin = TxtPin.Text; oLineEntity.LocAddress.Address = txtAddress.Text; oLineEntity.LocAddress.City = txtCity.Text; oLineEntity.Phone = txtPhone.Text; oLineEntity.Abbreviation = txtAbbr.Text; oLineEntity.CreatedBy = _userId; oLineBll.SaveFwLoc(oLineEntity); if (mode == "A") { ClearAll(); } else { Response.Redirect("~/Forwarding/Master/ManageFLoc.aspx"); } } }