try { if (btnConfirm.Text == "Save") { SqlCommand cmd = new SqlCommand("Smt_Mc_McInformation_Save", cn); if (cn.State == ConnectionState.Closed) { cn.Open(); } cmd.CommandType = CommandType.StoredProcedure; cmd.Parameters.AddWithValue("@McAsstNo", txtAssetNo.Text.Trim()); cmd.Parameters.AddWithValue("@McCode", ddlDescription.SelectedValue); cmd.ExecuteNonQuery(); } else { SqlCommand cmd = new SqlCommand("Smt_Mc_McMachine_Master_Edit", cn); if (cn.State == ConnectionState.Closed) { cn.Open(); } cmd.CommandType = CommandType.StoredProcedure; cmd.Parameters.AddWithValue("@McAsstNo", txtAssetNo.Text.Trim()); cmd.Parameters.AddWithValue("@McModel", txtModel.Text.Trim()); cmd.ExecuteNonQuery(); } } catch (Exception ex) { throw ex; } finally { if (Session["Uid"].ToString() == "ADMIN" || Session["Uid"].ToString() == "admin") { LoadGridForAd(); } else { LoadGrid(); } ClearText(); if (cn.State == ConnectionState.Open) { cn.Close(); } }
var
This content, along with any associated source code and files, is licensed under The Code Project Open License (CPOL)