Пример #1
0
 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;
     }
 }
Пример #2
0
 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();
     }
 }
Пример #3
0
 private void AddNewRecord()
 {
     Mines objData = new Mines();
     objData.AddNew();
     objData.EnName = uiTextBoxEnName.Text;
     objData.ArName = uiTextBoxArName.Text;
     objData.Save();
 }
Пример #4
0
 private void BindData()
 {
     Mines objData = new Mines();
     objData.LoadAll();
     uiGridViewMines.DataSource = objData.DefaultView;
     uiGridViewMines.DataBind();
 }
Пример #5
0
 private void LoadDDLs()
 {
     Mines curr = new Mines();
     curr.LoadAll();
     uiDropDownListMins.DataSource = curr.DefaultView;
     uiDropDownListMins.DataTextField = "ArName";
     uiDropDownListMins.DataValueField = "MinID";
     uiDropDownListMins.DataBind();
 }