예제 #1
0
        private void btnSave_Click(object sender, EventArgs e)
        {
            if (cbxMainunit.Text.Equals(string.Empty))
            {
                MessageBox.Show("MainUnit Name can not be blank!");
                return;
            }
            UnitConversionModel objUnitCon = new UnitConversionModel();

            objUnitCon.MainUnit  = cbxMainunit.SelectedItem.ToString();
            objUnitCon.SubUnit   = cbxSubunit.SelectedItem.ToString();
            objUnitCon.ConFactor = Convert.ToDecimal(cbxConfactor.Text.Trim());

            bool isSuccess = objunc.SaveUC(objUnitCon);

            if (isSuccess)
            {
                MessageBox.Show("Saved Successfully!");
                ClearControls();
            }

            //List<eSunSpeedDomain.UnitConversionModel> lstGroups = objunc.GetListofUnitConversions();
            //dgvList.DataSource = lstGroups;

            //Dialogs.PopUPDialog d = new Dialogs.PopUPDialog("Saved Successfully!");
            //d.ShowDialog();
        }
예제 #2
0
        private void btnSave_Click(object sender, EventArgs e)
        {
            if (cbxMainunit.Text.Equals(string.Empty))
            {
                MessageBox.Show("MainUnit Name can not be blank!");
                return;
            }
            UnitConversionModel objUnitCon = new UnitConversionModel();

            //if (objUnitCon.IsGroupExists(tbxGroupName.Text.Trim()))
            //{
            //    MessageBox.Show("Group Name already Exists!", "SunSpeed", MessageBoxButtons.RetryCancel);
            //    cbxUnderGrp.Focus();
            //    return;
            //}
            objUnitCon.MainUnit  = cbxMainunit.Text.Trim();
            objUnitCon.SubUnit   = tbxSubunit.Text.Trim();
            objUnitCon.ConFactor = Convert.ToDecimal(cbxConfactor.Text.Trim());

            bool isSuccess = objunc.SaveUC(objUnitCon);

            if (isSuccess)
            {
                MessageBox.Show("Saved Successfully!");
            }
            //List<eSunSpeedDomain.UnitConversionModel> lstGroups = objunc.GetListofUnitConversions();
            //dgvList.DataSource = lstGroups;

            //Dialogs.PopUPDialog d = new Dialogs.PopUPDialog("Saved Successfully!");
            //d.ShowDialog();
        }