Esempio n. 1
0
 /// <summary>
 /// Function to save the new route
 /// </summary>
 public void SaveFunction()
 {
     try
     {
         RouteSP   spRoute   = new RouteSP();
         RouteInfo infoRoute = new RouteInfo();
         infoRoute.RouteName = txtRouteName.Text.Trim();
         infoRoute.AreaId    = Convert.ToDecimal(cmbArea.SelectedValue.ToString());
         infoRoute.Narration = txtNarration.Text.Trim();
         infoRoute.Extra1    = String.Empty;
         infoRoute.Extra2    = String.Empty;
         if (spRoute.RouteCheckExistence(txtRouteName.Text.Trim(), 0, Convert.ToDecimal(cmbArea.SelectedValue.ToString())) == false)
         {
             decRoute = spRoute.RouteAddParticularFields(infoRoute);
             {
                 Messages.SavedMessage();
                 Clear();
                 GridFill();
                 if (frmCustomerobj != null)
                 {
                     this.Close();
                 }
             }
         }
         else
         {
             Messages.InformationMessage(" Route name already exist");
             txtRouteName.Focus();
         }
     }
     catch (Exception ex)
     {
         MessageBox.Show("RT4" + ex.Message, "OpenMiracle", MessageBoxButtons.OK, MessageBoxIcon.Information);
     }
 }
        /// <summary>
        /// Function to insert values to Route Table
        /// </summary>
        /// <param name="routeinfo"></param>
        /// <returns></returns>
        public decimal RouteAddParticularFields(RouteInfo routeinfo)
        {
            decimal decAreaId = 0;

            try
            {
                decAreaId = spRoute.RouteAddParticularFields(routeinfo);
            }
            catch (Exception ex)
            {
                MessageBox.Show("RT10:" + ex.Message, "OpenMiracle", MessageBoxButtons.OK, MessageBoxIcon.Information);
            }
            return(decAreaId);
        }