protected void UIGridViewMinerals_RowDataBound(object sender, GridViewRowEventArgs e) { if (e.Row.RowType == DataControlRowType.DataRow) { DataRowView objData = (DataRowView)e.Row.DataItem; Label temp = (Label)e.Row.FindControl("uiLabelMineralName"); Mines curr = new Mines(); curr.LoadByPrimaryKey(Convert.ToInt32(objData["MinID"].ToString())); temp.Text = curr.ArName; } }
protected void uiGridViewMines_RowCommand(object sender, GridViewCommandEventArgs e) { if (e.CommandName == "EditCurrency") { Mines objData = new Mines(); objData.LoadByPrimaryKey(Convert.ToInt32(e.CommandArgument.ToString())); uiTextBoxEnName.Text = objData.EnName; uiTextBoxArName.Text = objData.ArName; uiPanelViewMines.Visible = false; uiPanelEdit.Visible = true; CurrentMines = objData; } else if (e.CommandName == "DeleteCurrency") { Mines objData = new Mines(); objData.LoadByPrimaryKey(Convert.ToInt32(e.CommandArgument.ToString())); objData.MarkAsDeleted(); objData.Save(); CurrentMines = null; BindData(); } }
private void AddNewRecord() { Mines objData = new Mines(); objData.AddNew(); objData.EnName = uiTextBoxEnName.Text; objData.ArName = uiTextBoxArName.Text; objData.Save(); }
private void BindData() { Mines objData = new Mines(); objData.LoadAll(); uiGridViewMines.DataSource = objData.DefaultView; uiGridViewMines.DataBind(); }
private void LoadDDLs() { Mines curr = new Mines(); curr.LoadAll(); uiDropDownListMins.DataSource = curr.DefaultView; uiDropDownListMins.DataTextField = "ArName"; uiDropDownListMins.DataValueField = "MinID"; uiDropDownListMins.DataBind(); }