Ejemplo n.º 1
0
        public IActionResult Put(info information)
        {
            if (information.ID == null || information.ID < 1)
            {
                return(BadRequest("Invalid member Id"));
            }

            var dbInfo = _ctx.Info.Find(information.ID);

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

            dbInfo.FullName       = information.FullName;
            dbInfo.CollegeProgram = information.CollegeProgram;
            dbInfo.YearInProgram  = information.YearInProgram;
            dbInfo.Birthdate      = information.Birthdate;
            _ctx.Info.Update(dbInfo);
            var changes = _ctx.SaveChanges();

            if (changes > 0)
            {
                return(NoContent());
            }


            return(StatusCode(500, "Error occured on the server. Please try again in a few minutes."));
        }
Ejemplo n.º 2
0
        }//tìm vị trí số 0 trong TAB S , k là số hàng , l là số cột

        public static void Xulyke(info X, info BK, ref int go, int k, int l, ref List T)
        {
            BK.num   = q;
            q        = q + 1;
            BK.numgo = X.num;
            BK.g     = X.g + 1;
            int tam = BK.S[k, l];

            if (go == UP)
            {
                BK.S[k, l]     = BK.S[k + 1, l];
                BK.S[k + 1, l] = tam;
            }
            else if (go == DN)
            {
                BK.S[k, l]     = BK.S[k - 1, l];
                BK.S[k - 1, l] = tam;
            }
            else if (go == LT)
            {
                BK.S[k, l]     = BK.S[k, l + 1];
                BK.S[k, l + 1] = tam;
            }
            else
            {
                BK.S[k, l]     = BK.S[k, l - 1];
                BK.S[k, l - 1] = tam;
            }
            BK.h = count(G);
            BK.f = BK.g + BK.h;
            T.them(BK);
        }//thêm các giá trị trong info BK và lưu vào List T
Ejemplo n.º 3
0
    void Start()
    {
        H = graphContainer.sizeDelta.y;
        W = graphContainer.sizeDelta.x;
        string challengeName = Challenge.LoadCurrentChallenge().challengeName;

        Name.text = challengeName + " CHALLENGE";
        SortedDictionary <string, List <DailyRecord> > record = UserData.LoadUserData().record;

        if (record.ContainsKey(challengeName))
        {
            List <int> list = ConvertToGraph(record[challengeName]);
            showGraph(list);
        }

        info [] Diff = new info[3] {
            new info("Easy", 0.33), new info("Medium", 0.33), new info("Hard", 0.34)
        };
        info [] Time = new info[3] {
            new info("Short", 0.33), new info("Medium", 0.33), new info("Long", 0.34)
        };
        info [] Feel = new info[3] {
            new info("Bad", 0.33), new info("Normal", 0.33), new info("Good", 0.34)
        };
        difficulty.AddRange(Diff);
        time.AddRange(Time);
        feeling.AddRange(Feel);
    }
Ejemplo n.º 4
0
        protected void Page_Load(object sender, EventArgs e)
        {
            Stopwatch watch1 = new Stopwatch();

            watch1.Start();
            info info = new info();
            JavaScriptSerializer serializer = new JavaScriptSerializer();
            NameValueCollection  req        = PublicClass.FillFromEncodedBytes(base.Request.BinaryRead(base.Request.ContentLength), Encoding.UTF8);

            try
            {
                if (req["excode"].Length > 0)
                {
                    info.code    = 1;
                    info.message = "成功";
                    info.data    = loaddata(req["excode"]);
                }
                else
                {
                    info.code    = 0;
                    info.message = "失败";
                }
            }
            catch (Exception ex)
            {
                //new Thread(() => errorBll.log("interface_ExchangeData", ex.ToString(), "")).Start();
            }

            string str = serializer.Serialize(info);

            Response.Write(str);
            watch1.Stop();
            //new Thread((ThreadStart)(() => log_interfaceBll.add("wx_mko2oorder", Convert.ToInt32(watch1.ElapsedMilliseconds)))).Start();
        }
