Example #1
0
 /// <summary>
 /// Function to save
 /// </summary>
 public void SaveFunction()
 {
     try
     {
         GodownInfo infoGodown = new GodownInfo();
         GodownSP   spGodown   = new GodownSP();
         infoGodown.GodownName = txtGodownName.Text.Trim();
         infoGodown.Narration  = txtNarration.Text.Trim();
         infoGodown.Extra1     = string.Empty;
         infoGodown.Extra2     = string.Empty;
         if (spGodown.GodownCheckIfExist(txtGodownName.Text.Trim(), 0) == false)
         {
             decIdForOtherForms = spGodown.GodownAddWithoutSameName(infoGodown);
             RackAddCurrespondingtoGodown();
             if (decIdForOtherForms > 0)
             {
                 Messages.SavedMessage();
                 Clear();
             }
         }
         else
         {
             Messages.InformationMessage("Godown name already exist");
             txtGodownName.Focus();
         }
     }
     catch (Exception ex)
     {
         MessageBox.Show("G4:" + ex.Message, "OpenMiracle", MessageBoxButtons.OK, MessageBoxIcon.Information);
     }
 }
Example #2
0
 /// <summary>
 /// Function to fill datagridview
 /// </summary>
 public void Gridfill()
 {
     try
     {
         DataTable dtblGodown = new DataTable();
         GodownSP  spGodown   = new GodownSP();
         dtblGodown           = spGodown.GodownOnlyViewAll();
         dgvGodown.DataSource = dtblGodown;
     }
     catch (Exception ex)
     {
         MessageBox.Show("G7:" + ex.Message, "OpenMiracle", MessageBoxButtons.OK, MessageBoxIcon.Information);
     }
 }
Example #3
0
 /// <summary>
 /// Function to fill cmbGodown
 /// </summary>
 public void FillGodownCombo()
 {
     try
     {
         GodownSP  spGodown   = new GodownSP();
         DataTable dtblGodown = new DataTable();
         dtblGodown              = spGodown.GodownViewAll();
         cmbGodown.DataSource    = dtblGodown;
         cmbGodown.ValueMember   = "godownId";
         cmbGodown.DisplayMember = "godownName";
     }
     catch (Exception ex)
     {
         MessageBox.Show("R1:" + ex.Message, "OpenMiracle", MessageBoxButtons.OK, MessageBoxIcon.Information);
     }
 }
Example #4
0
 /// <summary>
 /// Function to fill cmbGodownSearch
 /// </summary>
 public void FillSearchCombo()
 {
     try
     {
         GodownSP  spGodown   = new GodownSP();
         DataTable dtblGodown = new DataTable();
         dtblGodown = spGodown.GodownViewAll();
         cmbGodownSearch.DataSource = dtblGodown;
         DataRow dr = dtblGodown.NewRow();
         dr[1] = "All";
         dtblGodown.Rows.InsertAt(dr, 0);
         cmbGodownSearch.ValueMember   = "godownId";
         cmbGodownSearch.DisplayMember = "godownName";
     }
     catch (Exception ex)
     {
         MessageBox.Show("R2:" + ex.Message, "OpenMiracle", MessageBoxButtons.OK, MessageBoxIcon.Information);
     }
 }
Example #5
0
 /// <summary>
 /// Function to fill controls for update
 /// </summary>
 public void FillControls()
 {
     try
     {
         GodownInfo infoGodown = new GodownInfo();
         GodownSP   spGodown   = new GodownSP();
         infoGodown         = spGodown.GodownWithNarrationView(Convert.ToDecimal(dgvGodown.CurrentRow.Cells[1].Value.ToString()));
         txtGodownName.Text = infoGodown.GodownName;
         txtNarration.Text  = infoGodown.Narration;
         btnSave.Text       = "Update";
         btnDelete.Enabled  = true;
         decGodownId        = infoGodown.GodownId;
         strGodownName      = infoGodown.GodownName;
     }
     catch (Exception ex)
     {
         MessageBox.Show("G11:" + ex.Message, "OpenMiracle", MessageBoxButtons.OK, MessageBoxIcon.Information);
     }
 }
Example #6
0
 /// <summary>
 /// Function to fill Godown Combobox
 /// </summary>
 public void GodownComboFill()
 {
     try
     {
         GodownSP  spGodown = new GodownSP();
         DataTable dtbl     = new DataTable();
         dtbl = spGodown.GodownViewAll();
         DataRow drowSelect = dtbl.NewRow();
         drowSelect[0] = 0;
         drowSelect[1] = "All";
         dtbl.Rows.InsertAt(drowSelect, 0);
         cmbGodown.DataSource    = dtbl;
         cmbGodown.DisplayMember = "godownName";
         cmbGodown.ValueMember   = "godownId";
     }
     catch (Exception ex)
     {
         MessageBox.Show("PS:06" + ex.Message, "OpenMiracle", MessageBoxButtons.OK, MessageBoxIcon.Information);
     }
 }
Example #7
0
 /// <summary>
 /// Function to Edit
 /// </summary>
 public void EditFunction()
 {
     try
     {
         GodownInfo infoGodown = new GodownInfo();
         GodownSP   spGodown   = new GodownSP();
         infoGodown.GodownName = txtGodownName.Text.Trim();
         infoGodown.Narration  = txtNarration.Text.Trim();
         infoGodown.Extra1     = string.Empty;
         infoGodown.Extra2     = string.Empty;
         infoGodown.GodownId   = Convert.ToDecimal(dgvGodown.CurrentRow.Cells["dgvtxtGodownId"].Value.ToString());
         if (txtGodownName.Text != strGodownName)
         {
             if (spGodown.GodownCheckIfExist(txtGodownName.Text.Trim(), decGodownId) == false)
             {
                 if (spGodown.GodownEditParticularField(infoGodown))
                 {
                     Messages.UpdatedMessage();
                     Clear();
                 }
             }
             else
             {
                 Messages.InformationMessage("Godown name already exist");
                 txtGodownName.Focus();
             }
         }
         else
         {
             spGodown.GodownEditParticularField(infoGodown);
             Messages.UpdatedMessage();
             Clear();
         }
     }
     catch (Exception ex)
     {
         MessageBox.Show("G5:" + ex.Message, "OpenMiracle", MessageBoxButtons.OK, MessageBoxIcon.Information);
     }
 }
Example #8
0
 /// <summary>
 /// Function to delete
 /// </summary>
 public void DeleteFunction()
 {
     try
     {
         GodownSP spGodown = new GodownSP();
         if (spGodown.GodownCheckReferenceAndDelete(decGodownId) <= 0)
         {
             Messages.ReferenceExistsMessage();
         }
         else
         {
             // spGodown.GodownDelete(Convert.ToDecimal(dgvGodown.CurrentRow.Cells[1].Value.ToString()));
             //spGodown.GodownDelete(Convert.ToDecimal(dgvGodown.CurrentRow.Cells["dgvtxtGodownId"].Value.ToString()));
             Clear();
             btnSave.Text = "Save";
             Messages.DeletedMessage();
         }
     }
     catch (Exception ex)
     {
         MessageBox.Show("G8:" + ex.Message, "OpenMiracle", MessageBoxButtons.OK, MessageBoxIcon.Information);
     }
 }