Ejemplo n.º 1
0
        public object GetEventBySearchText(string searchText)
        {
            dynamic       TBGroupResult;
            List <object> EventsListResult = new List <object>();

            if (string.IsNullOrEmpty(searchText))
            {
                searchText = "";
            }
            try
            {
                List <EventsDetail> Result = EventMaster.GetEventBySearchText(searchText);
                for (int i = 0; i < Result.Count; i++)
                {
                    EventsListResult.Add(new { EventList = Result[i] });
                }
                if (Result != null)
                {
                    TBGroupResult = new { status = "0", message = "success", EventsListResult = EventsListResult };
                }
                else
                {
                    TBGroupResult = new { status = "0", message = "Record not found" };
                }
            }
            catch
            {
                TBGroupResult = new { status = "1", message = "failed" };
            }
            return(new { TBGroupResult });
        }
Ejemplo n.º 2
0
        public EventMaster GetEventMasterRecord(string recordID, string UserID)
        {
            SqlDataReader dr = null;

            try {
                EventMaster c = new EventMaster();

                //try
                //{
                SqlParameter[] Parameters = { new SqlParameter("@SNo", (recordID)), new SqlParameter("@UserID", Convert.ToInt32(UserID)) };
                dr = SqlHelper.ExecuteReader(ReadConnectionString.WebConfigConnectionString, CommandType.StoredProcedure, "GetRecordEventMaster", Parameters);
                if (dr.Read())
                {
                    c.SNo         = Convert.ToInt32(dr["SNo"]);
                    c.EventName   = dr["EventName"].ToString();
                    c.Description = dr["Description"].ToString();
                }
                //}
                //catch(Exception ex)//(Exception ex) (Exception ex)
                //{
                //    dr.Close();
                //}
                return(c);
            }
            catch (Exception ex)//(Exception ex)
            {
                dr.Close();
                throw ex;
            }
        }
Ejemplo n.º 3
0
        public EventMaster SelectEventMasterByID(int p_EventMasterID)
        {
            MySqlParameter[] parameters = new MySqlParameter[] {
                new MySqlParameter("p_eventid", p_EventMasterID)
            };
            DataTable   dt             = MySQLDB.MySQLDBHelper.ExecuteSelectCommand("GetEventMasterListByID", CommandType.StoredProcedure, parameters);
            EventMaster objEventMaster = null;

            if (dt.Rows.Count > 0)
            {
                DataRow dr = dt.Rows[0];
                objEventMaster                             = new EventMaster();
                objEventMaster.eventid                     = Convert.ToInt32(dr["eventid"].ToString());
                objEventMaster.startdate                   = Convert.ToDateTime(dr["startdate"].ToString());
                objEventMaster.enddate                     = Convert.ToDateTime(dr["enddate"].ToString());
                objEventMaster.locationid                  = Convert.ToInt32(dr["locationid"].ToString());
                objEventMaster.numberofguards              = Convert.ToInt32(dr["numberofguards"].ToString());
                objEventMaster.specialdutyforguard         = dr["specialdutyforguard"].ToString();
                objEventMaster.eventname                   = dr["eventname"].ToString();
                objEventMaster.notes                       = dr["notes"].ToString();
                objEventMaster.optionalguestlist           = dr["optionalguestlist"].ToString();
                objEventMaster.personinchargename          = dr["personinchargename"].ToString();
                objEventMaster.personinchargenric          = dr["personinchargenric"].ToString();
                objEventMaster.personinchargecontactnumber = dr["personinchargecontactnumber"].ToString();
                objEventMaster.DeploymentId                = Convert.ToInt32(dr["DeploymentId"].ToString());
                objEventMaster.Remarks                     = dr["Remarks"].ToString();
            }
            dt.Clear();
            dt.Dispose();
            return(objEventMaster);
        }
Ejemplo n.º 4
0
        private void ProcessFile(FileStream file, XRITHeader header, string outputFolder)
        {
            int bytesToRead = (int)(file.Length - header.PrimaryHeader.HeaderLength);

            var buffer = new byte[bytesToRead];

            file.Read(buffer, 0, bytesToRead);

            string outName = header.Filename.Replace(".lrit", ".txt");

            outName = Path.Combine(outputFolder, outName);

            var fo = File.OpenWrite(outName);

            fo.Write(buffer, 0, bytesToRead);
            fo.Close();

            EventMaster.Post(EventTypes.NewFileEvent, new NewFileReceivedEventData {
                Name     = Path.GetFileName(outName),
                Path     = outName,
                Metadata =
                {
                    { "product",      header.Product.Name             },
                    { "subProduct",   header.SubProduct.Name          },
                    { "productId",    header.Product.ID.ToString()    },
                    { "subProductId", header.SubProduct.ID.ToString() }
                }
            });
        }
Ejemplo n.º 5
0
        public object GetEventDetails(eventdtl eve)
        {
            dynamic       EventsListDetailResult;
            List <object> EventsDetailResult = new List <object>();

            try
            {
                var Result = EventMaster.GetEventDetails(eve.grpId, eve.eventID, eve.groupProfileID);

                for (int i = 0; i < Result.Count; i++)
                {
                    EventsDetailResult.Add(new { EventsDetail = Result[i] });
                }

                if (Result != null)
                {
                    EventsListDetailResult = new { status = "0", message = "success", EventsDetailResult };
                }
                else
                {
                    EventsListDetailResult = new { status = "0", message = "Record not found" };
                }
            }
            catch
            {
                EventsListDetailResult = new { status = "1", message = "failed" };
            }
            return(new { EventsListDetailResult });
        }