Ejemplo n.º 5
0
    // Use this for initialization
    void start()
    {
        inf = new info();



        inf.playerName = "Rob";
        inf.online     = true;
        inf.level      = 50;
        inf.score      = 5000;



        /*
         * pinfo2.playerName = "Sue";
         * pinfo2.online = true;
         * pinfo2.level = 40;
         * pinfo2.score = 5470;
         *
         * pinfo3.playerName = "Suzy";
         * pinfo3.online = false;
         * pinfo3.level = 60;
         * pinfo3.score = 6000;
         */

        openWith.Add("Rob", inf);
    }
Ejemplo n.º 6
0
 private void buildChart()
 {
     for (int bar = 0; bar < 3; bar++)     //xét trên từng thanh
     {
         for (int cat = 0; cat < 3; cat++) //xét trên 3 category
         {
             RectTransform Bar      = (RectTransform)bars[bar].GetChild(cat);
             info          Category = categories[bar][cat];
             if (Category.percent > 0)
             {
                 if (cat == 0)
                 {
                     Bar.SetLeft(0);
                     Bar.SetRight((float)(500 - (500 * Category.percent)));
                 }
                 if (cat == 1)
                 {
                     float left  = (float)(500 * categories[bar][cat - 1].percent <= 250? 500 * categories[bar][cat - 1].percent : 250);
                     float right = (float)(500 * categories[bar][cat + 1].percent <= 250? 500 * categories[bar][cat + 1].percent : 250);
                     Bar.SetLeft(left);
                     Bar.SetRight(right);
                 }
                 if (cat == 2)
                 {
                     Bar.SetLeft((float)(500 - (500 * Category.percent)));
                     Bar.SetRight(0);
                 }
             }
         }
     }
 }
