void bindCity(int id) { oblCity = new Store.City.BusinessLogic.City(); try { objCitylist = oblCity.GetAllCityList(id, 0, ""); if (objCitylist != null) { ListItem al = new ListItem("<-Select City->", "0", true); ddlCityID.DataSource = objCitylist; ddlCityID.DataValueField = "CityID"; ddlCityID.DataTextField = "CityName"; ddlCityID.DataBind(); ddlCityID.Items.Insert(0, al); } else { ddlCityID.DataSource = null; ddlCityID.DataBind(); } } catch (Exception ex) { Store.Common.Utility.ExceptionLog.Exceptionlogs(ex.Message, Store.Common.Utility.ExceptionLog.LineNumber(ex), typeof(UserInfo).FullName, 1); } finally { oblCity = null; objCitylist = null; } }
void ManageCity() { objCity = new Store.City.BusinessObject.City(); oblCity = new Store.City.BusinessLogic.City(); try { if (cmdMode == Store.Common.CommandMode.M) { objCity.CityID = Convert.ToInt32(txtCityId.Text); //objCity.ModifiedBy = Convert.ToInt32(Session["UserId"].ToString()); } else { objCity.CityID = 0; //objCity.CreatedBy = Convert.ToInt32(Session["UserId"].ToString()); } objCity.CityName = Convert.ToString(txtCity.Text); objCity.CountryID = Convert.ToInt32(ddlCountry.SelectedValue); objCity.StateID = Convert.ToInt32(ddlState.SelectedItem.Value); objCity.DistrictID = Convert.ToInt32(ddlDistrict.SelectedItem.Value); objMessageInfo = oblCity.ManageItemMaster(objCity, cmdMode); } catch (Exception ex) { Store.Common.Utility.ExceptionLog.Exceptionlogs(ex.Message, Store.Common.Utility.ExceptionLog.LineNumber(ex), typeof(City).FullName, 1); } finally { objCity = null; //objMessageInfo = null; oblCity = null; } }
protected void imgbtnfrDelete_Click(object sender, ImageClickEventArgs e) { cmdMode = CommandMode.D; objCity = new Store.City.BusinessObject.City(); oblCity = new Store.City.BusinessLogic.City(); try { ImageButton btndetails = sender as ImageButton; GridViewRow gvrow = (GridViewRow)btndetails.NamingContainer; objCity.CityID = Convert.ToInt32(dgvCity.DataKeys[gvrow.RowIndex].Value.ToString()); objCity.CityName = ""; objCity.StateID = 0; //objCity.CreatedBy = Convert.ToInt32(Session["UserId"].ToString()); objMessageInfo = oblCity.ManageItemMaster(objCity, cmdMode); BindCity(); updateCityBdInfo.Update(); ScriptManager.RegisterStartupScript(this.Page, this.Page.GetType(), "alert", "alert('" + objMessageInfo.TranMessage + "')", true); } catch (Exception ex) { Store.Common.Utility.ExceptionLog.Exceptionlogs(ex.Message, Store.Common.Utility.ExceptionLog.LineNumber(ex), typeof(City).FullName, 1); } finally { objCity = null; objMessageInfo = null; oblCity = null; } }
void BindCity() { oblCity = new Store.City.BusinessLogic.City(); try { objCitylist = oblCity.GetAllCityList(0, 0, ""); if (objCitylist != null) { dgvCity.DataSource = objCitylist; dgvCity.DataBind(); } else { dgvCity.DataSource = null; dgvCity.DataBind(); } } catch (Exception ex) { Store.Common.Utility.ExceptionLog.Exceptionlogs(ex.Message, Store.Common.Utility.ExceptionLog.LineNumber(ex), typeof(City).FullName, 1); } finally { oblCity = null; objCitylist = null; } }