Ejemplo n.º 6
0
        public List <EventMaster> SelectEventMasters(int currentUserType, int deploymentId)
        {
            MySqlParameter[] parameters = new MySqlParameter[] {
                new MySqlParameter("currentUserType", currentUserType),
                new MySqlParameter("p_deploymentId", deploymentId)
            };
            List <EventMaster> OccurancesCol  = new List <EventMaster>();
            DataTable          dt             = MySQLDB.MySQLDBHelper.ExecuteSelectCommand("GetEventMasterList", CommandType.StoredProcedure, parameters);
            EventMaster        objEventMaster = null;

            foreach (DataRow dr in dt.Rows)
            {
                objEventMaster                             = new EventMaster();
                objEventMaster.eventid                     = Convert.ToInt32(dr["eventid"].ToString());
                objEventMaster.startdate                   = Convert.ToDateTime(dr["startdate"].ToString());
                objEventMaster.enddate                     = Convert.ToDateTime(dr["enddate"].ToString());
                objEventMaster.locationid                  = Convert.ToInt32(dr["locationid"].ToString());
                objEventMaster.numberofguards              = Convert.ToInt32(dr["numberofguards"].ToString());
                objEventMaster.specialdutyforguard         = dr["specialdutyforguard"].ToString();
                objEventMaster.eventname                   = dr["eventname"].ToString();
                objEventMaster.notes                       = dr["notes"].ToString();
                objEventMaster.optionalguestlist           = dr["optionalguestlist"].ToString();
                objEventMaster.personinchargename          = dr["personinchargename"].ToString();
                objEventMaster.personinchargenric          = dr["personinchargenric"].ToString();
                objEventMaster.personinchargecontactnumber = dr["personinchargecontactnumber"].ToString();
                objEventMaster.DeploymentId                = Convert.ToInt32(dr["DeploymentId"].ToString());
                objEventMaster.Remarks                     = dr["Remarks"].ToString();
                OccurancesCol.Add(objEventMaster);
            }
            dt.Clear();
            dt.Dispose();
            return(OccurancesCol);
        }
Ejemplo n.º 7
0
        public static void DeleteEvent(int Id)
        {
            EventMaster eventmaster = db.EventMasters.Find(Id);

            eventmaster.IsDeleted = true;
            UpdateEvent(eventmaster);
        }
Ejemplo n.º 8
0
    // Start is called before the first frame update
    void Start()
    {
        // Create the dictionaries / arraylists etc
        HUDobjects = new Dictionary <string, GameObject>();
        resources  = new Dictionary <string, int>();
        vars       = new Dictionary <string, double>();
        // Game is on by default
        progressActive = true;
        eventActivated = false;
        endingActive   = false;
        // Event trigger logic
        vars.Add("baseTimeToEvent", 6.0f);
        vars.Add("timeToEvent", 6.0f);
        vars.Add("eventSpeed", 1.0f);
        vars.Add("difficulty", 1.0f);
        vars.Add("distanceEarth", 200.0f);
        vars.Add("shipSpeed", 2.0f);
        vars.Add("timeToFuelClick", 3.0f);
        vars.Add("baseTimeToFuelClick", 3.0f);
        vars.Add("fuelConsumption", 1.0f);
        // Create the HUD
        CreateHUD();
        // Set default values for the various resources
        resources.Add("hull", 100);
        resources.Add("energy", 90);
        resources.Add("crew", 30);
        resources.Add("gameStatus", 0);
        // Dynamically allocated array of objects in space
        spaceObjects = new List <GameObject>();
        // Game specific variables

        // Game event master script
        em = this.GetComponent <EventMaster>();
    }
        private IEnumerable GetData(int SearchRecords, string SearchTitle, string Alpha, int CustomerId)
        {
            CustomerId = Convert.ToInt32(Session["CustomerId"]);

            List <EventMasterModel> eventlist = new List <EventMasterModel>();
            var eventdetails = CustomerService.GetCustomerEvents(SearchTitle, Alpha, CustomerId, "");

            foreach (var eventrec in eventdetails)
            {
                EventMasterModel eventMasterModel = new EventMasterModel();
                eventMasterModel.EventId        = eventrec.EventId;
                eventMasterModel.EventName      = eventrec.EventName;
                eventMasterModel.EventURL       = eventrec.DomainName;
                eventMasterModel.Description    = eventrec.Description;
                eventMasterModel.EventStartDate = eventrec.EventStartDate.ToShortDateString();
                eventMasterModel.EventEndDate   = eventrec.EventEndDate.ToShortDateString();
                EventMaster eventmaster = EventService.GetEventById(eventrec.EventId);
                string      path        = "../Images/EventLogo/" + eventmaster.LogoUrl;
                eventMasterModel.Image              = path;
                eventMasterModel.ImageName          = eventrec.LogoUrl;
                eventMasterModel.ContactPersonName  = eventrec.ContactPersonName;
                eventMasterModel.ContactPersonPhone = eventrec.ContactPersonPhone;
                eventMasterModel.ContactPersonEmail = eventrec.ContactPersonEmail;
                eventMasterModel.RegisteredUsers    = Convert.ToInt32(eventrec.TotalCount);
                eventMasterModel.Linkedinusers      = Convert.ToInt32(eventrec.LinkedinUsers);
                eventMasterModel.Facebookusers      = Convert.ToInt32(eventrec.FacebookUsers);
                eventMasterModel.Referralusers      = RegisteredUserService.GetReferralIByEventId(eventrec.EventId);
                eventlist.Add(eventMasterModel);
            }
            return(eventlist);
        }
