//ADD NEW LAND MARK DATA private void AddLandMark() { if (String.IsNullOrWhiteSpace(txtLMType.Text)) { MessageBox.Show("Please enter Land Mark Type!", "Land Mark Type", MessageBoxButtons.OK, MessageBoxIcon.Error); } else { objSetting = new SettingClassBLL(); if (objSetting.CheckLandMarkType(txtLMType.Text) == false) { objSetting = new SettingClassBLL() { landMarkType = txtLMType.Text }; objSetting.AddNewLandMarkType(); MessageBox.Show("Land Mark Type added successful!", "Add New Land Mark Type", MessageBoxButtons.OK, MessageBoxIcon.Information); LoadLandMarTypekData(); DeafultValueAddToStockDivision();//STOCK DEFAULT DATA ADD WITH LM TYPE ClearTextBoxces(); } else { MessageBox.Show("Land Mark Type is exist!", "Land Mark Type", MessageBoxButtons.OK, MessageBoxIcon.Error); ClearTextBoxces(); } } }
//UPDATE LANDA MARK DATA private void UpdateLandMark() { try { if (String.IsNullOrWhiteSpace(txtLMType.Text)) { MessageBox.Show("Please enter Land Mark Type!", "Land Mark Type Update", MessageBoxButtons.OK, MessageBoxIcon.Error); } else { objSetting = new SettingClassBLL(); if (objSetting.CheckLandMarkType(txtLMType.Text) == false) { objSetting = new SettingClassBLL() { landMarkType = txtLMType.Text, existLandMarkType = dgvLandMarkType.CurrentRow.Cells[0].Value.ToString() }; objSetting.UpdateLandMarkType(); MessageBox.Show("Land Mark Type update successful!", "Land Mark Type Update", MessageBoxButtons.OK, MessageBoxIcon.Information); LoadLandMarTypekData(); ClearTextBoxces(); } else { MessageBox.Show("Surveyor Type exist!", "Surveyor Type Update", MessageBoxButtons.OK, MessageBoxIcon.Error); ClearTextBoxces(); } } btnLMTypeAdd.Text = "Add"; } catch (Exception ex) { MessageBox.Show(ex.Message, "Division Error", MessageBoxButtons.OK, MessageBoxIcon.Error); } }