public string PropertyValue(string name)
        {
            switch (name)
            {
            case "SiteId": return(SiteId.ToString());

            case "UpdatedTime": return(UpdatedTime.Value.ToString());

            case "WikiId": return(WikiId.ToString());

            case "Ver": return(Ver.ToString());

            case "Title": return(Title.Value);

            case "Body": return(Body);

            case "TitleBody": return(TitleBody.ToString());

            case "Comments": return(Comments.ToJson());

            case "Creator": return(Creator.Id.ToString());

            case "Updator": return(Updator.Id.ToString());

            case "CreatedTime": return(CreatedTime.Value.ToString());

            case "VerUp": return(VerUp.ToString());

            case "Timestamp": return(Timestamp);

            default: return(null);
            }
        }
 public override byte[] ToBytes() => ByteHelpers.Combine(
     new byte[]
 {
     Ver.ToByte(), Cmd.ToByte(), Rsv.ToByte(), Atyp.ToByte()
 },
     DstAddr.ToBytes(),
     DstPort.ToBytes());
        public override int GetHashCode()
        {
            int hash = 1;

            if (Id1 != 0)
            {
                hash ^= Id1.GetHashCode();
            }
            if (Id2 != 0)
            {
                hash ^= Id2.GetHashCode();
            }
            if (Username.Length != 0)
            {
                hash ^= Username.GetHashCode();
            }
            if (Passwd.Length != 0)
            {
                hash ^= Passwd.GetHashCode();
            }
            if (Ver.Length != 0)
            {
                hash ^= Ver.GetHashCode();
            }
            if (Json.Length != 0)
            {
                hash ^= Json.GetHashCode();
            }
            return(hash);
        }
 public override byte[] ToBytes() => ByteHelpers.Combine(
     new byte[]
 {
     Ver.ToByte(),
     NMethods.ToByte()
 },
     Methods.ToBytes());
示例#5
0
        public override int GetHashCode()
        {
            int hash = 1;

            if (Ver != 0)
            {
                hash ^= Ver.GetHashCode();
            }
            hash ^= exceptions_.GetHashCode();
            if (SeverityLevel != 0)
            {
                hash ^= SeverityLevel.GetHashCode();
            }
            if (ProblemId.Length != 0)
            {
                hash ^= ProblemId.GetHashCode();
            }
            hash ^= Properties.GetHashCode();
            hash ^= Measurements.GetHashCode();
            if (_unknownFields != null)
            {
                hash ^= _unknownFields.GetHashCode();
            }
            return(hash);
        }
示例#6
0
 public bool Equals(Ver x)
 {
     return((x != null) &&
            (x.Major == Major) &&
            (x.Minor == Minor) &&
            (x.Build == Build) &&
            (x.Revision == Revision));
 }
示例#7
0
        public ActionResult DeleteConfirmed(int id)
        {
            Ver vers = db.Versions.Find(id);

            db.Versions.Remove(vers);
            db.SaveChanges();
            return(RedirectToAction("Index"));
        }
