Exemplo n.º 1
0
        public async Task<IHttpActionResult> PutPR(int id, PR pR)
        {
            if (!ModelState.IsValid)
            {
                return BadRequest(ModelState);
            }

            if (id != pR.PRID)
            {
                return BadRequest();
            }

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

            try
            {
                await db.SaveChangesAsync();
            }
            catch (DbUpdateConcurrencyException)
            {
                if (!PRExists(id))
                {
                    return NotFound();
                }
                else
                {
                    throw;
                }
            }

            return StatusCode(HttpStatusCode.NoContent);
        }
Exemplo n.º 2
0
 public Profile(string nick)
 {
     InitializeComponent();
     this.Nick = nick;
     pr        = new PR();
     ur        = new UR();
 }
Exemplo n.º 3
0
        private void navBarItem7_LinkClicked(object sender, DevExpress.XtraNavBar.NavBarLinkEventArgs e)
        {
            PR ObjPR = new PR();

            ObjPR.MdiParent = this;
            ObjPR.Show();
            ObjPR.BringToFront();
        }
Exemplo n.º 4
0
        public void ActionPR(int action, int id, int id_phongban, int sopr, string sopr_full, int nam, string congdung, string ngaytao, int thangtao, int tongsoluongyeucau, double tongtien, string ghichu, string ngayduyet, int id_nguoiduyet, int id_nguoidexuat, int tinhtrang, string prscanfile, bool sendmail, string tieude1, string tieude2, string tieude3, string tieude4, string tieude5, string tieude6, double ngansachduocduyet1, double ngansachduocduyet2, double ngansachduocduyet3, double ngansachduocduyet4, double ngansachduocduyet5, double ngansachduocduyet6, double dexuatlannay1, double dexuatlannay2, double dexuatlannay3, double dexuatlannay4, double dexuatlannay5, double dexuatlannay6, double luyke1, double luyke2, double luyke3, double luyke4, double luyke5, double luyke6, double thuathieu1, double thuathieu2, double thuathieu3, double thuathieu4, double thuathieu5, double thuathieu6)
        {
            PR        pr = new PR();
            List <PR> tb = pr.LayDanhSachPR(action, id, id_phongban, sopr, sopr_full, nam, congdung, ngaytao, thangtao, tongsoluongyeucau, tongtien, ghichu, ngayduyet, id_nguoiduyet, id_nguoidexuat, tinhtrang, prscanfile, sendmail, tieude1, tieude2, tieude3, tieude4, tieude5, tieude6, ngansachduocduyet1, ngansachduocduyet2, ngansachduocduyet3, ngansachduocduyet4, ngansachduocduyet5, ngansachduocduyet6, dexuatlannay1, dexuatlannay2, dexuatlannay3, dexuatlannay4, dexuatlannay5, dexuatlannay6, luyke1, luyke2, luyke3, luyke4, luyke5, luyke6, thuathieu1, thuathieu2, thuathieu3, thuathieu4, thuathieu5, thuathieu6);

            var js = new JavaScriptSerializer();

            Context.Response.Write(JsonConvert.SerializeObject(tb));
        }
Exemplo n.º 5
0
        public CommWindow(ObjectId id1, ObjectId id2, string nick, string nick2)

        {
            uR         = new UR();
            uS         = new PR();
            this.Nick  = nick;
            this.Nick2 = nick2;
            InitializeComponent();
            this.Id1 = id1;
            this.Id2 = id2;
        }
Exemplo n.º 6
0
        public static Findings RunPassivePlugin(PassivePlugin P, Session Irse)
        {
            Findings Results = new Findings();

            P.Check(Irse, Results, false);
            foreach (Finding PR in Results.GetAll())
            {
                PR.Plugin = P.Name;
                PR.Report();
            }
            return(Results);
        }
Exemplo n.º 7
0
        public static PluginResults RunPassivePlugin(PassivePlugin P, Session Irse)
        {
            PluginResults Results = new PluginResults();

            P.Check(Irse, Results);
            foreach (PluginResult PR in Results.GetAll())
            {
                PR.Plugin = P.Name;
                PR.Report();
            }
            return(Results);
        }
Exemplo n.º 8
0
        public async Task<IHttpActionResult> PostPR(PR pR)
        {
            if (!ModelState.IsValid)
            {
                return BadRequest(ModelState);
            }

            db.PRs.Add(pR);
            await db.SaveChangesAsync();

            return CreatedAtRoute("DefaultApi", new { id = pR.PRID }, pR);
        }
 public override int GetHashCode()
 {
     unchecked
     {
         int result = base.GetHashCode();
         result = (result * 397) ^ NotFoundOK.GetHashCode();
         result = (result * 397) ^ UseBasicQuorum.GetHashCode();
         result = (result * 397) ^ IncludeContext.GetHashCode();
         result = (result * 397) ^ (R != null ? R.GetHashCode() : 0);
         result = (result * 397) ^ (PR != null ? PR.GetHashCode() : 0);
         return(result);
     }
 }