Ejemplo n.º 10
0
        public IHttpActionResult PutEventMaster(int id, EventMaster eventMaster)
        {
            if (!ModelState.IsValid)
            {
                return(BadRequest(ModelState));
            }

            if (id != eventMaster.EventId)
            {
                return(BadRequest());
            }

            db.Entry(eventMaster).State = EntityState.Modified;

            try
            {
                db.SaveChanges();
            }
            catch (DbUpdateConcurrencyException)
            {
                if (!EventMasterExists(id))
                {
                    return(NotFound());
                }
                else
                {
                    throw;
                }
            }

            return(StatusCode(HttpStatusCode.NoContent));
        }
Ejemplo n.º 11
0
    public IEnumerator useDoor(GameObject obj, EventMaster EventMaster)
    {
        if (exitWorldMap == false)
        {
            if (target != null)
            {
                obj.GetComponent <Player>().idle = true;
                _targetDoor.transform.parent.gameObject.SetActive(true);
                obj.transform.position = _targetDoor.GetComponent <Door>().target.position;
                this.transform.parent.gameObject.SetActive(false);
                yield return(new WaitForSeconds(0.5f));

                obj.GetComponent <Player>().idle = false;
            }
            else
            {
                print("[Door.usedoor: Target is undefined]");
            }
        }
        else
        {
            GameObject.FindGameObjectWithTag("EventMaster").GetComponent <EventMaster>().worldMap(true);
            Destroy(this.transform.parent.parent.gameObject);
        }
    }
Ejemplo n.º 12
0
        public void Move(int currentTurn, int amount)
        {
            EventMaster.LogEvent("Moving");
            Moving(null, null);
            var oldPosition = Position;

            for (var i = 0; i < amount; i++)
            {
                Position--;
                EventMaster.LogEvent(DisplayName + " moved 1 space.");
            }
            var newPosition        = Position;
            var crossedBreakpoints = Track.GetCrossedBreakpoints(oldPosition, newPosition);

            foreach (var breakpoint in crossedBreakpoints)
            {
                switch (breakpoint)
                {
                case TrackBreakpointType.X:
                    PerformXAction(currentTurn);
                    break;

                case TrackBreakpointType.Y:
                    PerformYAction(currentTurn);
                    break;

                case TrackBreakpointType.Z:
                    PerformZAction(currentTurn);
                    OnReachingEndOfTrack();
                    break;
                }
            }
            Moved(null, null);
            EventMaster.LogEvent("Done Moving");
        }
Ejemplo n.º 13
0
        public object GetEventListNew(eventdtl eve)
        {
            dynamic       EventListDetailResult;
            string        grp_SMSCount;
            List <object> EventsListResult = new List <object>();

            try
            {
                EventListNew Result = EventMaster.GetEventListNew(eve.groupProfileID, eve.grpId, out grp_SMSCount, eve.updatedOn);

                //for (int i = 0; i < Result.Count; i++)
                //{
                //    EventsListResult.Add(new { EventList = Result[i] });
                //}

                if (Result != null)
                {
                    EventListDetailResult = new { status = "0", message = "success", smsCount = grp_SMSCount, updatedOn = System.DateTime.Now.ToString("yyyy/MM/dd HH:mm:ss"), EventsListResult = Result };
                }
                else
                {
                    EventListDetailResult = new { status = "1", smsCount = grp_SMSCount, updatedOn = System.DateTime.Now.ToString("yyyy/MM/dd HH:mm:ss"), message = "Record not found" };
                }
            }
            catch
            {
                EventListDetailResult = new { status = "1", message = "failed", smsCount = 0, updatedOn = System.DateTime.Now.ToString("yyyy/MM/dd HH:mm:ss"), };
            }

            return(new { EventListDetailResult });
        }
Ejemplo n.º 14
0
 public static void InsertEvent(EventMaster eventMaster)
 {
     if (eventMaster.ZoomToken != null)
     {
         UpdateZoomTokenEvent(eventMaster.ZoomToken, eventMaster.CustomerId);
     }
     db.EventMasters.Add(eventMaster);
     db.SaveChanges();
 }
Ejemplo n.º 15
0
        public object GetEventList(eventdtl eve)
        {
            dynamic       EventListDetailResult;
            string        grp_SMSCount;
            List <object> EventsListResult = new List <object>();
            int           pagesize = 10, pageno = 1, total;

            if (string.IsNullOrEmpty(eve.SearchText))
            {
                eve.SearchText = "";
            }
            if (!string.IsNullOrEmpty(eve.page))
            {
                pageno = Convert.ToInt32(eve.page);
            }
            int skippageno = pageno - 1;

            try
            {
                List <EventList> Result = EventMaster.GetEventList(eve.groupProfileID, eve.grpId, eve.SearchText, eve.type, eve.admin, out grp_SMSCount);
                for (int i = 0; i < Result.Count; i++)
                {
                    EventsListResult.Add(new { EventList = Result[i] });
                }

                if (Result.Count > 0)
                {
                    var totalPages = 1;
                    if (string.IsNullOrEmpty(eve.page))
                    {
                        total = Result.Count;
                        EventListDetailResult = EventsListResult.ToList();
                    }
                    else
                    {
                        total            = Result.Count;
                        totalPages       = (int)Math.Ceiling((double)total / pagesize);
                        EventsListResult = EventsListResult.Skip(pagesize * skippageno).Take(pagesize).ToList();
                    }

                    EventListDetailResult = new { status = "0", message = "success", SMSCount = grp_SMSCount, resultCount = total.ToString(), TotalPages = totalPages.ToString(), currentPage = pageno.ToString(), EventsListResult = EventsListResult };
                }
                else
                {
                    EventListDetailResult = new { status = "1", SMSCount = grp_SMSCount, message = "Record not found" };
                }
            }
            catch
            {
                EventListDetailResult = new { status = "1", message = "failed", SMSCount = 0 };
            }

            return(new { EventListDetailResult });
        }
