private void btnEmpAdd_Click(object sender, EventArgs e) { String strFromDate = String.Empty; String strToDate = String.Empty; if (txtFromDate.Text.Equals("") || txtToDate.Text.Equals("")) { strFromDate = "01012999"; strToDate = "01012999"; } else { strFromDate = txtFromDate.Text; strToDate = txtToDate.Text; } if (!txtEmpNo.Text.Equals("") && !txtEmpName.Text.Equals("") && !txtPassWord.Text.Equals("")) { if (dbAccessLayer.SaveToTable("tblempmaster", new String[] { txtEmpNo.Text, txtEmpName.Text, cmbBoxEmpType.SelectedValue.ToString(), cmbBoxEmpDept.SelectedValue.ToString(), cmbBoxShip.SelectedValue.ToString(), (rdBtnActive.Checked ? "1" : "0"), strFromDate, strToDate, txtPassWord.Text })) { if (dbAccessLayer.SaveToTable("tblsecurity", new String[] { txtEmpNo.Text, txtEmpName.Text, txtEmpNo.Text, "Emp" })) { MessageBox.Show("Added Successfully"); } } else { MessageBox.Show("Operation failed. Kindly check the values again."); } } else { MessageBox.Show("All the fields are mandatory"); } }
private void btnShipAdd_Click(object sender, EventArgs e) { if (!txtShipNo.Text.Equals("") && !txtShipName.Text.Equals("") && !txtShipSize.Text.Equals("") && !txtShipCapacity.Text.Equals("")) { if (dbAccessLayer.SaveToTable("tblshipmaster", new String[] { txtShipNo.Text, txtShipName.Text, cmbBoxFleet.SelectedValue.ToString(), cmbBoxShipType.SelectedValue.ToString(), txtShipSize.Text, txtShipCapacity.Text })) { MessageBox.Show("Added Successfully"); txtShipNo.Text = ""; txtShipName.Text = ""; txtShipSize.Text = ""; txtShipCapacity.Text = ""; } else { MessageBox.Show("Operation failed. Kindly check the values again."); } } else { MessageBox.Show("All the fields are mandatory"); } }
private void btnShipTypeAdd_Click(object sender, EventArgs e) { if (!txtShipTypeDesc.Text.Equals("") && !txtShipTypeID.Text.Equals("") && !txtShipTypeName.Text.Equals("")) { if (dbAccessLayer.SaveToTable("tblshiptypemaster", new String[] { txtShipTypeID.Text, txtShipTypeName.Text, txtShipTypeDesc.Text })) { MessageBox.Show("Added Successfully"); txtShipTypeDesc.Text = ""; txtShipTypeID.Text = ""; txtShipTypeName.Text = ""; } else { MessageBox.Show("Operation failed. Kindly check the values again."); } } else { MessageBox.Show("All fields are mandatory"); } }
private void btnAddFleet_Click(object sender, EventArgs e) { if (!txtFleetDesc.Text.Equals("") && !txtFleetID.Text.Equals("") && !txtFleetName.Text.Equals("")) { if (dbAccessLayer.SaveToTable("tblfleetmaster", new String[] { txtFleetID.Text, txtFleetName.Text, txtFleetDesc.Text })) { MessageBox.Show("Successfully added"); txtFleetDesc.Clear(); txtFleetID.Clear(); txtFleetName.Clear(); } else { MessageBox.Show("Operation failed. Kindly check the values again."); } } else { MessageBox.Show("All fields are mandatory"); } }