예제 #1
0
        private void SaveData()
        {
            var dt  = new ObjectParameter("TranDT", typeof(DateTime));
            var res = new ObjectParameter("Result", typeof(int));

            int?iLightingStudyId = null;

            if (LightingStudyId != "")
            {
                iLightingStudyId = Convert.ToInt32(LightingStudyId);
            }

            int?rowId = null;

            DateTime?dtSop = (Sop != "") ? Convert.ToDateTime(Sop) : DateTime.Now;

            try
            {
                _context.usp_QT_LightingStudy_QuoteNumbers_Update(QuoteNumber, Application, iLightingStudyId, Program, LedHarness, dtSop, rowId, dt, res);
            }
            catch (Exception ex)
            {
                string exceptionMsg = (ex.InnerException != null) ? ex.InnerException.Message : ex.Message;
                string error        = (Program != "")
                        ? string.Format("Failed to save quote to lighting application {0}, program {1}, led/harness, {2} sop {3}.  ", Application, Program, LedHarness, Sop)
                        : string.Format("Failed to save quote to lighting application {0}.  ", Application);

                MessageBox.Show(error + exceptionMsg, "Error at SaveData()");
            }
        }