Ejemplo n.º 16
0
 /// <summary>
 /// CSVをロードする処理
 /// </summary>
 void Load()
 {
     StageMaster.Load();
     ItemMaster.Load();
     ItemIncentiveMaster.Load();
     ItemUpgreadConditionMaster.Load();
     EventMaster.Load();
     EventOccurenceMaster.Load();
     EventRequirementMaster.Load();
     BgmMaster.Load();
     SeMaster.Load();
 }
Ejemplo n.º 17
0
        public IHttpActionResult PostEventMaster(EventMaster eventMaster)
        {
            if (!ModelState.IsValid)
            {
                return(BadRequest(ModelState));
            }

            db.EventMaster.Add(eventMaster);
            db.SaveChanges();

            return(CreatedAtRoute("DefaultApi", new { id = eventMaster.EventId }, eventMaster));
        }
Ejemplo n.º 18
0
        void ProcessCompressedFile(FileStream file, XRITHeader header, string outputFolder)
        {
            string outName;

            if (header.NOAASpecificHeader.Compression == CompressionType.GIF)
            {
                outName = header.Filename.Replace(".lrit", ".gif");
                outName = Path.Combine(outputFolder, outName);
                var file2 = File.OpenWrite(outName);

                byte[] buffer = new Byte[1024];
                int    bytesRead;

                while ((bytesRead = file.Read(buffer, 0, 1024)) > 0)
                {
                    file2.Write(buffer, 0, bytesRead);
                }

                file2.Close();
            }
            else if (header.NOAASpecificHeader.Compression == CompressionType.JPEG)
            {
                outName = header.Filename.Replace(".lrit", ".jpg");
                outName = Path.Combine(outputFolder, outName);
                var file2 = File.OpenWrite(outName);

                byte[] buffer = new Byte[1024];
                int    bytesRead;

                while ((bytesRead = file.Read(buffer, 0, 1024)) > 0)
                {
                    file2.Write(buffer, 0, bytesRead);
                }

                file2.Close();
            }
            else
            {
                throw new Exception(string.Format("Unknown Compression type: {0}", header.NOAASpecificHeader.Compression.ToString()));
            }

            EventMaster.Post(EventTypes.NewFileEvent, new NewFileReceivedEventData {
                Name     = Path.GetFileName(outName),
                Path     = outName,
                Metadata =
                {
                    { "product",      header.Product.Name             },
                    { "subProduct",   header.SubProduct.Name          },
                    { "productId",    header.Product.ID.ToString()    },
                    { "subProductId", header.SubProduct.ID.ToString() }
                }
            });
        }
Ejemplo n.º 19
0
        public IHttpActionResult DeleteEventMaster(int id)
        {
            EventMaster eventMaster = db.EventMaster.Find(id);

            if (eventMaster == null)
            {
                return(NotFound());
            }

            db.EventMaster.Remove(eventMaster);
            db.SaveChanges();

            return(Ok(eventMaster));
        }
Ejemplo n.º 20
0
        public ActionResult Create(EventMaster eventmaster)
        {
            if (ModelState.IsValid)
            {
                eventmaster.CreatedDate = DateTime.Now;
                eventmaster.ModifiedDate = DateTime.Now;
                eventmaster.UserID = User.Identity.Name;
                eventmaster.TempleID = Convert.ToInt32(Request.Cookies["dcsankirtan"].Values["TempleID"]);
                db.EventMasters.Add(eventmaster);
                db.SaveChanges();
                return RedirectToAction("Index");
            }

            return View(eventmaster);
        }
Ejemplo n.º 21
0
        public bool Insert(EventEntity entity)
        {
            bool isinserted = false;

            using (var db = new EventDBEntities())
            {
                EventMaster record = new EventMaster();
                record.Id          = entity.Id;
                record.Eventname   = entity.Eventname;
                record.Createddate = entity.Createddate;
                record.IsActive    = true;
                record.Createdby   = entity.Createdby;
                db.EventMasters.Add(record);
                db.SaveChanges();
                isinserted = true;
            }

            return(isinserted);
        }
Ejemplo n.º 22
0
        public object AddEvent_New(AddEventResult eventResult)
        {
            dynamic AddEventResult;
            int     str;

            try
            {
                Imgname result = EventMaster.AddEvent_New(eventResult);
                if (!string.IsNullOrEmpty(result.imgName))
                {
                    str = GlobalFuns.UploadImage(eventResult.grpID, result.imgName, "Event");
                }
                else
                {
                    str = 0;
                }
                if (result != null)
                {
                    if (str == 0)
                    {
                        AddEventResult = new { status = "0", message = "success" };
                        if (eventResult.eventID != "0")
                        {
                            //string url = ConfigurationManager.AppSettings["imgPath"] + "php/EditEvent.php?EventID=" + eventResult.eventID;
                            //GroupMaster.Send(url);
                        }
                    }
                    else
                    {
                        AddEventResult = new { status = "1", message = "failed", Exception = "1" }
                    };
                }
                else
                {
                    AddEventResult = new { status = "1", message = "failed", Exception = "2" };
                }
            }
            catch (Exception e)
            {
                AddEventResult = new { status = "1", message = "failed", Exception = e };
            }
            return(new { AddEventResult });
        }