示例#8
0
文件: Form1.cs 项目: BUBear/Update
 private void CheckUpdate()
 {
     label5.Text = "버전 확인 ...";
     if (localFileInfo.Count > 0 && updateFileInfo.Count > 0)
     {
         for (int i = 0; i < localFileInfo.Count; i++)
         {
             if (string.IsNullOrEmpty(localFileInfo[i].Ver) == false && string.IsNullOrEmpty(updateFileInfo[i].Ver) == false)
             {
                 if (Ver.VersionCompare(localFileInfo[i].Ver, updateFileInfo[i].Ver) == 1) //ver2가 더 높음
                 {
                     updateFileList.Add(updateFileInfo[i]);
                     listView1.Items[i].SubItems[3].Text = "업데이트 필요!";
                 }
                 else
                 {
                     listView1.Items[i].SubItems[3].Text = "최신!";
                 }
                 updateCheck = true;
             }
             else if (localFileInfo[i].Time != DateTime.MinValue && updateFileInfo[i].Time != DateTime.MinValue)
             {
                 if (DateTime.Compare(localFileInfo[i].Time, updateFileInfo[i].Time) == -1) // t2가 더 높음
                 {
                     updateFileList.Add(updateFileInfo[i]);
                     listView1.Items[i].SubItems[3].Text = "업데이트 필요!";
                 }
                 else
                 {
                     listView1.Items[i].SubItems[3].Text = "최신!";
                 }
                 updateCheck = true;
             }
             else
             {
                 updateCheck = false;
                 label5.Text = "오류> 확인할 수 버전 또는 날짜가 없습니다.!";
                 listView1.Items[i].SubItems[3].Text = "오류> 확인 실패!";
             }
         }
         NewFileAdd();
     }
     else if (localFileInfo.Count == 0 && updateFileInfo.Count >= 0 && !localXmlFileExists)
     {
         for (int i = 0; i < updateFileInfo.Count; i++)
         {
             updateFileList.Add(updateFileInfo[i]);
         }
         listView1.Items.Add("파일 다운로드 준비 완료.");
         updateCheck = true;
     }
     else
     {
         updateCheck = false;
         label5.Text = "오류> 파일 목록이 존재 하지 않습니다.!";
         MessageBox.Show("파일 목록이 존재하지 않습니다.", "오류");
     }
 }
示例#9
0
 public ActionResult Edit([Bind(Include = "VerID,VerNo")] Ver vers)
 {
     if (ModelState.IsValid)
     {
         db.Entry(vers).State = EntityState.Modified;
         db.SaveChanges();
         return(RedirectToAction("Index"));
     }
     return(View(vers));
 }
示例#10
0
        private void button6_Click(object sender, EventArgs e)
        {
            Ver.Refresh();
            IList <PrestamoLibros> libros = new List <PrestamoLibros>();

            libros = servicio.Consultar();

            Ver.DataSource = libros;
            Ver.Refresh();
        }
示例#11
0
        public About()
        {
            InitializeComponent();
            var Vers = Assembly.GetExecutingAssembly().GetName().Version.ToString();

            Ver.SetBinding(TextBlock.TextProperty, new Binding(".")
            {
                Source = Vers
            });
        }
示例#12
0
        public ActionResult Create([Bind(Include = "VerID,VerNo")] Ver vers)
        {
            if (ModelState.IsValid)
            {
                db.Versions.Add(vers);
                db.SaveChanges();
                return(RedirectToAction("Index"));
            }

            return(View(vers));
        }
示例#13
0
        public string QuickOutPool(string Reqs, string Version, string OutDate, string PlanRlsDate, int SysId, bool IsPatch)
        {
            // 2016年8月10日修改:需要根据IsPatch分别进行不同的处理
            string realVersion = Version;

            if (!IsPatch) // 常规版本
            {
                Ver v = dbContext.Vers.Where(p => p.VerID.ToString() == Version).FirstOrDefault();
                realVersion = v.VerNo;
                // 更新版本计划信息
                v.DraftTime              = DateTime.Parse(PlanRlsDate); // 制定时间改为计划下发日期
                v.DraftPersonID          = this.GetSessionCurrentUser().UID;
                dbContext.Entry(v).State = System.Data.Entity.EntityState.Modified;
                dbContext.SaveChanges();
            }
            else // 补丁版本
            {
                // 新增一条记录
                DateTime newTime = DateTime.Parse(PlanRlsDate);
                Ver      v       = new Ver()
                {
                    SysId         = SysId,
                    VerNo         = realVersion,
                    VerYear       = DateTime.Now.Year.ToString(),
                    ReleaseFreq   = 0,       // 补丁版本的频率记为0
                    DraftTime     = newTime,
                    PublishTime   = newTime, // 发布时间、制定时间均为计划下发日期
                    DraftPersonID = this.GetSessionCurrentUser() == null ? 0 : this.GetSessionCurrentUser().UID,
                    VerType       = "补丁版本"
                };
                dbContext.Vers.Add(v);
                dbContext.SaveChanges();
            }

            string sql = string.Format("update Reqs set Version='{0}', OutDate='{1}', PlanRlsDate='{2}', ReqStat=N'出池', UpdateTime='{3}' where RID in ({4})", realVersion, OutDate, PlanRlsDate, DateTime.Now.ToString("yyyyMMddHHmmss"), Reqs);

            try
            {
                // 批量更新,直接执行SQL
                int r = dbContext.Database.ExecuteSqlCommand(sql);

                // 下载出池计划文档接口
                string downfile = string.Format("/ReqManage/OutPool?isQuery=True&isExcel=True&SysId={0}&Version={1}", SysId, realVersion);

                return(string.Format("<p class='alert alert-success'>" + r + "条需求成功出池!<a href='{0}'>点击</a>导出出池计划文档<p>", downfile));
            }
            catch (Exception e1)
            {
                return("<p class='alert alert-danger>出错了:" + e1.Message + "</p>");
            }
        }
