//TODO: Need to decide if there is a mistake, should we allow them to make corrections or start over. /// <summary> /// Should be comming from the dashboard /// </summary> /// <param name="softwareID"></param> /// <param name="softwareName"></param> /// <param name="dashBoard"></param> public Attribute_s_(int softwareID, string softwareName, DashBoard dashBoard) { _softwareID = softwareID; InitializeComponent(); lblSoftwareName.Text = softwareName; _myDashBoard = dashBoard; _update = false; }
public Attribute_s_(int softwareID, string softwareName, DashBoard dashBoard, int InsertAttribute, int configItemID) { _softwareID = softwareID; InitializeComponent(); lblSoftwareName.Text = softwareName; _myDashBoard = dashBoard; _update = false; _configItemID = configItemID; SetTextInsert(InsertAttribute); }
public SoftwareForm(Software aSoftware, User aUser, int aAddUpdate, DashBoard aDashBoard) { InitializeComponent(); mSoftware = aSoftware; mUser = aUser; mAddUpdate = aAddUpdate; myDashBoard = aDashBoard; if (mAddUpdate == 2) { txtSoftwareName.Enabled = false; } else { txtSoftwareName.Enabled = true; } }
public void submit(string aUsername, string aPassword) { SqlConnection conn = new SqlConnection(); conn.ConnectionString = _connectionString; //Modifed to use application using (conn) { try { conn.Open(); SqlCommand cmd = new SqlCommand("usp_Select_User", conn); cmd.CommandType = CommandType.StoredProcedure; cmd.Parameters.AddWithValue("@UserName", aUsername); cmd.Parameters.AddWithValue("@PassWoard", aPassword); User aUser = new User(); DataSet ds = new DataSet(); // DataTable dt = new DataTable(); using (SqlDataAdapter getData = new SqlDataAdapter(cmd)) { getData.Fill(ds); } if (ds.Tables[0].Rows.Count > 0) { aUser.User_ID = Convert.ToInt32(ds.Tables[0].Rows[0][1].ToString()); aUser.AccessGroup = Convert.ToInt32(ds.Tables[0].Rows[0][0].ToString()); DashBoard dashBoard = new DashBoard(aUser, _loginForm); LoginForm.ActiveForm.Hide(); dashBoard.Show(); } else { MessageBox.Show("User does not exsist", "Error!", MessageBoxButtons.OK); } } finally { conn.Close(); } } }
/// <summary> /// /// </summary> /// <param name="softwareId"></param> /// <param name="softwareName"></param> /// <param name="att"></param> /// <param name="InsertType"></param> /// <param name="configItemID">If adding a config item document this value should be set</param> public void openAttributeForm(int softwareId, string softwareName, DashBoard att, int InsertType = 0, int configItemID = 0) { mSoftware_ID = softwareId; switch (InsertType) { case 1: Attribute_s_ AddAttributeSoftwareDOC = new Attribute_s_(softwareId, softwareName, att, InsertType); AddAttributeSoftwareDOC.Show(); break; case 2: { if (configItemID == 0) { Attribute_s_ AddAttributeConfig = new Attribute_s_(softwareId, softwareName, att, InsertType); AddAttributeConfig.Show(); } else { Attribute_s_ AddAttributeConfig = new Attribute_s_(softwareId, softwareName, att, InsertType, configItemID); AddAttributeConfig.Show(); } } break; case 3: break; default: Attribute_s_ AddAttributes = new Attribute_s_(mSoftware_ID, softwareName, att); AddAttributes.Show(); break; } }