Ejemplo n.º 23
0
        protected int AttackSpecificZones(int amount, IList <ZoneLocation> zones, ThreatDamageType?threatDamageType = null)
        {
            var damageShielded = 0;

            foreach (var zoneLocation in zones)
            {
                AmountAttackingFor = amount;
                ZoneUnderAttack    = zoneLocation;
                EventMaster.LogEvent("Attacking");
                var bonusAttacks = GetThreatStatus(ThreatStatus.BonusAttack) ? 1 : 0;
                var damage       = new ThreatDamage(amount + bonusAttacks, threatDamageType ?? StandardDamageType, zoneLocation, DamageDistanceToSource);
                AttackedSittingDuck(this, new ThreatDamageEventArgs {
                    ThreatDamage = damage
                });
                damageShielded += damage.DamageShielded;
            }
            AmountAttackingFor = null;
            EventMaster.LogEvent("Done Attacking");
            return(damageShielded);
        }
Ejemplo n.º 24
0
        public int InsertEventMaster(EventMaster p_EventMaster)
        {
            int result = 0;

            MySqlParameter[] parameters = new MySqlParameter[] {
                new MySqlParameter("p_startdate", p_EventMaster.startdate),
                new MySqlParameter("p_enddate", p_EventMaster.enddate),
                new MySqlParameter("p_locationid", p_EventMaster.locationid),
                new MySqlParameter("p_numberofguards", p_EventMaster.numberofguards),
                new MySqlParameter("p_specialdutyforguard", p_EventMaster.specialdutyforguard),
                new MySqlParameter("p_eventname", p_EventMaster.eventname),
                new MySqlParameter("p_notes", p_EventMaster.notes),
                new MySqlParameter("p_optionalguestlist", p_EventMaster.optionalguestlist),
                new MySqlParameter("p_personinchargename", p_EventMaster.personinchargename),
                new MySqlParameter("p_personinchargenric", p_EventMaster.personinchargenric),
                new MySqlParameter("p_personinchargecontactnumber", p_EventMaster.personinchargecontactnumber),
                new MySqlParameter("p_DeploymentId", p_EventMaster.DeploymentId),
                new MySqlParameter("p_Remarks", p_EventMaster.Remarks),
                new MySqlParameter("p_result", MySqlDbType.Int32, 2, ParameterDirection.Output, false, 1, 1, "Out", DataRowVersion.Default, result)
            };
            return(MySQLDB.MySQLDBHelper.ExecuteNonQuery("AddEventMasterList", CommandType.StoredProcedure, parameters));
        }
Ejemplo n.º 25
0
        public object AnsweringEvent(AnsweringEvent obj_Responce)
        {
            dynamic EventJoinResult;

            try
            {
                EventJoinResult EventResult = EventMaster.AnsweringEvent(obj_Responce);
                if (EventResult.goingCount != null)
                {
                    EventJoinResult = new { status = "0", message = "success", goingCount = EventResult.goingCount, maybeCount = EventResult.maybeCount, notgoingCount = EventResult.notgoingCount, myResponse = EventResult.myResponse };
                }
                else
                {
                    EventJoinResult = new { status = "1", message = "failed" };
                }
            }
            catch
            {
                EventJoinResult = new { status = "1", message = "failed" };
            }
            return(new { EventJoinResult });
        }
Ejemplo n.º 26
0
        public void sendMailtocustomer(String Email, string subject, string firstname, int EventId, int amount)
        {
            try
            {
                EventMaster eventmaster = EventService.GetEventById(Convert.ToInt32(EventId));
                //Email = db.Adminsettings.Select(a => a.Smtpusername).FirstOrDefault();
                string header = EmailBody.MailHeader(subject, LinkedInDemo.Class.AdminSiteConfiguration.GetURL());
                string footer = EmailBody.MailFooter(LinkedInDemo.Class.AdminSiteConfiguration.CompanyEmail);
                string body   = "<tr>";

                body = body + "<td style='text-align:left; padding: 0px 30px;'>";
                body = body + "<p style='margin: 0px; padding: 0px 0px 20px 0px; font-family: Arial, Helvetica, sans-serif; font-size: 16px; color: #000;'> Dear User,</p>";
                //body = body + "<p style='text-align:left; padding: 0px 30px;'>Your credit request has been accepted for event " + eventmaster.EventName + ".</p>";
                body = body + "<p style='margin: 0px; padding: 0px 0px 20px 0px; font-family: Arial, Helvetica, sans-serif; font-size: 16px; color: #000;line-height: 22px;'>Your request for " + amount + " credits have been received. We will get in touch with you shortly to address this request. Please look for our email on " + Email + " </p>";
                body = body + "<p style='margin: 0px; padding: 0px 0px 20px 0px; font-family: Arial, Helvetica, sans-serif; font-size: 16px; color: #000;line-height: 22px;'>If you have any queries, please email us on [email protected]. </p>";
                body = body + "<p style='margin: 0px; padding: 0px 0px 0px 0px; font-family: Arial, Helvetica, sans-serif; font-size: 16px; color: #000; line-height: 22px;'><b>Thanks and Cheers,</b><br />The Entire EventNX team </p>";

                string mailbody = header + body + footer;
                SendMailService.SendMail(Email, subject, mailbody);
            }
            catch (Exception ex)
            {
            }
        }
