/// <summary> /// Function to save new rack /// </summary> public void SaveFunction() { try { RackBll BllRack = new RackBll(); RackInfo InfoRack = new RackInfo(); InfoRack.RackName = txtRackName.Text.Trim(); InfoRack.GodownId = Convert.ToDecimal(cmbGodown.SelectedValue.ToString()); InfoRack.Narration = txtNarration.Text.Trim(); InfoRack.ExtraDate = DateTime.Now; InfoRack.Extra1 = string.Empty; InfoRack.Extra2 = string.Empty; decimal decGodounId = Convert.ToDecimal(cmbGodown.SelectedValue.ToString()); if (BllRack.RackCheckExistence(txtRackName.Text.Trim(), 0, decGodounId) == false) { decIdForOtherForms = BllRack.RackAdd(InfoRack); 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); } }
/// <summary> /// Function to Save Rack /// </summary> public void RackAddCurrespondingtoGodown() { try { RackBll BllRack = new RackBll(); RackInfo infoRack = new RackInfo(); infoRack.RackName = "NA"; infoRack.GodownId = decIdForOtherForms; infoRack.Narration = string.Empty; infoRack.Extra1 = string.Empty; infoRack.Extra2 = string.Empty; infoRack.ExtraDate = DateTime.Now; BllRack.RackAdd(infoRack); } catch (Exception ex) { MessageBox.Show("G3:" + ex.Message, "OpenMiracle", MessageBoxButtons.OK, MessageBoxIcon.Information); } }