private void btnDeleteOther_Click(object sender, EventArgs e)
 {
     if (MessageBox.Show("Are you sure, you want to delete this record?", "Delete", MessageBoxButtons.YesNo, MessageBoxIcon.Question) == DialogResult.Yes)
     {
         if (this.Text == "Festivals Master")
         {
             Festivals festivals = getFestivalsData();
             if (_otherItems.Delete(festivals))
             {
                 _otherItems.LoadData(dtGridOther);
             }
         }
         else if (this.Text == "CRM Groups")
         {
             CRMGroup crmGroup = getCRMGroupData();
             if (_otherItems.Delete(crmGroup))
             {
                 _otherItems.LoadData(dtGridOther);
             }
         }
         else if (this.Text == "Areas")
         {
             Area area = getAreaData();
             if (_otherItems.Delete(area))
             {
                 _otherItems.LoadData(dtGridOther);
             }
         }
     }
 }
        public IList <Festivals> Get()
        {
            try
            {
                Logger.LogInfo("Get: Festival process start");
                IList <Festivals> lstFestivals = new List <Festivals>();

                DataTable dtAppConfig = DataBase.DBService.ExecuteCommand(string.Format(SELECT_ALL));
                foreach (DataRow dr in dtAppConfig.Rows)
                {
                    Festivals Festivals = convertToFestivalsObject(dr);
                    lstFestivals.Add(Festivals);
                }
                Logger.LogInfo("Get: Festival process completed.");
                return(lstFestivals);
            }
            catch (Exception ex)
            {
                StackTrace st = new StackTrace();
                StackFrame sf = st.GetFrame(0);
                MethodBase currentMethodName = sf.GetMethod();
                LogDebug(currentMethodName.Name, ex);
                return(null);
            }
        }
Пример #3
0
 public FixedDeposit(string name, double principle, int year, Festivals festival)
 {
     _name      = name;
     _principle = principle;
     _year      = year;
     _festival  = festival;
 }
        private Festivals convertToFestivalsObject(DataRow dr)
        {
            Festivals festivals = new Festivals();

            festivals.Religion = dr.Field <string>("Religion");
            festivals.Name     = dr.Field <string>("Name");
            return(festivals);
        }
Пример #5
0
 public HttpResponseMessage Get(DateTime startDate, string minPrice = "", string maxPrice = "")
 {
     string date = startDate.ToString("yyyy-MM-dd");
        // var musicFestivals = Provider.QuerryFestivals(minPrice, maxPrice, date, "music").events.@event;
     var festivals = Provider.QuerryFestivals(minPrice,maxPrice,date,"festival").events.@event;
     var myFestivals = new Festivals(festivals, date, minPrice, maxPrice);
        // var myMusicFestivals = new Festivals(musicFestivals, date, minPrice, maxPrice);
     return new HttpResponseMessage
     {
         Content = new JsonContent(myFestivals)//.Concat(myMusicFestivals))
     };
 }
        private Festivals getFestivalsData()
        {
            Festivals festivals = new Festivals();

            festivals.Name        = txtName.Text;
            festivals.Religion    = txtReligion.Text;
            festivals.CreatedOn   = DateTime.Parse(DateTime.Now.ToString("yyyy-MM-dd hh:mm:ss"));
            festivals.CreatedBy   = Program.CurrentUser.Id;
            festivals.UpdatedOn   = DateTime.Parse(DateTime.Now.ToString("yyyy-MM-dd hh:mm:ss"));
            festivals.UpdatedBy   = Program.CurrentUser.Id;
            festivals.MachineName = Environment.MachineName;
            return(festivals);
        }
        private void saveFestivals()
        {
            Festivals festivals = getFestivalsData();

            if (_otherItems.Save(festivals))
            {
                MessageBox.Show("Record save successfully.", "Record Saved", MessageBoxButtons.OK, MessageBoxIcon.Information);
                _otherItems.LoadData(dtGridOther);
                grpItem.Enabled = false;
            }
            else
            {
                MessageBox.Show("Unable to save record.", "Error", MessageBoxButtons.OK, MessageBoxIcon.Error);
            }
        }
 public void Delete(Festivals Festivals)
 {
     try
     {
         DataBase.DBService.ExecuteCommand(string.Format(DELETE_BY_ID, Festivals.Name));
         Activity.ActivitiesService.Add(ActivityType.DeleteFestivals, EntryStatus.Success,
                                        Source.Server, Festivals.UpdatedByUserName, Festivals.Name, Festivals.MachineName);
     }
     catch (Exception ex)
     {
         StackTrace st = new StackTrace();
         StackFrame sf = st.GetFrame(0);
         MethodBase currentMethodName = sf.GetMethod();
         LogDebug(currentMethodName.Name, ex);
         throw ex;
     }
 }
Пример #9
0
        public Result Delete(Festivals Festivals)
        {
            var result = new Result();

            try
            {
                FestivalsService FestivalsService = new FestivalsService();
                FestivalsService.Delete(Festivals);
                result.IsSuccess = true;
            }
            catch (Exception exception)
            {
                result.IsSuccess     = false;
                result.ExceptionInfo = exception;
            }
            return(result);
        }
        public bool Add(Festivals festivals)
        {
            try
            {
                FinancialPlanner.Common.JSONSerialization jsonSerialization = new FinancialPlanner.Common.JSONSerialization();
                string apiurl = Program.WebServiceUrl + "/" + ADD_FESTIVAL_API;

                RestAPIExecutor restApiExecutor = new RestAPIExecutor();

                var restResult = restApiExecutor.Execute <Festivals>(apiurl, festivals, "POST");

                return(true);
            }
            catch (Exception ex)
            {
                StackTrace st = new StackTrace();
                StackFrame sf = st.GetFrame(0);
                MethodBase currentMethodName = sf.GetMethod();
                LogDebug(currentMethodName.Name, ex);
                return(false);
            }
        }
        public void Add(Festivals Festivals)
        {
            try
            {
                //string clientName = DataBase.DBService.ExecuteCommandScalar(string.Format(GET_CLIENT_NAME_QUERY,Festivals.Cid));

                DataBase.DBService.ExecuteCommand(string.Format(INSERT_QUERY,
                                                                Festivals.Religion, Festivals.Name,
                                                                Festivals.CreatedOn.ToString("yyyy-MM-dd hh:mm:ss"), Festivals.CreatedBy,
                                                                Festivals.UpdatedOn.ToString("yyyy-MM-dd hh:mm:ss"), Festivals.UpdatedBy));

                Activity.ActivitiesService.Add(ActivityType.CreateFestivals, EntryStatus.Success,
                                               Source.Server, Festivals.UpdatedByUserName, Festivals.Name, Festivals.MachineName);
            }
            catch (Exception ex)
            {
                StackTrace st = new StackTrace();
                StackFrame sf = st.GetFrame(0);
                MethodBase currentMethodName = sf.GetMethod();
                LogDebug(currentMethodName.Name, ex);
                throw ex;
            }
        }
        public bool Save(object obj)
        {
            Festivals fest = (Festivals)obj;

            return(_festivalsInfo.Add(fest));
        }
        public bool Delete(object obj)
        {
            Festivals fest = (Festivals)obj;

            return(_festivalsInfo.Delete(fest));
        }