/// <summary> /// Function to save new rack /// </summary> public void SaveFunction() { try { RackSP spRack = new RackSP(); RackInfo rackInfo = new RackInfo(); rackInfo.RackName = txtRackName.Text.Trim(); rackInfo.GodownId = Convert.ToDecimal(cmbGodown.SelectedValue.ToString()); rackInfo.Narration = txtNarration.Text.Trim(); rackInfo.ExtraDate = DateTime.Now; rackInfo.Extra1 = string.Empty; rackInfo.Extra2 = string.Empty; decimal decGodounId = Convert.ToDecimal(cmbGodown.SelectedValue.ToString()); if (spRack.RackCheckExistence(txtRackName.Text.Trim(), 0, decGodounId) == false) { decIdForOtherForms = spRack.RackAdd(rackInfo); if (decIdForOtherForms > 0) { Messages.SavedMessage(); Clear(); } } else { Messages.InformationMessage(" Rack name already exist"); txtRackName.Focus(); } } catch (Exception ex) { MessageBox.Show("R7:" + ex.Message, "OpenMiracle", MessageBoxButtons.OK, MessageBoxIcon.Information); } }
public bool RackCheckExistence(string strRackName, decimal decRackId, decimal decGodownId) { bool isEdit = false; try { isEdit = SPRack.RackCheckExistence(strRackName, decRackId, decGodownId); } catch (Exception ex) { MessageBox.Show("RackBll 12:" + ex.Message, "OpenMiracle", MessageBoxButtons.OK, MessageBoxIcon.Information); } return(isEdit); }
/// <summary> /// Function to check rack name alredy exist or not /// </summary> /// <returns></returns> public bool CheckExistenceOfRackName() { bool isExist = false; try { RackSP spRack = new RackSP(); isExist = spRack.RackCheckExistence(txtRackName.Text.Trim(), 0, Convert.ToDecimal(cmbGodown.SelectedValue.ToString())); if (isExist) { string strRackNames = txtRackName.Text.Trim(); if (strRackNames.ToLower() == strRackName.ToLower()) { isExist = false; } } } catch (Exception ex) { MessageBox.Show("R6:" + ex.Message, "OpenMiracle", MessageBoxButtons.OK, MessageBoxIcon.Information); } return(isExist); }