/// <summary>
 /// Function to fill Designation combobox
 /// </summary>
 public void DesignationComboFill()
 {
     try
     {
         //DesignationSP SpDesignation = new DesignationSP();
         DesiginationBll  bllDesigination    = new DesiginationBll();
         List <DataTable> listObjDesignation = new List <DataTable>();
         listObjDesignation        = bllDesigination.DesignationViewAll();
         cmbDesignation.DataSource = listObjDesignation[0];
         if (listObjDesignation[0].Rows.Count > 0)
         {
             cmbDesignation.ValueMember   = "designationId";
             cmbDesignation.DisplayMember = "designationName";
             DataRow drRow = listObjDesignation[0].NewRow();
             drRow["designationId"]   = "0";
             drRow["designationName"] = "All";
             listObjDesignation[0].Rows.InsertAt(drRow, 0);
             cmbDesignation.SelectedValue = "0";
         }
     }
     catch (Exception ex)
     {
         MessageBox.Show("ER2:" + ex.Message, "OpenMiracle", MessageBoxButtons.OK, MessageBoxIcon.Information);
     }
 }
Ejemplo n.º 2
0
 /// <summary>
 /// Function to fill Datagridview on Search
 /// </summary>
 private void Search()
 {
     try
     {
         //DesignationSP spDesignation = new DesignationSP();
         DesiginationBll bllDesigination = new DesiginationBll();
         dgvDesignation.DataSource = bllDesigination.DesignationSearch(txtSearch.Text);
     }
     catch (Exception ex)
     {
         MessageBox.Show("D5:" + ex.Message, "OpenMiracle", MessageBoxButtons.OK, MessageBoxIcon.Information);
     }
 }
Ejemplo n.º 3
0
 /// <summary>
 /// Function to fill Datagridview
 /// </summary>
 private void GridFill()
 {
     try
     {
         //DesignationSP spDesignation = new DesignationSP();
         DesiginationBll  bllDesigination = new DesiginationBll();
         List <DataTable> listObj         = new List <DataTable>();
         listObj = bllDesigination.DesignationViewForGridFill();
         dgvDesignation.DataSource = listObj[0];
     }
     catch (Exception ex)
     {
         MessageBox.Show("D3:" + ex.Message, "OpenMiracle", MessageBoxButtons.OK, MessageBoxIcon.Information);
     }
 }
Ejemplo n.º 4
0
        /// <summary>
        /// Function for Delete
        /// </summary>
        private void Delete()
        {
            try
            {
                if (PublicVariables.isMessageDelete)
                {
                    if (Messages.DeleteMessage() == true)
                    {
                        bool isDeleteStatus = false;
                        //DesignationSP spDestination = new DesignationSP();
                        DesiginationBll bllDesigination = new DesiginationBll();
                        isDeleteStatus = bllDesigination.DesignationDelete(decDesignationId);
                        if (isDeleteStatus == true)
                        {
                            Messages.DeletedMessage();
                            Clear();
                            GridFill();
                        }
                        else
                        {
                            Messages.ReferenceExistsMessage();
                        }
                    }
                }

                else
                {
                    bool isDeleteStatus = false;
                    //DesignationSP spDestination = new DesignationSP();
                    DesiginationBll bllDesigination = new DesiginationBll();
                    isDeleteStatus = bllDesigination.DesignationDelete(decDesignationId);
                    if (isDeleteStatus == true)
                    {
                        Messages.DeletedMessage();
                        Clear();
                        GridFill();
                    }
                    else
                    {
                        Messages.ReferenceExistsMessage();
                    }
                }
            }
            catch (Exception ex)
            {
                MessageBox.Show("D2:" + ex.Message, "OpenMiracle", MessageBoxButtons.OK, MessageBoxIcon.Information);
            }
        }
Ejemplo n.º 5
0
 /// <summary>
 /// Function to check existence of Designation
 /// </summary>
 /// <param name="strDesignation"></param>
 /// <param name="decDesignationId"></param>
 /// <returns></returns>
 public bool CheckExistanceOfDesignation(string strDesignation, decimal decDesignationId)
 {
     try
     {
         bool isExist = false;
         //DesignationSP spDesignation = new DesignationSP();
         DesiginationBll bllDesigination = new DesiginationBll();
         isExist = bllDesigination.DesignationCheckExistanceOfName(strDesignation, decDesignationId);
         return(isExist);
     }
     catch (Exception ex)
     {
         MessageBox.Show("D7:" + ex.Message, "OpenMiracle", MessageBoxButtons.OK, MessageBoxIcon.Information);
     }
     return(false);
 }