Exemplo n.º 10
0
        public ActionResult CreateNew(PR pR)
        {
            pR.PRNo = _pRRepository.GetMaxPRNo();

            _pRRepository.Create(pR);

            //foreach (var _pRLine in pR.PRLines)
            //{
            //    _pRLineRepository.Create(_pRLine);
            //}

            //return Json(Url.Action("PRIdx", "PR"));
            return(Json(true));
        }
Exemplo n.º 11
0
 private void bt_pesquisar_Click_1(object sender, EventArgs e)
 {
     foreach (Projeto PR in DE.GetListaProjeto())
     {
         if (PR.GetNumero().ToString() == txt_contribuinte.Text)
         {
             lb_erro.Visible = false;
             lb_nome.Text    = PR.GetNome();
         }
         else
         {
             lb_nome.Visible = false;
         }
     }
 }
Exemplo n.º 12
0
 // Start is called before the first frame update
 void Start()
 {
     Main.SetActive(false);
     Profit.SetActive(false);
     PR.SetActive(false);
     info.SetActive(false);
     help.SetActive(false);
     initial.SetActive(true);
     El_Banco.SetActive(false);
     Poverty.SetActive(false);
     Badwill.SetActive(false);
     willandPov.SetActive(false);
     ChickenDinner.SetActive(false);
     COWARD.SetActive(false);
 }
Exemplo n.º 13
0
        } //End method decompress

        public string GetFilesMetrics(string Name, string Original, string Compresed)
        {
            string Metrics = Name.Replace(".txt", "") + '|';
            double RC, FC, PR;

            using (FileStream OR = new FileStream(Original, FileMode.Open))
                using (FileStream CM = new FileStream(Compresed, FileMode.Open))
                {
                    RC = Math.Round(CM.Length / (double)OR.Length, 3);
                    FC = Math.Round(OR.Length / (double)CM.Length, 3);
                    PR = Math.Round(((1 - RC) * 100), 2);
                }
            Metrics += RC.ToString() + "|" + FC.ToString() + "|" + PR.ToString();
            return(Metrics);
        } //End method for get file metrics
Exemplo n.º 14
0
Arquivo: PS.cs Projeto: Bodasyuk/NBD
        public bool CheckComm(string comm, ObjectId id, ObjectId OwnerId)
        {
            Posts post = new Posts();
            PR    pr   = new PR();

            post = pr.GetPostsById(id);

            foreach (var elem in post.comment)
            {
                if (elem.comm == comm && elem.OwnerId == OwnerId)
                {
                    return(false);
                }
            }

            return(true);
        }
Exemplo n.º 15
0
        //public IEnumerable<PR> GetAll()
        //{
        //    var _listPR =  _restaurantDBEntities.PRs.ToList();
        //    return _listPR;

        //}

        //public PR GetById(string pRNo)
        //{
        //    var _pR = _restaurantDBEntities.PRs.Where(s => s.PRNo == "200001").FirstOrDefault<PR>();
        //    var _pRLineRepository = new PRLineRepository();
        //    //_pR.PRLines = _pRLineRepository.GetById(pRNo);
        //    return _pR;

        //}
        public void Create(PR pR)
        {
            try
            {
                _restaurantDBEntities.PRs.Add(pR);
                _restaurantDBEntities.SaveChanges();
            }
            catch (DbEntityValidationException dbEx)
            {
                foreach (var validationErrors in dbEx.EntityValidationErrors)
                {
                    foreach (var validationError in validationErrors.ValidationErrors)
                    {
                        System.Console.WriteLine("Property: {0} Error: {1}", validationError.PropertyName, validationError.ErrorMessage);
                    }
                }
            }
        }
Exemplo n.º 16
0
        public SearchWindow(string nick, string nick2)
        {
            InitializeComponent();
            PersonNickName  = nick;
            PersonNickName2 = nick2;
            //
            repository     = new UR();
            services       = new US();
            postServices   = new PS();
            postRepository = new PR();
            //
            user                = new User();
            user                = repository.GetUserByNick(PersonNickName);
            UserName.Content    = user.person.Name;
            UserSurname.Content = user.person.Surname;
            UserMail.Content    = user.person.Mail;
            //
            currentPost = new Posts();
            posts       = new List <Posts>();
            posts       = postRepository.GetPostsByUserId(repository.GetUserId(PersonNickName));
            if (posts != null && posts.Count > 0)
            {
                currentPost = posts[indexOfPost];

                DG1.ItemsSource = currentPost.comment;
                isAnyPosts      = true;
            }
            else
            {
                Main.Content = "No posts yet";
            }
            //
            if (tempLike)
            {
                btnLike.Background = Brushes.Green;
                tempLike           = true;
            }

            user = repository.GetUserByNick(PersonNickName2);
            if (services.CheckAlreadyFollow(user.Nick, PersonNickName))
            {
                btnFollow.Background = Brushes.Green;
            }
        }