Ejemplo n.º 7
0
Archivo: trie.cs Proyecto: zjmit/go2cs
                    // appendMapping appends the mapping for the respective rune. isMapped must be
                    // true. A mapping is a categorization of a rune as defined in UTS #46.
                    private static slice <byte> appendMapping(this info c, slice <byte> b, @string s)
                    {
                        var index = int(c >> (int)(indexShift));

                        if (c & xorBit == 0L)
                        {
                            var s = mappings[index..];
Ejemplo n.º 8
0
 public void CreateWeather(info s)
 {
     using (var cn = new SqlConnection(@"Data Source=(LocalDB)\v11.0;AttachDbFilename" +
      "=|DataDirectory|\\Database.mdf; Integrated Security=True"))
     {
         string _insertSql = @"INSERT INTO [dbo].[Weather]
                                     ([LastRefresh], [Temperature], [WindChill], [Icon], [WindSpeed])
                                     VALUES (@LastRefresh, @Temperature, @WindChill, @Icon, @WindSpeed)";
         var insertCmd = new SqlCommand(_insertSql, cn);
         insertCmd.Parameters
             .Add(new SqlParameter("@LastRefresh", SqlDbType.DateTime))
             .Value = DateTime.Now;
         insertCmd.Parameters
             .Add(new SqlParameter("@Temperature", SqlDbType.NVarChar))
             .Value = s.temp_f;
         insertCmd.Parameters
             .Add(new SqlParameter("@WindChill", SqlDbType.NVarChar))
             .Value = s.windchill_f;
         insertCmd.Parameters
             .Add(new SqlParameter("@Icon", SqlDbType.NVarChar))
             .Value = s.icon_url;
         insertCmd.Parameters
             .Add(new SqlParameter("@WindSpeed", SqlDbType.NVarChar))
             .Value = s.wind_mph;
         cn.Open();
         insertCmd.ExecuteNonQuery();
         cn.Close();
     }
 }
Ejemplo n.º 9
0
 int vitri(info X)
 {
     for (int t = 0; t < n; t++)
     {
         bool check = true;//kiem tra co
         for (int i = 0; i < 3; i++)
         {
             if (check == true)
             {
                 for (int j = 0; j < 3; j++)
                 {
                     if (X.S[i, j] != e[t].S[i, j])
                     {
                         check = false;
                         break;
                     }
                 }
             }
         }
         if (check == true)
         {
             return(t);
         }
     }
     return(-1);
 }
Ejemplo n.º 10
0
        private void cmi_SellOrder_item_delete_Click(object sender, EventArgs e)
        {
            if (0 < sold_rem_list.SelectedItems.Count && "ჯამი" != sold_rem_list.SelectedItems[0].Text)
            {
                if (DialogResult.Yes == MessageBox.Show("დარწმუნებული ხართ, რომ გსურთ სიიდან \"" + sold_rem_list.SelectedItems[0].SubItems[SOd_prodname_col.Index].Text + "\"-ს ამოშლა?", "დადასტურება!", MessageBoxButtons.YesNo, MessageBoxIcon.Question))
                {
                    info remremainder_info = info.niy();
                    //delete selected remainder/SoldRemainder
                    switch (this.ViewMode)
                    {
                    case DetailedListViewMode.SellOrder:
                        remremainder_info = ProductInfo_Main_Form.conn.RemoveSoldRemainder(Int32.Parse(sold_rem_list.SelectedItems[0].SubItems[SOd_id_col.Index].Text));
                        break;

                    case DetailedListViewMode.BoughtZed:
                        remremainder_info = ProductInfo_Main_Form.conn.RemoveRemainder(Int32.Parse(sold_rem_list.SelectedItems[0].SubItems[SOd_id_col.Index].Text));
                        break;

                    case DetailedListViewMode.SoldZed:
                        remremainder_info = ProductInfo_Main_Form.conn.RemoveSoldRemainder(Int32.Parse(sold_rem_list.SelectedItems[0].SubItems[SOd_id_col.Index].Text));
                        break;
                    }
                    MessageBox.Show(remremainder_info.details, remremainder_info.errcode.ToString());
                }
            }
        }
Ejemplo n.º 11
0
        public void Create_InputinfoWithId0_SetinfoId1()
        {
            // Arrange
            int          expectedListCount = 7;
            var          context           = SqlLiteInMemoryContext();
            EFUnitOfWork uow = new EFUnitOfWork(context);

            Catalog.DAL.Repositories.Interfaces.infoRepository repository = uow.infos;

            info info = new info()
            {
                CatalogID   = 7,
                Name        = "testN",
                Description = "testD",
                Catalog     = new Catalog.DAL.Entities.Catalog()
                {
                    CatalogID = 7
                }
            };


            repository.Create(info);
            uow.Save();
            var factListCount = context.infos.Count();


            Assert.Equal(expectedListCount, factListCount);
        }
Ejemplo n.º 12
0
        public void Delete_InputExistinfoId_Removed()
        {
            int          expectedListCount = 0;
            var          context           = SqlLiteInMemoryContext();
            EFUnitOfWork uow = new EFUnitOfWork(context);

            Catalog.DAL.Repositories.Interfaces.infoRepository repository = uow.infos;
            info info = new info()
            {
                CatalogID   = 7,
                Name        = "testN",
                Description = "testD",
                Catalog     = new Catalog.DAL.Entities.Catalog()
                {
                    CatalogID = 7
                }
            };

            context.infos.Add(info);
            context.SaveChanges();


            repository.Delete(info.infoID);
            uow.Save();
            var factinfoCount = context.infos.Count();


            Assert.Equal(expectedListCount, factinfoCount);
        }
Ejemplo n.º 13
0
        public IHttpActionResult Postinfo(info info)
        {
            if (!ModelState.IsValid)
            {
                return(BadRequest(ModelState));
            }

            db.infoes.Add(info);

            try
            {
                db.SaveChanges();
            }
            catch (DbUpdateException)
            {
                if (infoExists(info.User_Name))
                {
                    return(Conflict());
                }
                else
                {
                    throw;
                }
            }

            return(CreatedAtRoute("DefaultApi", new { id = info.User_Name }, info));
        }
Ejemplo n.º 14
0
        }//获取好友列表

        public static info PersonalInformation(string id)
        {
            info   an = new info();
            string da = " SELECT name,sex from [info] where ZH=@id";

            q.OpenConnect();
            SqlCommand   com = new SqlCommand();
            SqlParameter sp  = new SqlParameter("@id", id);

            com.Connection  = q.Connect;
            com.CommandText = da;
            com.Parameters.Add(sp);
            SqlDataReader jj = com.ExecuteReader();

            while (jj.Read())
            {
                an.zh   = int.Parse(id);
                an.name = jj["name"].ToString();
                if (jj["sex"].ToString().Equals("男"))
                {
                    an.sex = Sex.男;
                }
                else
                {
                    an.sex = Sex.女;
                }
            }
            jj.Close();
            q.CloseConnect();
            return(an);
        }
Ejemplo n.º 15
0
        // Fetch words and store them
        public IEnumerator PlayerInfo()
        {
            //wordlist = new string[0];
            WWWForm form = new WWWForm();

            form.AddField("method", "playerinfo");
            form.AddField("userid", PlayerPrefs.GetInt("userid"));
            form.AddField("pack", PlayerPrefs.GetInt("pack"));
            form.AddField("level", PlayerPrefs.GetString("level"));
            using (var w = UnityWebRequest.Post("http://nati.games/apis/spellingflea.cfc", form))
            {
                yield return(w.SendWebRequest());

                if (w.isNetworkError || w.isHttpError)
                {
                    print(w.error);
                }
                else
                {
                    var myString = w.downloadHandler.text;
                    info      = JsonUtility.FromJson <info>(myString);
                    pack.text = info.packname;
                }
            }
        }
Ejemplo n.º 16
0
    public void Start()
    {
        textObject = gameObject;
        Debug.Log(textObject.name + " is currently being worked on");
        Text objectText = textObject.GetComponent <Text>();

        string fileName = options[selected];
        string filePath = Path.Combine(Application.streamingAssetsPath, fileName);

        if (File.Exists(filePath))
        {
            string dataAsJson = File.ReadAllText(filePath);
            //Debug.Log(dataAsJson);

            rootData root = JsonUtility.FromJson <rootData>(dataAsJson);

            bool idFound = false;
            for (int i = 0; i < root.information.Count; i++)
            {
                info inf = root.information[i];
                if (inf.id == id)
                {
                    Debug.Log("Text found. Loading . . .");
                    objectText.text = inf.text;
                    idFound         = true;
                    break; //found the ID, break the loop now
                }
            }

            if (!idFound)
            {
                Debug.Log("Could not find the provided ID in the JSON file.");
            }
        }
    }
Ejemplo n.º 17
0
        private void pictureBox3_Click(object sender, EventArgs e)
        {
            info aa = new info();

            aa.Show();
            this.Hide();
        }
Ejemplo n.º 18
0
        private void qsort(int start, int end)
        {
            if (start >= end)
            {
                return;
            }

            int  left = start, right = end;
            info middle = arrayOfData[(left + right) / 2];

            while (left <= right)
            {
                while (middle.compareInfoPrizv(arrayOfData[left]) > 0)
                {
                    ++left;
                }
                while (middle.compareInfoPrizv(arrayOfData[right]) < 0)
                {
                    --right;
                }

                if (left <= right)
                {
                    swap(ref arrayOfData[left++], ref arrayOfData[right--]);
                }
            }

            qsort(start, right);
            qsort(left, end);
        }
Ejemplo n.º 19
0
        public void Get_InputExistinfoId_Returninfo()
        {
            var          context = SqlLiteInMemoryContext();
            EFUnitOfWork uow     = new EFUnitOfWork(context);

            Catalog.DAL.Repositories.Interfaces.infoRepository repository = uow.infos;
            info expectedinfo = new info()
            {
                CatalogID   = 7,
                Name        = "testN",
                Description = "testD",
                Catalog     = new Catalog.DAL.Entities.Catalog()
                {
                    CatalogID = 7
                }
            };

            context.infos.Add(expectedinfo);
            context.SaveChanges();


            var factinfo = repository.Get(expectedinfo.infoID);


            Assert.Equal(expectedinfo, factinfo);
        }
Ejemplo n.º 20
0
        public IActionResult Delete(int?id, info information)
        {
            if (id == null || id < 1)
            {
                return(BadRequest("Invalid member Id"));
            }

            //var dbInfo = _ctx.Info.Find(information.ID);
            //if (dbInfo == null)
            //return NotFound();

            var member = _ctx.Info.Find(id);

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

            _ctx.Info.Remove(member);
            var changes = _ctx.SaveChanges();

            if (changes > 0)
            {
                return(NoContent());
            }

            return(StatusCode(500, "Please try again later"));
        }
        public async Task <IActionResult> graph(string id, string value)
        {
            /*
             * my Api key is INXNTP95U5EGWDQV
             */
            var  ID     = id;
            var  Value  = value;
            var  apiKey = "INXNTP95U5EGWDQV";
            info info;
            var  data = "";
            var  page = "https://www.alphavantage.co/query?function=TIME_SERIES_MONTHLY&symbol=MSFT&apikey=" + apiKey;

            using (var client = new HttpClient())
                using (var response = await client.GetAsync(page))

                    using (var content = response.Content)
                    {
                        data = await content.ReadAsStringAsync();

                        if (data != null)
                        {
                            info = new info
                            {
                                shareInfo = data
                            };
                            ViewData["data"] = info;
                        }
                    }
            return(View());
        }
Ejemplo n.º 22
0
        public List <info> readInfo()
        {
            cmd.Connection = cn;
            List <info> s = new List <info>();
            info        d;

            try
            {
                cn.Open();
                cmd.CommandText = "select * from takes";
                dr = cmd.ExecuteReader();
                while (dr.Read())
                {
                    d             = new info();
                    d.book_ID     = Convert.ToInt32(dr[0]);
                    d.ID          = Convert.ToInt32(dr[1]);
                    d.date_taken  = dr[2].ToString();
                    d.return_date = dr[3].ToString();
                    s.Add(d);
                }
                cn.Close();
                return(s);
            }
            catch (Exception el)
            {
                cn.Close();
                MessageBox.Show(el.Message);
                return(null);
            }
        }
Ejemplo n.º 23
0
        public IHttpActionResult Putinfo(int id, info info)
        {
            if (!ModelState.IsValid)
            {
                return(BadRequest(ModelState));
            }

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

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

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

            return(StatusCode(HttpStatusCode.NoContent));
        }
Ejemplo n.º 24
0
        private void SendMail(object sender, RoutedEventArgs e)
        {
            if (To.Text != "" && Subject.Text != "")
            {
                try
                {
                    string body = "<body style='" +
                                  "font-family:" + FontList.SelectedItem.ToString() + ";" +
                                  "font-size:" + FontSize.SelectedItem + "';" +
                                  "color:" + ClrPicker_Font.SelectedColorText + ";>"
                                  + SendBody.Text +
                                  "</body>";
                    new SendMail().Send(Window, UserData, Config, To.Text, Subject.Text, body);

                    info inf = new info("Message Has Been Sent to: " + To.Text);
                    inf.ShowDialog();
                    Subject.Text  = "";
                    To.Text       = "";
                    SendBody.Text = "";
                    Window.MainFrame.NavigationService.GoBack();
                }
                catch (Exception exce)
                {
                    info inf = new info("Message Could not be Sent \n\r");
                    inf.ShowDialog();
                }
            }
            else
            {
                info inf = new info("Fields Cannot be empty");
                inf.ShowDialog();
            }
        }
        public void addinfo(info _info)
        {
            _info.Id = ObjectId.GenerateNewId();

            _infos.Insert(_info);
            //return item;
        }
Ejemplo n.º 26
0
        public info GetLatestWeather()
        {
            info item = new info();
            using (var cn = new SqlConnection(@"Data Source=(LocalDB)\v11.0;AttachDbFilename" +
             "=|DataDirectory|\\Database.mdf; Integrated Security=True"))
            {
                string _sql = @"SELECT * FROM [dbo].[Weather]";
                var cmd = new SqlCommand(_sql, cn);
                cn.Open();
                var reader = cmd.ExecuteReader();

                if (reader.HasRows)
                {
                    try
                    {
                        while (reader.Read())
                        {
                            item.LastRefresh = Convert.ToDateTime(reader["LastRefresh"].ToString());
                            item.temp_f = Convert.ToDecimal(reader["Temperature"].ToString());
                            item.windchill_f = reader["Class"].ToString();
                            item.wind_mph = Convert.ToDecimal(reader["WindSpeed"].ToString());
                            item.icon_url = reader["Icon"].ToString();
                        }
                    }
                    catch (Exception e) {}
                }
                reader.Dispose();
                cmd.Dispose();
            }
            return item;
        }
Ejemplo n.º 27
0
 public run_metrics(info run_info) : this(c_csharp_run_metricsPINVOKE.new_run_metrics__SWIG_2(info.getCPtr(run_info)), true)
 {
     if (c_csharp_run_metricsPINVOKE.SWIGPendingException.Pending)
     {
         throw c_csharp_run_metricsPINVOKE.SWIGPendingException.Retrieve();
     }
 }
Ejemplo n.º 28
0
        OperationResult IRepository.Delete(info info, string s)
        {
            OperationResult opResult = new OperationResult();

            if (info != null && string.IsNullOrEmpty(info.full_name))
            {
                return(null);
            }

            info existInfo = DBContext.Informations.FirstOrDefault(c => c.full_name == info.full_name);

            if (existInfo == null)
            {
                return(null);
            }

            try
            {
                DBContext.Informations.Remove(existInfo);
                DBContext.SaveChanges();
            }
            catch (Exception ex)
            {
                opResult.SetException(ex);
            }

            return(opResult);
        }
Ejemplo n.º 29
0
 public void tcpReceive()
 {
     using (var binaryWriter = new BinaryWriter(client.ns, Encoding.UTF8))
         using (var binaryReader = new BinaryReader(client.ns, Encoding.UTF8))
         {
             int action = binaryReader.ReadInt32();
             if (action == 0) //ping
             {
                 binaryWriter.Write(1);
             }
             else if (action == 1) //serverToClientSync
             {
                 long            length    = binaryReader.ReadInt64();
                 BinaryFormatter formatter = new BinaryFormatter();
                 infoObj = (info)formatter.Deserialize(client.ns);
             }
             else if (action == 2)
             {
                 BinaryFormatter formatter = new BinaryFormatter(); //convert info obj to binary stream
                 MemoryStream    ms        = new MemoryStream();    //holding stream
                 formatter.Serialize(ms, infoObj);                  //serialize infoObj
                 binaryWriter.Write(ms.Length);                     //just because send length
                 ms.CopyTo(client.ns);                              //send it!
             }
         }
 }
Ejemplo n.º 30
0
 private void submit_btn_Click(object sender, EventArgs e)
 {
     if ("" != buyer_name_txt.Text && "" != buyer_ident_code_txt.Text && "" != buyer_address_txt.Text)
     {
         if (ActionType.Add == this.job)
         {
             Buyer newBuyer    = new Buyer(buyer_ident_code_txt.Text, buyer_name_txt.Text, buyer_address_txt.Text);
             info  retAddBuyer = ProductInfo_Main_Form.conn.AddBuyer(newBuyer);
             MessageBox.Show(retAddBuyer.details, retAddBuyer.errcode.ToString());
             if (0 == retAddBuyer.errcode)
             {
                 this.Close();
             }
         }
         else if (ActionType.Edit == this.job)
         {
             Buyer newBuyer     = new Buyer(buyer_ident_code_txt.Text, buyer_name_txt.Text, buyer_address_txt.Text);
             info  retEditBuyer = ProductInfo_Main_Form.conn.EditBuyer(newBuyer);
             MessageBox.Show(retEditBuyer.details, retEditBuyer.errcode.ToString());
             if (0 == retEditBuyer.errcode)
             {
                 this.Close();
             }
         }
     }
     else
     {
         MessageBox.Show("გთხოვთ შეავსოთ ყველა ველი!");
     }
 }
Ejemplo n.º 31
0
        private void swap(ref info a, ref info b)
        {
            info c = a;

            a = b;
            b = c;
        }
Ejemplo n.º 32
0
        public async Task <IActionResult> Edit(int id, [Bind("Id,Ip,Name,Age")] info info)
        {
            if (id != info.Id)
            {
                return(NotFound());
            }

            if (ModelState.IsValid)
            {
                try
                {
                    _context.Update(info);
                    await _context.SaveChangesAsync();
                }
                catch (DbUpdateConcurrencyException)
                {
                    if (!infoExists(info.Id))
                    {
                        return(NotFound());
                    }
                    else
                    {
                        throw;
                    }
                }
                return(RedirectToAction(nameof(Index)));
            }
            return(View(info));
        }
Ejemplo n.º 33
0
 public virtual void add(info.aduna.iteration.Iteration i, params org.openrdf.model.Resource[] rarr)
 {
     IEnumerable<Uri> contexts = rarr.ToContexts(this._mapping);
     Graph g = new Graph();
     g.Assert(i.ToTriples(this._mapping));
     this.AddInternal(g, contexts);
 }
Ejemplo n.º 34
0
        /// <summary>
        /// 登陆U8系统确认身份,并得到登录字符串
        /// </summary>
        /// <param name="userID">用户名</param>
        /// <param name="password">密码</param>
        /// <param name="accID">帐套名</param>
        /// <param name="year">财务年度</param>
        /// <param name="inf">struct类型</param>
        /// <param name="customerName">登录者名字</param>
        /// <param name="connectionString">生成的数据库连接字符串</param>
        /// <param name="errMsg">错误信息</param>
        /// <returns>0:正确,非0,错误</returns>
        static public int Login(string userID, string password, string accID, string year, info inf,
            out string customerName, out string connectionString, out string errMsg)
        {

            customerName = "";
            connectionString = "";
            errMsg = "";
            string ERPService = "";     //ERP服务器地址
            string DBService = "";
            string sqlUser = "";
            string sqlPassword = "";

            try
            {
                sqlUser = inf.sqlUser;
                sqlPassword = inf.sqlPassword;
                ERPService = inf.ERPService; //string.Format("UFDATA_{0}_{1}",accID,year);//inf.ERPService;
                DBService = inf.DBService;

                connectionString = "user id=" + sqlUser + ";password="******";data source='" + DBService
                        + "';persist security info=True;initial catalog=UFDATA_" + accID + "_" + year
                        + ";Connection Timeout=30";
            }
            catch (Exception ex)
            {
                errMsg = "配置文件错误!" + ex.Message;
                return -1;
            }
            UFSoft.U8.Framework.Login.UI.clsLogin netLogin = new UFSoft.U8.Framework.Login.UI.clsLogin();
            try
            {
                string SQL = "select top 1 cUser_Name from ufsystem..ua_user where cUser_id=N'" + userID + "' and cPassword='******'";
                DataSet Ds_User = new DataSet();
                int i = OperationSql.GetDataset(SQL, connectionString, out Ds_User, out errMsg);
                if (i != 0)
                {
                    return -2;
                }
                else
                {
                    if (Ds_User.Tables[0].Rows.Count == 0)
                    {
                        errMsg = "用户名或者密码错误";
                        return -2;
                    }
                    else
                    {
                        customerName = Ds_User.Tables[0].Rows[0][0].ToString();
                        return 0;
                    }
                }
            }
            catch (Exception ex)
            {
                errMsg = ex.Message;
                return -2;
            }
        }
Ejemplo n.º 35
0
 public void UpdateRefresh(info s)
 {
     using (var cn = new SqlConnection(@"Data Source=(LocalDB)\v11.0;AttachDbFilename" +
      "=|DataDirectory|\\Database.mdf; Integrated Security=True"))
     {
         string _insertSql = @"UPDATE [dbo].[Weather]
                             SET LastRefresh = @LastRefresh, Temperature = @Temperature, WindChill = @WindChill, Icon = @Icon, WindSpeed = @WindSpeed WHERE Id = 1";
         var insertCmd = new SqlCommand(_insertSql, cn);
         insertCmd.Parameters
             .Add(new SqlParameter("@LastRefresh", SqlDbType.DateTime))
             .Value = s.windchill_f;
         insertCmd.Parameters
             .Add(new SqlParameter("@Temperature", SqlDbType.NVarChar))
             .Value = s.LastRefresh;
         insertCmd.Parameters
             .Add(new SqlParameter("@WindChill", SqlDbType.NVarChar))
             .Value = s.icon_url;
         insertCmd.Parameters
             .Add(new SqlParameter("@Icon", SqlDbType.NVarChar))
             .Value = s.temp_f;
         insertCmd.Parameters
             .Add(new SqlParameter("@WindSpeed", SqlDbType.NVarChar))
             .Value = s.wind_mph;
         cn.Open();
         insertCmd.ExecuteNonQuery();
         cn.Close();
     }
 }
Ejemplo n.º 36
0
        private void FillValues()
        {
            foreach (Transform child in AttrContent)
                DestroyObject(child.gameObject);
            if (Char != null)
            {
                cost = 0;
                days = 1;
                sp = Char.SkillPoint;

                Moneys.Value = cost;
                SPText.text = string.Format("SP: {0}", sp);
                DaysText.text = string.Format("{0} д.", days);

                infos.Clear();

                foreach (var pair in Char.Attributes)
                {
                    var info = new info();

                    info.attr = pair.Key;
                    info.current = pair.Value;
                    info.max = (int)Char.Level + 5;
                    info.trained = 0;
                    info.control = Instantiate(AttributePrefabs[(int)pair.Key.Type]).GetComponent<AttributeDisplay>();
                    info.control.Values.Clear();
                    info.control.Values.Add(info.current);
                    info.control.Values.Add(info.trained);
                    info.control.Values.Add(info.max - (info.current + info.trained));
                    info.control.Digit.text = info.NextSP().ToString();
                    info.control.Icon.sprite = pair.Key.Icon;
                    info.control.transform.SetParent(AttrContent, false);
                    info.control.Build();
                    var button = info.control.transform.FindChild("Button").GetComponent<TrainButton>();
                    button.Value = infos.Count;
                    button.Panel = this;

                    infos.Add(info);
                }
            }
        }
Ejemplo n.º 37
0
static List<info> DecodeStudio90(object obj)
{
  Type t=obj.GetType();
  List<info> infos=new List<info>();
  IDictionary dic=t.InvokeMember("stringTable",BindingFlags.Public|BindingFlags.NonPublic|BindingFlags.Instance|BindingFlags.GetField,null,obj,null) as IDictionary;
  if(dic!=null)
  {
    foreach(object k in dic.Keys)
    {
      string[] arr=k.ToString().Split('@');
      if(arr.Length==5)
      {
        string server=arr[1];
        string type=arr[2];
        string user=arr[3];
        string field=arr[4];
        info inf=null;
        foreach(info i in infos)
        {
          if(i.server==server && i.user==user &&i.type==type)
          {
            inf=i;
            break;
          }
        }
        if(inf==null)
        {
          inf=new info();
          inf.server=server;
          inf.user=user;
          inf.type=type;
          infos.Add(inf);
        }
        if(field=="Password")
        {
          IEnumerable data=dic[k] as IEnumerable;
          if(data!=null)
          {
            IEnumerator ie=data.GetEnumerator();
            ie.MoveNext();
            inf.pass=decodepassword(ie.Current.ToString());
          }
        }
      }
    }
  }
  return infos;
}
Ejemplo n.º 38
0
static List<info> DecodeStudioHigh(object o)
{
List<info> infos=new List<info>();
Type t=o.GetType().BaseType;
o=GetObjectPrivateDicvalue(t,o,"SSMS");
o=GetObjectPrivateDicvalue(t,o,"ConnectionOptions");
o=GetObjectPrivateDicvalue(t,o,"ServerTypes");
IDictionary dic=o as IDictionary;
foreach(object k in dic.Keys)
{
  o=dic[k];
  IEnumerable data=GetObjectPrivateDicvalue(t,o,"Servers") as IEnumerable;//dic2[kk] as IEnumerable;
  if(data!=null)
  {
    IEnumerator ie=data.GetEnumerator();
    while(ie.MoveNext())
    {
      IEnumerable data2=GetObjectPrivateDicvalue(t,ie.Current,"Connections") as IEnumerable;
      if(data2!=null)
      {
        IEnumerator ie2=data2.GetEnumerator();
        while(ie2.MoveNext())
        {
          info inf=new info();
          inf.server=GetObjectPrivateDicvalue(t,ie.Current,"Instance") as string;
          inf.type=Convert.ToInt32(GetObjectPrivateDicvalue(t,ie.Current,"AuthenticationMethod")).ToString();
          inf.pass=decodepassword(GetObjectPrivateDicvalue(t,ie2.Current,"Password") as string);
          inf.user=GetObjectPrivateDicvalue(t,ie2.Current,"UserName") as string;
          infos.Add(inf);
        }
      }
    }
  }
}
return infos;
}
        public override void remove(info.aduna.iteration.Iteration i, params org.openrdf.model.Resource[] rarr)
        {
            if (this._manager.IsReadOnly) throw NotWritableError("remove");

            base.remove(i, rarr);
        }
Ejemplo n.º 40
0
			writeLog(info, file, method, line, "Entering ");
 private void toolStripButton4_Click(object sender, EventArgs e)
 {
     info info = new info();
     info.ShowDialog();
 }