示例#14
0
        public ROMInterface(Ver ver_)
        {
            ver = ver_;

            dataIDbases = new RomAddress[] { 0x1060, 0, 0, 0x528430, 0xb16170, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0 };

            mapNumbers = 0xb0;
            practiceMapNumber = 0x19;

            ustruct3_size = 0x118;
            ustruct3_iiPlaceVector = 0x5c;
            ustruct3_preparedList = 0x60;
            preparedList_count = 0x50;

            placeVector_size = 8;
            placeVector_numberOfObjPlaces = 0;
            placeVector_iObjPlaces = 4;
            objPlaceC_size = 0xc;
            objPlace_kind = 0;
            objPlace_info = 2;
            objPlace_xpos = 4;
            objPlace_ypos = 8;
            numberOfObjPlacesMax = 150;

            ustruct5Table = new RamAddress(0x800abf60).toRomAddress();

            ustruct5_size = 8;
            uttruct5_iUStruct3 = 4;

            headerModAddr1 = 0x67f;
            headerModAddr2 = 0x68b;
            headerModByte1 = 0x63;
            headerModByte2 = 0xba;
            freeSpaceAddr = 0xe67fd0;
            freeSpaceSize = 0x1000000 - freeSpaceAddr.x;

            basicObjects = new ushort[]
            {
                       0x4001,0x4002,0x4003,0x4004,0x4005,0x4006,0x4007,0x4008,0x4009,0x400a,0x400b,0x400c,0x400d,0x400e,0x400f,
                0x4010,0x4011,0x4012,0x4013,0x4014,0x4015,0x4016,0x4017,0x4018,0x4019,0x401a,0x401b,0x401c,0x401d,0x401e,0x401f,
                0x4020,0x4021,0x4022,0x4023,0x4024,0x4025,0x4026,0x4027,0x402c,
                0x4030,0x4031,0x4032,0x4033,0x4034,0x4035,
                0x4088,0x40f2,0x460c,0x460d
            };

            switch (ver)
            {
                case Ver.Japanese:
                    break;
            }
        }
示例#15
0
        // GET: Vers/Delete/5
        public ActionResult Delete(int?id)
        {
            if (id == null)
            {
                return(new HttpStatusCodeResult(HttpStatusCode.BadRequest));
            }
            Ver vers = db.Versions.Find(id);

            if (vers == null)
            {
                return(HttpNotFound());
            }
            return(View(vers));
        }
示例#16
0
        public string Edit(Ver ver)
        {
            try
            {
                dbContext.Entry(ver).State = System.Data.Entity.EntityState.Modified;
                dbContext.SaveChanges();

                return(Constants.AJAX_EDIT_SUCCESS_RETURN);
            }
            catch (Exception e1)
            {
                return("<p class='alert alert-danger'>出错了: " + e1.Message + "</p>");
            }
        }