Exemplo n.º 17
0
        public void BaoCaoTre(int id_phongban, string denngay, string nguoiptmuahang)
        {
            PR        pr = new PR();
            DataTable tb = pr.BaoCaoTrePR(id_phongban, denngay, nguoiptmuahang);
            var       js = new JavaScriptSerializer();

            List <Dictionary <string, object> > parentRow = new List <Dictionary <string, object> >();
            Dictionary <string, object>         childRow;

            foreach (DataRow row in tb.Rows)
            {
                childRow = new Dictionary <string, object>();
                foreach (DataColumn col in tb.Columns)
                {
                    childRow.Add(col.ColumnName, row[col]);
                }
                parentRow.Add(childRow);
            }

            Context.Response.Write(JsonConvert.SerializeObject(parentRow));
        }
Exemplo n.º 18
0
        public ActionResult Create(PR pr)
        {
            if(ModelState.IsValid)
            {
                ViewBag.Message = "";

                if(!db.PR.ToList().Exists(x=>x.SNUM==pr.SNUM))
                {
                    db.PR.Add(pr);
                    db.SaveChanges();
                }
                else
                {
                    ViewBag.Message = "Такой номер уже существует!";
                    return View();
                }

                return RedirectToAction("Index");
            }
            return View();
        }
Exemplo n.º 19
0
        public void DongPR(string so_pr_full)
        {
            PR        pr = new PR();
            DataTable tb = pr.DongPR(so_pr_full);
            var       js = new JavaScriptSerializer();

            List <Dictionary <string, object> > parentRow = new List <Dictionary <string, object> >();
            Dictionary <string, object>         childRow;

            foreach (DataRow row in tb.Rows)
            {
                childRow = new Dictionary <string, object>();
                foreach (DataColumn col in tb.Columns)
                {
                    childRow.Add(col.ColumnName, row[col]);
                }
                parentRow.Add(childRow);
            }

            Context.Response.Write(JsonConvert.SerializeObject(parentRow));
        }
Exemplo n.º 20
0
        public void ThongTinPR_TinhTrang(int tinhtrang, int id_bp, bool muahang, bool kho)
        {
            PR        pr = new PR();
            DataTable tb = pr.LayThongTinSoLuongPR(tinhtrang, id_bp, muahang, kho);
            var       js = new JavaScriptSerializer();

            List <Dictionary <string, object> > parentRow = new List <Dictionary <string, object> >();
            Dictionary <string, object>         childRow;

            foreach (DataRow row in tb.Rows)
            {
                childRow = new Dictionary <string, object>();
                foreach (DataColumn col in tb.Columns)
                {
                    childRow.Add(col.ColumnName, row[col]);
                }
                parentRow.Add(childRow);
            }

            Context.Response.Write(JsonConvert.SerializeObject(parentRow));
        }
Exemplo n.º 21
0
        public ucMyProfile(string nick)
        {
            this.Nick = nick;
            InitializeComponent();
            uR = new UR();
            pR = new PR();
            Posts pr = new Posts();
            User  ur = new User();

            ur = uR.GetUserByNick(Nick);


            List <string> List1 = new List <string>();
            List <string> List2 = new List <string>();

            List1 = ur.Followers;
            List2 = ur.Following;
            List <Posts> lis = new List <Posts>();

            lis = pR.GetPostsByUserId(uR.GetUserId(Nick));
            dataGridView1.ItemsSource = List1;
            dataGridView2.ItemsSource = List2;
            dataGridView3.ItemsSource = lis;
        }
Exemplo n.º 22
0
        public void Constructor_PropertyTest()
        {
            PR pr = new PR(typeof(string).GetProperties()[0]);

            Assert.AreNotEqual(null, pr);
        }