Ejemplo n.º 27
0
        public ActionResult Index(int EventId, HttpPostedFileBase file)
        {
            EventMaster eventmaster = EventService.GetEventById(EventId);
            var         test        = Request.Files.Count;

            if (file != null)
            {
                try
                {
                    string pic = System.IO.Path.GetFileName(file.FileName);
                    pic = eventmaster.EventId + "_" + pic;
                    string savepath = System.IO.Path.Combine(Server.MapPath("~/Content/images"), pic);
                    string path     = AdminSiteConfiguration.GetURL() + "/Content/images/" + pic;
                    file.SaveAs(savepath);
                    eventmaster.ButtonURL = path;
                    EventService.UpdateEvent(eventmaster);
                    return(RedirectToAction("Index", new { EventId = EventId }));
                }
                catch
                {
                }
            }
            return(RedirectToAction("Index", new { EventId = EventId }));
        }
Ejemplo n.º 28
0
        void ProcessFile(FileStream file, XRITHeader header, string outputFolder)
        {
            var width        = header.ImageStructureHeader.Columns;
            var height       = header.ImageStructureHeader.Lines;
            var bitsPerPixel = header.ImageStructureHeader.BitsPerPixel;

            if (header.NOAASpecificHeader.Compression != CompressionType.NO_COMPRESSION && header.NOAASpecificHeader.Compression != CompressionType.LRIT_RICE)
            {
                ProcessCompressedFile(file, header, outputFolder);
                return;
            }

            if (bitsPerPixel != 8 && bitsPerPixel != 1)
            {
                throw new Exception(string.Format("Unsupported bits per pixel {0}", bitsPerPixel));
            }

            var format      = bitsPerPixel == 8 ? PixelFormat.Format8bppIndexed : PixelFormat.Format1bppIndexed;
            var b           = new Bitmap(width, height, format);
            var bytesToRead = (width * height);

            if (bitsPerPixel == 1)
            {
                bytesToRead  = (8 * (bytesToRead + 7)) / 8;
                bytesToRead /= 8;
            }
            else
            {
                // Create grayscale palette
                ColorPalette pal = b.Palette;
                for (int i = 0; i <= 255; i++)
                {
                    pal.Entries[i] = Color.FromArgb(i, i, i);
                }
                b.Palette = pal;
            }

            var buffer = new byte[bytesToRead];

            file.Read(buffer, 0, bytesToRead);

            if (width % 8 == 0 || bitsPerPixel != 1)
            {
                var data = b.LockBits(new Rectangle(0, 0, b.Width, b.Height), ImageLockMode.WriteOnly, format);
                if (data.Stride == width * bitsPerPixel / 8)
                {
                    Marshal.Copy(buffer, 0, data.Scan0, buffer.Length);
                }
                else
                {
                    // So our stride is bigger than our width (alignment issues). So let's copy line by line.
                    int nwidth = width * bitsPerPixel / 8;
                    for (int i = 0; i < height; i++)
                    {
                        Marshal.Copy(buffer, nwidth * i, IntPtr.Add(data.Scan0, i * data.Stride), nwidth);
                    }
                }
                b.UnlockBits(data);
            }
            else
            {
                // Hard mode, let's optimize this in the future.
                b = new Bitmap(width, height, PixelFormat.Format24bppRgb);
                var z = 0;
                for (int i = 0; i < bytesToRead; i++)
                {
                    for (int k = 7; k >= 0; k--)
                    {
                        var  x      = z % width;
                        var  y      = z / width;
                        bool bitset = ((buffer[i] >> k) & 1) == 1;
                        if (x < width && y < height)
                        {
                            b.SetPixel(x, y, Color.FromArgb((int)(bitset ? 0xFFFFFFFF : 0x0)));
                        }
                        z++;
                    }
                }
            }

            string outName = header.Filename.Replace(".lrit", ".jpg");

            outName = Path.Combine(outputFolder, outName);
            b.Save(outName, ImageFormat.Jpeg);
            b.Dispose();

            EventMaster.Post(EventTypes.NewFileEvent, new NewFileReceivedEventData {
                Name     = Path.GetFileName(outName),
                Path     = outName,
                Metadata =
                {
                    { "product",      header.Product.Name             },
                    { "subProduct",   header.SubProduct.Name          },
                    { "productId",    header.Product.ID.ToString()    },
                    { "subProductId", header.SubProduct.ID.ToString() }
                }
            });
        }
 // Awake is called one time at the beginning
 private void Awake()
 {
     // Get reference to the event master
     em = GetComponent <EventMaster>();
 }
