// GET: Congresses/Details/5
        public ActionResult Details(int?id)
        {
            if (id == null)
            {
                return(new HttpStatusCodeResult(HttpStatusCode.BadRequest));
            }
            Congress congress = db.Tb_Congress.Find(id);

            if (congress == null)
            {
                return(HttpNotFound());
            }
            return(View(congress));
        }
Exemplo n.º 2
0
        /// <summary>
        /// Creates a new instance of QuiverCongress from a CSV line
        /// </summary>
        /// <param name="csvLine">CSV line</param>
        public QuiverCongress(string csvLine)
        {
            // ReportDate[0], TransactionDate[1], Representative[2], Transaction[3], Amount[4],House[5]
            var csv = csvLine.Split(',');

            ReportDate      = Parse.DateTimeExact(csv[0], "yyyyMMdd");
            TransactionDate = Parse.DateTimeExact(csv[1], "yyyyMMdd");
            Representative  = csv[2];
            var transaction = (TransactionDirection)Enum.Parse(typeof(TransactionDirection), csv[3], true);

            Transaction = transaction == TransactionDirection.Purchase ? OrderDirection.Buy : OrderDirection.Sell;
            Amount      = csv[4].IfNotNullOrEmpty <decimal?>(s => Parse.Decimal(s));
            House       = (Congress)Enum.Parse(typeof(Congress), csv[5], true);
            Time        = ReportDate;
        }
        public override bool Equals(object obj)
        {
            CongressComunication other = obj as CongressComunication;

            if (other == null)
            {
                return(false);
            }

            bool a = Congress == null ? other.Congress == null : Congress.Equals(other.Congress);
            bool b = Edition == null ? other.Edition == null : Edition.Equals(other.Edition);
            bool c = Place == null ? other.Place == null : Place.Equals(other.Place);
            bool d = InitialPage == null ? other.InitialPage == null : InitialPage.Equals(other.InitialPage);
            bool e = FinalPage == null ? other.FinalPage == null : FinalPage.Equals(other.FinalPage);
            bool f = base.Equals(obj);

            return(a && b && c && d && e && f);
        }
Exemplo n.º 4
0
        /// <summary>
        /// 测试 追加的情况.
        /// </summary>
        private static void Test2()
        {
            Approver wjzhang, gyang, jguo, meeting;

            wjzhang = new Director("张无忌");
            gyang   = new VicePresident("杨过");
            jguo    = new President("郭靖");
            meeting = new Congress("董事会");


            Approver rhuang;

            rhuang = new Manager("黄蓉");


            //创建职责链
            // 将“黄蓉”作为“张无忌”的下家
            wjzhang.Successor = rhuang;
            // 将“杨过”作为“黄蓉”的下家
            rhuang.Successor = gyang;

            gyang.Successor = jguo;
            jguo.Successor  = meeting;


            //创建采购单
            PurchaseRequest pr1 = new PurchaseRequest(45000, 10001, "购买倚天剑");

            wjzhang.processRequest(pr1);

            PurchaseRequest pr2 = new PurchaseRequest(60000, 10002, "购买《葵花宝典》");

            wjzhang.processRequest(pr2);

            PurchaseRequest pr3 = new PurchaseRequest(160000, 10003, "购买《金刚经》");

            wjzhang.processRequest(pr3);

            PurchaseRequest pr4 = new PurchaseRequest(800000, 10004, "购买桃花岛");

            wjzhang.processRequest(pr4);
        }
        public ActionResult Create(HttpPostedFileBase CongressBanner, [Bind(Include = "CongressId,CongressName,CongressTheme,CongressInitialDate,CongressFinalDate,Available")] Congress congress)
        {
            if (ModelState.IsValid)
            {
                if (CongressBanner != null)
                {
                    var    fecha    = DateTime.Now.ToString().Replace(" ", "-");
                    String ruta     = Server.MapPath("~/Archivos/Subidos/");
                    var    rutaLink = ("../../Archivos/Subidos/" + (DateTime.Now.ToString("yyyyMMddHHmmss") + "-" + CongressBanner.FileName).ToLower());
                    ruta += (DateTime.Now.ToString("yyyyMMddHHmmss") + "-" + CongressBanner.FileName).ToLower();
                    CongressBanner.SaveAs(ruta);
                    congress.CongressBanner = rutaLink;
                }

                db.Tb_Congress.Add(congress);
                db.SaveChanges();

                return(RedirectToAction("Index"));
            }


            return(View(congress));
        }
Exemplo n.º 6
0
 public override int GetHashCode() =>
 StateCode.GetHashCode() ^
 Congress.GetHashCode() ^
 StateSenate.GetHashCode() ^
 StateHouse.GetHashCode() ^
 County.GetHashCode();