Exemplo n.º 23
0
        private void bt_Guardar_Click_1(object sender, EventArgs e)
        {
            switch (t)
            {
            case 0:
                bool         aceite    = false;
                DialogResult adicionar = MessageBox.Show("Tem a certeza que pretende adicionar?", "Adicionar projecto", MessageBoxButtons.YesNo, MessageBoxIcon.Question);
                Projeto      P         = new Projeto();

                P.SetNome(txt_NomeProj.Text);
                P.SetNumero(Convert.ToInt32(txt_numero.Text));
                foreach (Empresa ai in RD.GetListaEmpresa())
                {
                    if (ai.getNIF() == Convert.ToInt32(cb_NifEmpresa.Text))
                    {
                        P.SetNIF(Convert.ToInt32(cb_NifEmpresa.Text));
                        aceite = true;
                    }
                }
                P.SetObjetivo(txt_Objetivo.Text);
                P.SetDescricao(txt_Descricao.Text);

                if (aceite == true)
                {
                    RD.GetListaProjeto().Add(P);
                    foreach (Aluno al in RD.GetListaPessoa().OfType <Aluno>())
                    {
                        if (al.GetNome() == cb_Alunos.Text)
                        {
                            P.EnviarEmailProjeto(al);
                        }
                    }



                    this.Close();
                }
                else
                {
                    MessageBox.Show("Nao existe");
                }



                break;

            case 1:
                DialogResult editar = MessageBox.Show("Tem a certeza que quer guardar as alteraçãoes?", "Guardar alterações", MessageBoxButtons.YesNo, MessageBoxIcon.Question);
                foreach (Projeto PR in RD.GetListaProjeto())
                {
                    if (cb_NomeProj.Text == PR.GetAluno().ToString())
                    //(cb_Nome.Text == AL.GetNome())
                    {
                        PR.GetAluno().SetNome(txt_NomeProj.Text);
                        //AL.GetMoradaP().GetCodPostal().SetCampo1(Convert.ToInt32(txt_Campo1.Text));
                        //AL.GetMoradaP().GetCodPostal().SetCampo2(Convert.ToInt32(txt_campo2.Text));
                        this.Close();
                    }
                }
                DialogResult change = MessageBox.Show("Tem a certeza que quer guardar as alteraçãoes?", "Guardar alterações", MessageBoxButtons.YesNo, MessageBoxIcon.Question);
                break;

            default:
                break;
            }
        }