Ejemplo n.º 6
0
 /// <summary>
 /// Function for save
 /// </summary>
 private void SaveFunction()
 {
     try
     {
         DesignationInfo infoDesignation = new DesignationInfo();
         //DesignationSP spDesignation = new DesignationSP();
         DesiginationBll bllDesigination = new DesiginationBll();
         if (txtAdvanceAmount.Text == string.Empty)
         {
             infoDesignation.AdvanceAmount = 0;
         }
         else
         {
             infoDesignation.AdvanceAmount = Convert.ToDecimal(txtAdvanceAmount.Text.Trim());
         }
         infoDesignation.DesignationName = txtDesignationName.Text.Trim();
         if (txtCLInMonth.Text == string.Empty)
         {
             infoDesignation.LeaveDays = 0;
         }
         else
         {
             infoDesignation.LeaveDays = Convert.ToDecimal(txtCLInMonth.Text.Trim());
         }
         decimal decD = infoDesignation.LeaveDays;
         infoDesignation.Narration = txtNarration.Text.Trim();
         infoDesignation.Extra1    = string.Empty;
         infoDesignation.Extra2    = string.Empty;
         infoDesignation.ExtraDate = DateTime.Now;
         if (CheckExistanceOfDesignation(txtDesignationName.Text.Trim(), 0) == false)
         {
             decIdentity = bllDesigination.DesignationAddWithReturnIdentity(infoDesignation);
             if (decIdentity > 0)
             {
                 Messages.SavedMessage();
             }
         }
         else
         {
             Messages.InformationMessage("Designation already exist");
         }
     }
     catch (Exception ex)
     {
         MessageBox.Show("D8:" + ex.Message, "OpenMiracle", MessageBoxButtons.OK, MessageBoxIcon.Information);
     }
 }
Ejemplo n.º 7
0
 /// <summary>
 /// Function for Edit
 /// </summary>
 private void EditFunction()
 {
     try
     {
         DesignationInfo infoDesignation = new DesignationInfo();
         //DesignationSP spDesignation = new DesignationSP();
         DesiginationBll bllDesigination = new DesiginationBll();
         if (txtAdvanceAmount.Text == string.Empty)
         {
             infoDesignation.AdvanceAmount = 0;
         }
         else
         {
             infoDesignation.AdvanceAmount = Convert.ToDecimal(txtAdvanceAmount.Text.Trim());
         }
         infoDesignation.DesignationName = txtDesignationName.Text.TrimEnd();
         if (txtCLInMonth.Text == string.Empty)
         {
             infoDesignation.LeaveDays = 0;
         }
         else
         {
             infoDesignation.LeaveDays = Convert.ToDecimal(txtCLInMonth.Text.Trim());
         }
         infoDesignation.Narration = txtNarration.Text.Trim();
         infoDesignation.Extra1    = string.Empty;
         infoDesignation.Extra2    = string.Empty;
         infoDesignation.ExtraDate = DateTime.Now;
         if (CheckExistanceOfDesignation(txtDesignationName.Text.Trim(), decDesignationId) == false)
         {
             infoDesignation.DesignationId = decDesignationId;
             if (bllDesigination.DesignationEdit(infoDesignation))
             {
                 Messages.UpdatedMessage();
             }
         }
         else
         {
             Messages.InformationMessage("Designation already exist");
         }
     }
     catch (Exception ex)
     {
         MessageBox.Show("D9:" + ex.Message, "OpenMiracle", MessageBoxButtons.OK, MessageBoxIcon.Information);
     }
 }
Ejemplo n.º 8
0
 /// <summary>
 /// Function to fill Designation combobox
 /// </summary>
 public void DesignationComboFill()
 {
     try
     {
         //DesignationSP spDesigantion = new DesignationSP();
         DesiginationBll  bllDesigination = new DesiginationBll();
         List <DataTable> listObj         = bllDesigination.DesignationViewAll();
         DataRow          dr = listObj[0].NewRow();
         dr[1] = "All";
         listObj[0].Rows.InsertAt(dr, 0);
         cmbDesignation.DataSource    = listObj[0];
         cmbDesignation.ValueMember   = "designationId";
         cmbDesignation.DisplayMember = "designationName";
     }
     catch (Exception ex)
     {
         MessageBox.Show("MSR:3" + ex.Message, "Open Miracle", MessageBoxButtons.OK, MessageBoxIcon.Information);
     }
 }
Ejemplo n.º 9
0
 /// <summary>
 /// Function to fill controls fpor update
 /// </summary>
 private void FillControls()
 {
     try
     {
         DesignationInfo infoDesignaion = new DesignationInfo();
         //DesignationSP spDesignation = new DesignationSP();
         DesiginationBll bllDesigination = new DesiginationBll();
         infoDesignaion          = bllDesigination.DesignationView(decDesignationId);
         txtDesignationName.Text = infoDesignaion.DesignationName;
         txtCLInMonth.Text       = infoDesignaion.LeaveDays.ToString();
         txtAdvanceAmount.Text   = infoDesignaion.AdvanceAmount.ToString();
         txtNarration.Text       = infoDesignaion.Narration;
         btnSave.Text            = "Update";
     }
     catch (Exception ex)
     {
         MessageBox.Show("D6:" + ex.Message, "OpenMiracle", MessageBoxButtons.OK, MessageBoxIcon.Information);
     }
 }