Ejemplo n.º 30
0
        static unsafe void Main(string[] args)
        {
            int[] num = new int[5] {
                5, 5, 5, 5, 5
            };
            int *[] num2 = new int *[1] {
                (int *)0
            };

            //Initial try
            Function_Far_Far_Away.RimAPIFunctions.AAPI();
            Function_Far_Far_Away.RimAPIFunctions.BAPI(num, ref num2);
            Console.WriteLine(C(9));
            Console.WriteLine(Function_Far_Far_Away.RimAPIFunctions.DAPI());

            Console.WriteLine("HIT ENTER!!! \n\r \n\r");
            Console.ReadLine();

            MethodInfo[] overrideMethods =
            {
                typeof(Function_Far_Far_Away.RimAPIFunctions).GetMethod("AAPI",  BindingFlags.NonPublic | BindingFlags.Static),
                typeof(Function_Far_Far_Away.RimAPIFunctions).GetMethod("BAPI"),
                typeof(Program).GetMethod("C",                                   BindingFlags.NonPublic | BindingFlags.Static, null,CallingConventions.Any, new Type[1] {
                    typeof(int)
                },                                                               null),
                typeof(Function_Far_Far_Away.RimAPIFunctions).GetMethod("DAPI",  BindingFlags.Public | BindingFlags.Static)
            };

            MethodInfo[] overridingMethods =
            {
                typeof(RimFunctions).GetMethod("A"),
                typeof(RimFunctions).GetMethod("B"),
                typeof(RimFunctions).GetMethod("C", BindingFlags.Static | BindingFlags.Public, null, CallingConventions.Any, new Type[1] {
                    typeof(int)
                },                                  null),
                typeof(RimFunctions).GetMethod("D")
            };

            //init functions
            Console.WriteLine(EventMaster.OverrideFrom(overrideMethods[0],
                                                       "public static void OnCalledG(){if(OnCalled != null){OnCalled();}return;}",
                                                       "void", "", "",
                                                       new string[0] {
            }));

            Console.WriteLine(EventMaster.OverrideFrom(overrideMethods[1],
                                                       "public static unsafe void OnCalledG(int[] num, ref int*[] num2){if(OnCalled != null){OnCalled(num, ref num2);}return;}",
                                                       "void", "", "int[] num, ref int*[] num2",
                                                       new string[0] {
            }));

            Console.WriteLine(EventMaster.OverrideFrom(overrideMethods[2],
                                                       "public static int  OnCalledG(int num, int num2){if(OnCalled != null){return OnCalled(num);}return -1;}",
                                                       "int", "", "int num",
                                                       new string[0] {
            }));

            Console.WriteLine(EventMaster.OverrideFrom(overrideMethods[3],
                                                       "public static int  OnCalledG(){if(OnCalled != null){return OnCalled();}return -1;}",
                                                       "int", "", "",
                                                       new string[0] {
            }) + "\n\r");

            //Add them once!
            Console.WriteLine(EventMaster.getEvent(EventMaster.getName(overrideMethods[0])).AddSub(overridingMethods[0]));
            Console.WriteLine(EventMaster.getEvent(EventMaster.getName(overrideMethods[1])).AddSub(overridingMethods[1]));
            Console.WriteLine(EventMaster.getEvent(EventMaster.getName(overrideMethods[2])).AddSub(overridingMethods[2]));
            Console.WriteLine(EventMaster.getEvent(EventMaster.getName(overrideMethods[3])).AddSub(overridingMethods[3]) + "\n\r");

            //Now we got our overriden methods... YAY!
            Function_Far_Far_Away.RimAPIFunctions.AAPI();
            Function_Far_Far_Away.RimAPIFunctions.BAPI(num, ref num2);
            Console.WriteLine(C(9));;
            Console.WriteLine(Function_Far_Far_Away.RimAPIFunctions.DAPI());

            Console.WriteLine("HIT ENTER!!!");
            Console.ReadLine();

            //Lets have them each called twice!
            Console.WriteLine(EventMaster.getEvent(EventMaster.getName(overrideMethods[0])).AddSub(overridingMethods[0]));
            Console.WriteLine(EventMaster.getEvent(EventMaster.getName(overrideMethods[1])).AddSub(overridingMethods[1]));
            Console.WriteLine(EventMaster.getEvent(EventMaster.getName(overrideMethods[2])).AddSub(overridingMethods[2]));
            Console.WriteLine(EventMaster.getEvent(EventMaster.getName(overrideMethods[3])).AddSub(overridingMethods[3]) + "\n\r");

            //Everyhing now runs twice...
            Function_Far_Far_Away.RimAPIFunctions.AAPI();
            Function_Far_Far_Away.RimAPIFunctions.BAPI(num, ref num2);
            Console.WriteLine(C(9));;
            Console.WriteLine(Function_Far_Far_Away.RimAPIFunctions.DAPI());

            Console.WriteLine("HIT ENTER!!!");
            Console.ReadLine();

            //Lets remove them once... now thier only called once...
            Console.WriteLine(EventMaster.getEvent(EventMaster.getName(overrideMethods[0])).RemoveSub(overridingMethods[0]));
            Console.WriteLine(EventMaster.getEvent(EventMaster.getName(overrideMethods[1])).RemoveSub(overridingMethods[1]));
            Console.WriteLine(EventMaster.getEvent(EventMaster.getName(overrideMethods[2])).RemoveSub(overridingMethods[2]));
            Console.WriteLine(EventMaster.getEvent(EventMaster.getName(overrideMethods[3])).RemoveSub(overridingMethods[3]) + "\n\r");

            //Should work as expected...
            Function_Far_Far_Away.RimAPIFunctions.AAPI();
            Function_Far_Far_Away.RimAPIFunctions.BAPI(num, ref num2);
            Console.WriteLine(C(9));;
            Console.WriteLine(Function_Far_Far_Away.RimAPIFunctions.DAPI());

            Console.WriteLine("HIT ENTER!!!");
            Console.ReadLine();

            //We will refuse to allow you to remove them now... we can't have less than 1 sub... (I don't trust the User Implemented OnCalledG method!)
            Console.WriteLine(EventMaster.getEvent(EventMaster.getName(overrideMethods[0])).RemoveSub(overridingMethods[0]));
            Console.WriteLine(EventMaster.getEvent(EventMaster.getName(overrideMethods[1])).RemoveSub(overridingMethods[1]));
            Console.WriteLine(EventMaster.getEvent(EventMaster.getName(overrideMethods[2])).RemoveSub(overridingMethods[2]));
            Console.WriteLine(EventMaster.getEvent(EventMaster.getName(overrideMethods[3])).RemoveSub(overridingMethods[3]) + "\n\r");

            //Just like the last,,,
            Function_Far_Far_Away.RimAPIFunctions.AAPI();
            Function_Far_Far_Away.RimAPIFunctions.BAPI(num, ref num2);
            Console.WriteLine(C(9));;
            Console.WriteLine(Function_Far_Far_Away.RimAPIFunctions.DAPI());

            Console.WriteLine("HIT ENTER!!!");
            Console.ReadLine();
        }