Exemplo n.º 24
0
        public void Notify(params object[] args)
        {
            #region 从事件参数中取得当前业务实体

            //从事件参数中取得当前业务实体
            if (args == null || args.Length == 0 || !(args[0] is UFSoft.UBF.Business.EntityEvent))
            {
                return;
            }
            BusinessEntity.EntityKey key = ((UFSoft.UBF.Business.EntityEvent)args[0]).EntityKey;
            if (key == null)
            {
                return;
            }
            PurchaseOrder po = key.GetEntity() as PurchaseOrder;
            if (po == null)
            {
                return;
            }

            if (po.Status == PODOCStatusEnum.Approving && po.OriginalData.Status == PODOCStatusEnum.Opened)
            {
                //是否走OA接口
                string profileValue = Common.GetProfileValue(Common.iProfileCode, Context.LoginOrg.ID);
                if (profileValue.ToLower() == "true")
                {
                    #region 根据描述是否推送到OA

                    string docTypeDesc = po.DocumentType.Description;
                    if (string.IsNullOrEmpty(docTypeDesc))
                    {
                        return;
                    }
                    string returnMsg    = string.Empty;
                    string businessType = "OA流程创建";
                    string requestName  = "采购订单" + po.DocNo + "审批";
                    User   user         = User.Finder.FindByID(Context.LoginUserID);
                    string userID       = user.Code;
                    string workflowId   = po.DocumentType.DescFlexField.PrivateDescSeg1;
                    bool   isPO         = true;
                    if (po.TC.Code.ToUpper() != "C001")
                    {
                        workflowId = po.DocumentType.DescFlexField.PrivateDescSeg2;
                    }
                    string            oaRquestID = po.DescFlexField.PrivateDescSeg30;
                    POLine.EntityList polines    = po.POLines;



                    if (string.IsNullOrEmpty(oaRquestID))
                    {
                        string url = Common.GetProfileValue(Common.csProfileCode, Context.LoginOrg.ID);
                        string workflowRequestInfo = Common.CreateXmlString(requestName, userID, workflowId, isPO, polines, null);
                        WeaverOAService.WorkflowServiceXml client = new WeaverOAService.WorkflowServiceXml();
                        client.Url = url;
                        returnMsg  = client.doCreateWorkflowRequest(workflowRequestInfo, userID);
                    }
                    else
                    {
                        businessType = "OA流程更新";
                        string url = Common.GetProfileValue(Common.msProfileCode, Context.LoginOrg.ID);
                        string workflowRequestInfo = Common.CreateXmlStringForUpdate(oaRquestID, userID, workflowId, isPO, polines, null);
                        WeaverOAForUpadteService.WorkflowServiceforUpadte client = new WeaverOAForUpadteService.WorkflowServiceforUpadte();
                        client.Url = url;
                        bool flag = client.RequestUpdate(workflowRequestInfo);
                        if (flag == false)
                        {
                            returnMsg = "-1";
                        }
                        else
                        {
                            returnMsg = oaRquestID;
                        }
                    }
                    if (string.IsNullOrEmpty(returnMsg) || returnMsg.StartsWith("-"))
                    {
                        string msg = businessType + "失败,请联系系统管理员!OA返回值:" + returnMsg;
                        throw new Exception(msg);
                    }
                    if (string.IsNullOrEmpty(oaRquestID))
                    {
                        po.DescFlexField.PrivateDescSeg30 = returnMsg;
                    }

                    #endregion
                }
                //是否走易派客接口
                string eprcProfileValue = Common.GetProfileValue("ZS006", Context.LoginOrg.ID);
                if (eprcProfileValue.ToLower() == "true")
                {
                    #region 回写易派客订单状态

                    //根据来源单据号取得请购单数据
                    List <long> list = new List <long>();
                    foreach (POLine line in po.POLines)
                    {
                        if (line.SrcDocInfo != null && line.SrcDocInfo.SrcDoc != null)
                        {
                            long srcDoc = line.SrcDocInfo.SrcDoc.EntityID;
                            if (list.Contains(srcDoc) == false)
                            {
                                list.Add(srcDoc);
                            }
                        }
                    }
                    foreach (long srcDoc in list)
                    {
                        PR     pr                = PR.Finder.FindByID(srcDoc);
                        string orderId           = pr.DescFlexField.PrivateDescSeg25;
                        string purchasecompanyid = pr.DescFlexField.PrivateDescSeg26;
                        string orderStatus       = "13";
                        string returnCheckTime   = DateTime.Now.ToString("yyyy-MM-dd HH:mm:ss");
                        if (string.IsNullOrEmpty(orderId))
                        {
                            continue;
                        }
                        string epecUrl     = Common.GetProfileValue("ZS007", Context.LoginOrg.ID);
                        string corpCode    = Common.GetProfileValue("ZS011", Context.LoginOrg.ID);//公司代码
                        string accessToken = GetAccessToken(epecUrl);

                        StringBuilder urlBuilder = new StringBuilder(epecUrl);
                        urlBuilder.Append("/apigate/v2/order/approve");
                        urlBuilder.Append("?access_token=").Append(accessToken);
                        urlBuilder.Append("&data=");
                        urlBuilder.Append("{\"corpcode\":\"").Append(corpCode).Append("\",");
                        urlBuilder.Append("\"orderId\":\"").Append(orderId).Append("\",");
                        urlBuilder.Append("\"purchaseCompanyId\":\"").Append(purchasecompanyid).Append("\",");
                        urlBuilder.Append("\"orderStatus\":\"").Append(orderStatus).Append("\",");
                        urlBuilder.Append("\"returnCheckTime\":\"").Append(returnCheckTime).Append("\"}");

                        string serviceAddress = urlBuilder.ToString();
                        logger.Error("获取消息请求地址:" + serviceAddress);

                        HttpWebRequest request = (HttpWebRequest)WebRequest.Create(serviceAddress);
                        request.Method      = "POST";
                        request.ContentType = "application/json";
                        HttpWebResponse response         = (HttpWebResponse)request.GetResponse();
                        Stream          myResponseStream = response.GetResponseStream();
                        StreamReader    reader           = new StreamReader(myResponseStream, Encoding.UTF8);
                        string          jsonString       = reader.ReadToEnd();

                        logger.Error("请购请求返回值:" + jsonString);
                        //解析josn
                        JObject jo       = JObject.Parse(jsonString);
                        string  epecFlag = jo["success"].ToString();
                        string  rtnData  = jo["data"].ToString();
                        if (epecFlag.ToLower() == "false")
                        {
                            if (string.IsNullOrEmpty(rtnData) || rtnData.ToLower() == "null")
                            {
                                string code  = jo["code"].ToString();
                                string exMsg = jo["msg"].ToString();
                                throw new Exception("请求易派客系统发生错误:Code=" + code + ",Msg=" + exMsg);
                            }
                            jo = JObject.Parse(rtnData);
                            string isMatch = jo["ismatch"].ToString();
                            string remark  = jo["remark"].ToString();
                            if (epecFlag.ToLower() == "false")
                            {
                                string exMsg = jo["msg"].ToString();
                                throw new Exception("请求易派客系统发生错误:" + exMsg);
                            }
                            if (isMatch == "0")
                            {
                                throw new Exception("传递数据到易派客系统发生错误:" + remark);
                            }
                        }
                    }

                    #endregion
                }
            }

            #endregion
        }