示例#17
0
        public string Create(Ver ver)
        {
            try
            {
                dbContext.Vers.Add(ver);
                dbContext.SaveChanges();

                return(Constants.AJAX_CREATE_SUCCESS_RETURN);
            }
            catch (Exception e1)
            {
                return("<p class='alert alert-danger'>出错了: " + e1.Message + "</p>");
            }
        }
示例#18
0
    public override int GetHashCode()
    {
        int hash = 1;

        if (Ver.Length != 0)
        {
            hash ^= Ver.GetHashCode();
        }
        hash ^= info_.GetHashCode();
        if (_unknownFields != null)
        {
            hash ^= _unknownFields.GetHashCode();
        }
        return(hash);
    }
示例#19
0
        private void Ver_MouseLeftButtonDown(object sender, MouseButtonEventArgs e) //получение цвета нажатой ячейки левой сетки
        {
            Point c = e.GetPosition(Ver);

            try
            {
                TextBlock r = (TextBlock)Ver.InputHitTest(c);
                curColor.Fill = r.Background;
            }
            catch
            {
                Rectangle r = (Rectangle)Ver.InputHitTest(c);
                curColor.Fill = r.Fill;
            }
        }
示例#20
0
        public override int GetHashCode()
        {
            int hash = 1;

            if (Ver != 0)
            {
                hash ^= Ver.GetHashCode();
            }
            if (Name.Length != 0)
            {
                hash ^= Name.GetHashCode();
            }
            if (Id.Length != 0)
            {
                hash ^= Id.GetHashCode();
            }
            if (ResultCode.Length != 0)
            {
                hash ^= ResultCode.GetHashCode();
            }
            if (duration_ != null)
            {
                hash ^= Duration.GetHashCode();
            }
            if (success_ != null)
            {
                hash ^= Success.GetHashCode();
            }
            if (Data.Length != 0)
            {
                hash ^= Data.GetHashCode();
            }
            if (Type.Length != 0)
            {
                hash ^= Type.GetHashCode();
            }
            if (Target.Length != 0)
            {
                hash ^= Target.GetHashCode();
            }
            hash ^= Properties.GetHashCode();
            hash ^= Measurements.GetHashCode();
            if (_unknownFields != null)
            {
                hash ^= _unknownFields.GetHashCode();
            }
            return(hash);
        }
        public override int GetHashCode()
        {
            int hash = 1;

            if (Ver != 0)
            {
                hash ^= Ver.GetHashCode();
            }
            hash ^= metrics_.GetHashCode();
            hash ^= Properties.GetHashCode();
            if (_unknownFields != null)
            {
                hash ^= _unknownFields.GetHashCode();
            }
            return(hash);
        }
示例#22
0
        public string Delete(int id)
        {
            try
            {
                List <Ver> ls  = dbContext.Vers.ToList();
                Ver        ver = ls.Find(a => a.VerID == id);

                dbContext.Entry(ver).State = System.Data.Entity.EntityState.Deleted;
                dbContext.SaveChanges();

                return("删除成功");
            }
            catch (Exception e1)
            {
                return("出错了: " + e1.Message);
            }
        }
示例#23
0
        public AjaxResCode GetQQInfo()
        {
            AjaxResCode res = new AjaxResCode();

            try
            {
                if (!string.IsNullOrWhiteSpace(Ver))
                {
                    int verint = int.Parse(Ver.Replace(".", ""));
                    if (verint < 104)
                    {
                        res.Message    = Ver + "以下版本停用";
                        res.ResultCode = -1;
                        return(res);
                    }
                }
                else
                {
                    res.Message    = "PublicKey.rsa 证书已失效,请重新打开软件";
                    res.ResultCode = -2;
                    return(res);
                }


                HwPushCon = new HwPushContext();
                var qqinfo = HwPushCon.Hw_Users.Where(x => x.QQNumber == this.QQNumber).FirstOrDefault();
                if (qqinfo == null)
                {
                    res.Message    = this.QQNumber + ".rsa 证书已失效,请重新打开软件";
                    res.ResultCode = -2;
                    return(res);
                }
                qqinfo.PrivateKey = "";
                qqinfo.PublicKey  = "";
                qqinfo.QQInfo     = "";

                res.Data       = EncryptByModel(qqinfo);
                res.Message    = "成功";
                res.ResultCode = 1000;
            }
            catch (Exception ee)
            {
                res.Message = ee.Message;
            }
            return(res);
        }
