Exemplo n.º 1
0
        protected void lkbSave_Click(object sender, EventArgs e)
        {
            try
            {
                MST_STOPNAME sTOPNAME = new MST_STOPNAME();
                if (ddlRouteName.SelectedIndex > 0)
                {
                    sTOPNAME.RouteId      = Convert.ToInt32(ddlRouteName.SelectedValue);
                    sTOPNAME.StopName     = txtStopName.Text.Trim();
                    sTOPNAME.PickUpTiming = DateTime.ParseExact(txtPickUpTime.Text.Trim(), "hh:mm tt", CultureInfo.InvariantCulture).TimeOfDay; //TimeSpan.Parse();
                    sTOPNAME.DropTiming   = DateTime.ParseExact(txtDropTime.Text.Trim(), "hh:mm tt", CultureInfo.InvariantCulture).TimeOfDay;   // TimeSpan.Parse(txtDropTime.Text.Trim());
                    sTOPNAME.Org_Id       = cls_Common.UserProfile.ORG_ID;

                    bool isSave = stoppage_Name.Save(sTOPNAME);
                    if (isSave)
                    {
                        ClearItems();
                        ShowMessage("Stoppage Name saved Successfully..", true);
                        stoppage_Name = new cls_Stoppage_Name();
                        RefreshDataItems();
                    }

                    else
                    {
                        ShowMessage("Some error found..", false);
                    }
                }
            }
            catch (Exception ex)
            {
                throw ex;
            }
        }
Exemplo n.º 2
0
 public bool Save(MST_STOPNAME data)
 {
     try
     {
         unitOfWork.StoppageRepository.Create(data);
         unitOfWork.Save();
         return(true);
     }
     catch (Exception ex)
     { return(false); }
 }