Exemplo n.º 25
0
    public IEnumerator Load()
    {
        MemoryStream stream;
        WWW          www;

        // Multilingual
        www = new WWW(this.SetPath("Multilingual_Multilingual"));
        yield return(www);

        stream = new MemoryStream(www.bytes);
        BinaryReader multilingualBinaryReader = new BinaryReader(stream);

        Table.Multilingual = new Dictionary <int, Multilingual>();

        for (int i = 0; i < 100; i++)
        {
            Multilingual multilingual = new Multilingual();

            multilingual.Num = multilingualBinaryReader.ReadInt32();
            multilingual.Kor = multilingualBinaryReader.ReadString();
            multilingual.Eng = multilingualBinaryReader.ReadString();
            multilingual.Jpn = multilingualBinaryReader.ReadString();

            Table.Multilingual.Add(multilingual.Num, multilingual);
        }
        multilingualBinaryReader.Close();
        stream.Close();

        // PR
        www = new WWW(this.SetPath("PR_Client"));
        yield return(www);

        stream = new MemoryStream(www.bytes);
        BinaryReader prBinaryReader = new BinaryReader(stream);

        Table.PR = new Dictionary <int, PR>();

        for (int i = 0; i < 19; i++)
        {
            PR pr = new PR();

            pr.Num     = prBinaryReader.ReadInt32();
            pr.Type    = prBinaryReader.ReadString();
            pr.Key     = prBinaryReader.ReadString();
            pr.Value   = prBinaryReader.ReadString();
            pr.Comment = prBinaryReader.ReadString();

            Table.PR.Add(pr.Num, pr);
        }
        prBinaryReader.Close();
        stream.Close();

        // NPC
        www = new WWW(this.SetPath("NPC_Client"));
        yield return(www);

        stream = new MemoryStream(www.bytes);
        BinaryReader npcBinaryReader = new BinaryReader(stream);

        Table.NPC = new Dictionary <int, NPC>();

        for (int i = 0; i < 23; i++)
        {
            NPC npc = new NPC();

            npc.Num            = npcBinaryReader.ReadInt32();
            npc.Property       = npcBinaryReader.ReadInt32();
            npc.Weapon         = (TagManager.Table.Tag.Weapon)Enum.Parse(typeof(TagManager.Table.Tag.Weapon), npcBinaryReader.ReadString());
            npc.Race           = npcBinaryReader.ReadInt32();
            npc.Grade          = npcBinaryReader.ReadByte();
            npc.Level          = npcBinaryReader.ReadByte();
            npc.HP             = npcBinaryReader.ReadInt32();
            npc.Exp            = npcBinaryReader.ReadInt32();
            npc.CLevelExp      = npcBinaryReader.ReadInt32();
            npc.AddSkill01     = npcBinaryReader.ReadInt32();
            npc.RateSkill01    = npcBinaryReader.ReadInt32();
            npc.AddSkill02     = npcBinaryReader.ReadInt32();
            npc.RateSkill02    = npcBinaryReader.ReadInt32();
            npc.AddSkill03     = npcBinaryReader.ReadInt32();
            npc.RateSkill03    = npcBinaryReader.ReadInt32();
            npc.AddSkill04     = npcBinaryReader.ReadInt32();
            npc.RateSkill04    = npcBinaryReader.ReadInt32();
            npc.AddSkill05     = npcBinaryReader.ReadInt32();
            npc.RateSkill05    = npcBinaryReader.ReadInt32();
            npc.MinGold        = npcBinaryReader.ReadInt32();
            npc.MaxGold        = npcBinaryReader.ReadInt32();
            npc.DropPosibility = npcBinaryReader.ReadInt32();
            npc.Bag01          = npcBinaryReader.ReadInt32();
            npc.Rate01         = npcBinaryReader.ReadInt32();
            npc.Bag02          = npcBinaryReader.ReadInt32();
            npc.Rate02         = npcBinaryReader.ReadInt32();
            npc.Bag03          = npcBinaryReader.ReadInt32();
            npc.Rate03         = npcBinaryReader.ReadInt32();
            npc.Bag04          = npcBinaryReader.ReadInt32();
            npc.Rate04         = npcBinaryReader.ReadInt32();
            npc.Bag05          = npcBinaryReader.ReadInt32();
            npc.Rate05         = npcBinaryReader.ReadInt32();
            npc.NPC_FileName   = npcBinaryReader.ReadString();
            npc.NPC_Prefab     = npcBinaryReader.ReadString();

            Table.NPC.Add(npc.Num, npc);
        }
        npcBinaryReader.Close();
        stream.Close();

        // Tag
        www = new WWW(this.SetPath("Tag_Client"));
        yield return(www);

        stream = new MemoryStream(www.bytes);
        BinaryReader tagBinaryReader = new BinaryReader(stream);

        Table.Tag = new Dictionary <int, Tag>();

        for (int i = 0; i < 15; i++)
        {
            Tag tag = new Tag();

            tag.Num    = tagBinaryReader.ReadInt32();
            tag.Type   = tagBinaryReader.ReadString();
            tag.Item   = tagBinaryReader.ReadString();
            tag.Weapon = tagBinaryReader.ReadString();
            tag.Armor  = tagBinaryReader.ReadString();

            Table.Tag.Add(tag.Num, tag);
        }
        tagBinaryReader.Close();
        stream.Close();

        // Item
        www = new WWW(this.SetPath("Item_Client"));
        yield return(www);

        stream = new MemoryStream(www.bytes);
        BinaryReader itemBinaryReader = new BinaryReader(stream);

        Table.Item = new Dictionary <int, Item>();

        for (int i = 0; i < 57; i++)
        {
            Item item = new Item();

            item.Num           = itemBinaryReader.ReadInt32();
            item.ItemType      = itemBinaryReader.ReadString();
            item.Grade         = itemBinaryReader.ReadByte();
            item.SetNum        = itemBinaryReader.ReadInt32();
            item.LimitLevel    = itemBinaryReader.ReadByte();
            item.LimitJob      = itemBinaryReader.ReadInt32();
            item.Kind          = itemBinaryReader.ReadByte();
            item.EquipLocation = itemBinaryReader.ReadInt32();
            item.Buy           = itemBinaryReader.ReadInt32();
            item.Sell          = itemBinaryReader.ReadInt32();
            item.BuyCrystal    = itemBinaryReader.ReadInt32();
            item.Stacks        = itemBinaryReader.ReadByte();
            item.Attribute     = itemBinaryReader.ReadByte();
            item.Material      = itemBinaryReader.ReadInt32();
            item.HitRate       = itemBinaryReader.ReadInt32();
            item.Atk           = itemBinaryReader.ReadInt32();
            item.FireAtk       = itemBinaryReader.ReadInt32();
            item.WaterAtk      = itemBinaryReader.ReadInt32();
            item.NatureAtk     = itemBinaryReader.ReadInt32();
            item.LightAtk      = itemBinaryReader.ReadInt32();
            item.DarkAtk       = itemBinaryReader.ReadInt32();
            item.Def           = itemBinaryReader.ReadInt32();
            item.FireDef       = itemBinaryReader.ReadInt32();
            item.WaterDef      = itemBinaryReader.ReadInt32();
            item.NatureDef     = itemBinaryReader.ReadInt32();
            item.LightDef      = itemBinaryReader.ReadInt32();
            item.DarkDef       = itemBinaryReader.ReadInt32();
            item.ActiveSkill   = itemBinaryReader.ReadInt32();
            item.PassiveSkill  = itemBinaryReader.ReadInt32();
            item.CharmSkill    = itemBinaryReader.ReadInt32();
            item.Tooltip       = itemBinaryReader.ReadInt32();
            item.AtlasName     = itemBinaryReader.ReadString();
            item.imgFileName   = itemBinaryReader.ReadString();

            Table.Item.Add(item.Num, item);
        }
        itemBinaryReader.Close();
        stream.Close();

        this.isLoad = true;
    }