示例#24
0
        public string QuickVer(Ver ver)
        {
            try
            {
                // 根据起始日期和频率,确定要制定多少条
                string[] firstDate = ver.VerYear.Split('/');
                string   verYear   = firstDate[0];
                int      verMonth  = int.Parse(firstDate[1]);
                int      freq      = ver.ReleaseFreq;

                int num = (12 - verMonth) / freq + 1; // 版本数量

                string[] verNos      = ver.VerNo.Split('.');
                int      changeVerNo = int.Parse(verNos[1]); //要变化的版本号为小数点后的数字

                for (int i = 0; i < num; i++)
                {
                    Ver v = new Ver()
                    {
                        SysId         = ver.SysId,
                        VerYear       = verYear,
                        ReleaseFreq   = freq,
                        PublishTime   = GetFourthThursday(verYear, verMonth.ToString()), // 自动设计为每月第四个周四
                        VerNo         = verNos[0] + "." + changeVerNo,
                        DraftPersonID = ver.DraftPersonID,
                        VerType       = "计划版本"
                    };
                    dbContext.Vers.Add(v);

                    // 月份变化
                    verMonth += freq;
                    // 版本号变化
                    changeVerNo++;
                }

                dbContext.SaveChanges();

                return(Constants.AJAX_CREATE_SUCCESS_RETURN);
            }

            catch (Exception e1)
            {
                return("<p class='alert alert-danger'>出错了: " + e1.Message + "</p>");
            }
        }
        public override int GetHashCode()
        {
            int hash = 1;

            if (Ver != 0)
            {
                hash ^= Ver.GetHashCode();
            }
            if (Id.Length != 0)
            {
                hash ^= Id.GetHashCode();
            }
            if (duration_ != null)
            {
                hash ^= Duration.GetHashCode();
            }
            if (ResponseCode.Length != 0)
            {
                hash ^= ResponseCode.GetHashCode();
            }
            if (success_ != null)
            {
                hash ^= Success.GetHashCode();
            }
            if (Source.Length != 0)
            {
                hash ^= Source.GetHashCode();
            }
            if (Name.Length != 0)
            {
                hash ^= Name.GetHashCode();
            }
            if (Url.Length != 0)
            {
                hash ^= Url.GetHashCode();
            }
            hash ^= Properties.GetHashCode();
            hash ^= Measurements.GetHashCode();
            if (_unknownFields != null)
            {
                hash ^= _unknownFields.GetHashCode();
            }
            return(hash);
        }
        public override int GetHashCode()
        {
            int hash = 1;

            if (Ver != 0)
            {
                hash ^= Ver.GetHashCode();
            }
            if (Name.Length != 0)
            {
                hash ^= Name.GetHashCode();
            }
            hash ^= Properties.GetHashCode();
            hash ^= Measurements.GetHashCode();
            if (_unknownFields != null)
            {
                hash ^= _unknownFields.GetHashCode();
            }
            return(hash);
        }