Ejemplo n.º 31
0
 public ActionResult Edit(EventMaster eventmaster)
 {
     if (ModelState.IsValid)
     {
         var TempleID = Convert.ToInt32(Request.Cookies["dcsankirtan"].Values["TempleID"]);
         if (eventmaster.TempleID == TempleID)
         {
             db.Entry(eventmaster).State = EntityState.Modified;
             eventmaster.ModifiedDate = DateTime.Now;
             //    eventmaster.CreatedDate = DateTime.Now;
             db.SaveChanges();
         }
         return RedirectToAction("Index");
     }
     return View(eventmaster);
 }
Ejemplo n.º 32
0
        public int Publish_to_ESP2()
        {
            int successValue = 0;

            /***************************************deal with security******************************************/
            List <ESP2.Securities.Security> esp2_secList = ESP2.Securities.SecurityMaster.Get_secList_cusip(this.CUSIP.Value);

            ESP2.Securities.Security esp2_sec = null;
            if (esp2_secList.Count < 1)
            {
                Securities.Security drwin_sec = this.Get_security();
                if (drwin_sec == null)
                {
                    return(-1);
                }

                ESP2.Securities.Security new_esp2_sec = new ESP2.Securities.Security();
                new_esp2_sec.Init_from_DRWIN_sec(drwin_sec);
                if (new_esp2_sec.Insert_to_DB())
                {
                    successValue += 1;
                }
            }
            else
            {
                esp2_sec = esp2_secList[0];
            }

            if (esp2_sec == null)//try get esp2 security again
            {
                esp2_secList = ESP2.Securities.SecurityMaster.Get_secList_cusip(this.CUSIP.Value);
                if (esp2_secList.Count < 1)
                {
                    return(-2);
                }
                else
                {
                    esp2_sec = esp2_secList[0];
                }
            }
            /*^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^*/

            Event esp2_event = new Event();

            esp2_event.Init_from_Dividend(this);
            esp2_event.security_id.Value = esp2_sec.security_id;

            /***************************************deal with depository******************************************/
            DepositaryInfo depoInfo = DepositaryInfoMaster.GetDepo_by_name(this.Depositary.Value);

            if (depoInfo == null)
            {
                DepositaryInfo          new_depo   = new DepositaryInfo();
                Depositaries.Depositary drwin_depo = Depositaries.DepositaryMaster.GetDepositary_by_name(this.Depositary.Value);

                new_depo.Init_from_DRWIN_depo(drwin_depo);
                new_depo.Insert_to_DB();
                DepositaryInfoMaster.Reset();

                depoInfo = DepositaryInfoMaster.GetDepo_by_name(this.Depositary.Value);
                if (depoInfo == null)
                {
                    return(-3);
                }

                DepositaryIdemnification di = new DepositaryIdemnification();
                di.Init_from_DRWIN_depo(drwin_depo);
                di.depositary_info_id.Value = depoInfo.depositary_info_id;
                di.Insert_to_DB();
            }
            /*^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^*/

            esp2_event.depositary_info_id.Value = depoInfo.depositary_info_id;//depositary info

            Dictionary <int, DividendCustodian> cust_dic = this.Get_dvdCust_dic(null);
            DividendCustodian primary_DRWIN_cust         = null;

            foreach (DividendCustodian dvdCust in cust_dic.Values)
            {
                if (dvdCust.Custodian_Number.Value < 0)
                {
                    continue;
                }
                if (dvdCust.Custodian_Type.Value.StartsWith("custodian", StringComparison.OrdinalIgnoreCase))
                {
                    primary_DRWIN_cust = dvdCust;
                    break;
                }
            }
            if (primary_DRWIN_cust == null)
            {
                return(-4);
            }
            else
            {
                if (esp2_event.Insert_to_DB())
                {
                    successValue += 2;
                }
                else
                {
                    return(-5);
                }
            }

            /*******************************deal with dividend custodian************************************/
            Event inserted_esp2event = EventMaster.GetEvent_DividendIndex(this.DividendIndex);

            if (inserted_esp2event == null)
            {
                return(-6);
            }

            Country cty = CountryMaster.GetCountry_name(this.Country.Value);

            if (cty == null)
            {
                return(-7);
            }

            PrimaryCustodian pc = new PrimaryCustodian();

            pc.Init_from_DRWIN_dvdCust(primary_DRWIN_cust, cty, inserted_esp2event);
            pc.Insert_to_DB();

            EventContactInfo eci = new EventContactInfo();

            eci.Init_from_DRWIN_dvdCust(primary_DRWIN_cust, cty, inserted_esp2event);
            eci.Insert_to_DB();
            /*^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^*/

            return(successValue);
        }