Exemplo n.º 26
0
 public void Update(PR pR)
 {
     _restaurantDBEntities.Entry(pR).State = EntityState.Modified;
 }
Exemplo n.º 27
0
    public void Open(int selector)
    {
        if (selector == 1)
        {
            Main.SetActive(true);
            Profit.SetActive(false);
            PR.SetActive(false);
            info.SetActive(false);
            help.SetActive(false);
            initial.SetActive(false);
            El_Banco.SetActive(false);
            Poverty.SetActive(false);
            Badwill.SetActive(false);
            willandPov.SetActive(false);
            ChickenDinner.SetActive(false);
            COWARD.SetActive(false);
        }
        if (selector == 2)
        {
            Main.SetActive(false);
            Profit.SetActive(true);
            PR.SetActive(false);
            info.SetActive(false);
            help.SetActive(false);
            El_Banco.SetActive(false);

            initial.SetActive(false);
            Poverty.SetActive(false);
            Badwill.SetActive(false);
            willandPov.SetActive(false);
            ChickenDinner.SetActive(false);
            COWARD.SetActive(false);
        }
        if (selector == 3)
        {
            Main.SetActive(false);
            Profit.SetActive(false);
            PR.SetActive(true);
            info.SetActive(false);
            help.SetActive(false);
            initial.SetActive(false);
            El_Banco.SetActive(false);
            Poverty.SetActive(false);
            Badwill.SetActive(false);
            willandPov.SetActive(false);
            ChickenDinner.SetActive(false);
            COWARD.SetActive(false);
        }
        if (selector == 4)
        {
            Main.SetActive(false);
            Profit.SetActive(false);
            PR.SetActive(false);
            info.SetActive(true);
            help.SetActive(false);
            initial.SetActive(false);
            El_Banco.SetActive(false);
            Poverty.SetActive(false);
            Badwill.SetActive(false);
            willandPov.SetActive(false);
            ChickenDinner.SetActive(false);
            COWARD.SetActive(false);
        }
        if (selector == 5)
        {
            Main.SetActive(false);
            Profit.SetActive(false);
            PR.SetActive(false);
            info.SetActive(false);
            help.SetActive(true);
            initial.SetActive(false);
            El_Banco.SetActive(false);
            Poverty.SetActive(false);
            Badwill.SetActive(false);
            willandPov.SetActive(false);
            ChickenDinner.SetActive(false);
            COWARD.SetActive(false);
        }
        if (selector == 6)
        {
            Main.SetActive(true);
            Profit.SetActive(false);
            PR.SetActive(false);
            info.SetActive(false);
            help.SetActive(false);
            initial.SetActive(false);
            El_Banco.SetActive(false);
            Poverty.SetActive(false);
            Badwill.SetActive(false);
            willandPov.SetActive(false);
            ChickenDinner.SetActive(false);
            COWARD.SetActive(false);
        }
        if (selector == 7)
        {
            Application.Quit();
            print("quit");
        }
        if (selector == 8)
        {
            Main.SetActive(false);
            Profit.SetActive(false);
            PR.SetActive(false);
            info.SetActive(false);
            help.SetActive(false);
            initial.SetActive(true);
            El_Banco.SetActive(false);
            Poverty.SetActive(false);
            Badwill.SetActive(false);
            willandPov.SetActive(false);
            ChickenDinner.SetActive(false);
            COWARD.SetActive(false);
        }
        if (selector == 9)
        {
            Main.SetActive(false);
            Profit.SetActive(false);
            PR.SetActive(false);
            info.SetActive(false);
            help.SetActive(false);
            initial.SetActive(false);
            El_Banco.SetActive(true);
            Poverty.SetActive(false);
            Badwill.SetActive(false);
            willandPov.SetActive(false);
            ChickenDinner.SetActive(false);
            COWARD.SetActive(false);
        }
        if (selector == 10)
        {
            Main.SetActive(false);
            Profit.SetActive(false);
            PR.SetActive(false);
            info.SetActive(false);
            help.SetActive(false);
            initial.SetActive(false);
            El_Banco.SetActive(false);
            Poverty.SetActive(true);
            Badwill.SetActive(false);
            willandPov.SetActive(false);
            ChickenDinner.SetActive(false);
            COWARD.SetActive(false);
        }
        if (selector == 11)
        {
            Main.SetActive(false);
            Profit.SetActive(false);
            PR.SetActive(false);
            info.SetActive(false);
            help.SetActive(false);
            initial.SetActive(false);
            El_Banco.SetActive(false);
            Poverty.SetActive(false);
            Badwill.SetActive(true);
            willandPov.SetActive(false);
            ChickenDinner.SetActive(false);
            COWARD.SetActive(false);
        }
        if (selector == 12)
        {
            Main.SetActive(false);
            Profit.SetActive(false);
            PR.SetActive(false);
            info.SetActive(false);
            help.SetActive(false);
            initial.SetActive(false);
            El_Banco.SetActive(false);
            Poverty.SetActive(false);
            Badwill.SetActive(false);
            willandPov.SetActive(true);
            ChickenDinner.SetActive(false);
            COWARD.SetActive(false);
        }
        if (selector == 13)
        {
            Main.SetActive(false);
            Profit.SetActive(false);
            PR.SetActive(false);
            info.SetActive(false);
            help.SetActive(false);
            initial.SetActive(false);
            El_Banco.SetActive(false);
            Poverty.SetActive(false);
            Badwill.SetActive(false);
            willandPov.SetActive(false);
            ChickenDinner.SetActive(true);
            COWARD.SetActive(false);
        }
        if (selector == 14)
        {
            Main.SetActive(false);
            Profit.SetActive(false);
            PR.SetActive(false);
            info.SetActive(false);
            help.SetActive(false);
            initial.SetActive(false);
            El_Banco.SetActive(false);
            Poverty.SetActive(false);
            Badwill.SetActive(false);
            willandPov.SetActive(false);
            ChickenDinner.SetActive(false);
            COWARD.SetActive(true);
        }
    }
Exemplo n.º 28
0
        public ActionResult Edit(PR pr)
        {
            try
            {
                if(ModelState.IsValid)
                {

                    PR oldPR = db.PR.ToList().Find(x => x.SNUM == pr.SNUM);
                    PR newPR = pr;

                    db.Entry(oldPR).CurrentValues.SetValues(newPR);
                    db.SaveChanges();
                }

                return RedirectToAction("Index");
            }
            catch
            {
                return View();
            }
        }
Exemplo n.º 29
0
        public void ToString_PropertyTest()
        {
            PR pr = new PR(typeof(string).GetProperties()[0]);

            Assert.AreEqual("[p]System.Char Chars", pr.ToString());
        }
Exemplo n.º 30
0
 public Control(PR pr)
 {
     this.pr = pr;
 }