示例#27
0
        public static bool _Deserialize(string filename, int?ver, out object[] objs)
        {
            string lockname = "Serializer: " + filename.Replace("\\", "@");

            using (new NamedLock(lockname))
            {
                Stream          stream     = HFile.Open(filename, FileMode.Open, FileAccess.Read, FileShare.Read);
                BinaryFormatter bFormatter = new BinaryFormatter();
                {
                    if (ver != null)
                    {
                        try
                        {
                            Ver sver = (Ver)bFormatter.Deserialize(stream);
                            if (sver.ver != ver.Value)
                            {
                                stream.Close();
                                objs = null;
                                return(false);
                            }
                        }
                        catch (Exception)
                        {
                            stream.Close();
                            objs = null;
                            return(false);
                        }
                    }
                }
                {
                    System.Int32 count = (System.Int32)bFormatter.Deserialize(stream);
                    objs = new object[count];
                    for (int i = 0; i < count; i++)
                    {
                        objs[i] = bFormatter.Deserialize(stream);
                    }
                }
                stream.Close();
            }
            return(true);
        }
        public override int GetHashCode()
        {
            int hash = 1;

            if (Ver != 0)
            {
                hash ^= Ver.GetHashCode();
            }
            if (Id.Length != 0)
            {
                hash ^= Id.GetHashCode();
            }
            if (Name.Length != 0)
            {
                hash ^= Name.GetHashCode();
            }
            if (duration_ != null)
            {
                hash ^= Duration.GetHashCode();
            }
            if (Success != false)
            {
                hash ^= Success.GetHashCode();
            }
            if (RunLocation.Length != 0)
            {
                hash ^= RunLocation.GetHashCode();
            }
            if (Message.Length != 0)
            {
                hash ^= Message.GetHashCode();
            }
            hash ^= Properties.GetHashCode();
            hash ^= Measurements.GetHashCode();
            if (_unknownFields != null)
            {
                hash ^= _unknownFields.GetHashCode();
            }
            return(hash);
        }
        public override int GetHashCode()
        {
            int hash = 1;

            if (Ver != 0)
            {
                hash ^= Ver.GetHashCode();
            }
            if (Message_.Length != 0)
            {
                hash ^= Message_.GetHashCode();
            }
            if (SeverityLevel != 0)
            {
                hash ^= SeverityLevel.GetHashCode();
            }
            hash ^= Properties.GetHashCode();
            if (_unknownFields != null)
            {
                hash ^= _unknownFields.GetHashCode();
            }
            return(hash);
        }
示例#30
0
        private void Ver_MouseRightButtonDown(object sender, MouseButtonEventArgs e) //установка метки (кружка) на нужную ячейку левой сетки и ее снятие
        {
            Point p = e.GetPosition(Ver);

            try
            {
                TextBlock r = (TextBlock)Ver.InputHitTest(p);

                Ellipse el = new Ellipse();
                el.Height          = 19;
                el.Width           = 19;
                el.Fill            = Brushes.Transparent;
                el.Stroke          = Brushes.White;
                el.StrokeThickness = 1;
                Canvas.SetRight(el, Canvas.GetRight(r));
                Canvas.SetTop(el, Canvas.GetTop(r));
                Ver.Children.Add(el);
            }
            catch
            {
                Ellipse el = (Ellipse)Ver.InputHitTest(p);
                Ver.Children.Remove(el);
            }
        }
示例#31
0
        public ActionResult Edit(int id)
        {
            List <Ver> ls  = dbContext.Vers.ToList();
            Ver        ver = ls.Find(a => a.VerID == id);

            if (ver == null)
            {
                return(View());
            }

            List <RetailSystem> ls1 = this.GetSysList();

            SelectList sl1 = new SelectList(ls1, "SysID", "SysName");

            ViewBag.SysList = sl1;

            SelectList sl2 = null;

            User user = this.GetSessionCurrentUser();

            if (user != null)
            {
                sl2 = new SelectList(this.GetUserList(), "UID", "Realname", user.UID);
            }
            else
            {
                sl2 = new SelectList(this.GetUserList(), "UID", "Realname");
            }

            ViewBag.ReqPersonList = sl2;

            // 发布频率列表
            ViewBag.ReleaseFreqList = MyTools.GetSelectList(Constants.ReleaseFreqList);

            return(View(ver));
        }