Exemplo n.º 1
0
    // Update is called once per frame
    void Update()
    {
        if (isClick)
        {
            switch (MsgCenter.insertType)
            {
            case "1":
                if (D_FengGe.value == 0 || D_SceneStyle.value == 0)
                {
                    break;
                }
                xmlStr = InsertData.AddScene(I_Name.text, I_Code.text, I_Sequ.text, MsgCenter.corpID, MsgCenter.FengGe[D_FengGe.captionText.text], MsgCenter.SceneStyle[D_SceneStyle.captionText.text], T_Picture.text, T_Spicture.text, T_Audio.text);
                break;

            case "2":
                if (MsgCenter.nowHouse == null || MsgCenter.nowScenePoint == null)
                {
                    break;
                }
                xmlStr = InsertData.AddRoom(I_Name.text, I_Code.text, MsgCenter.nowHouse.ID.ToString(), MsgCenter.corpID, MsgCenter.nowScenePoint.x.ToString(), MsgCenter.nowScenePoint.y.ToString(), T_Picture.text, T_Spicture.text);
                break;

            case "3":
                if (D_FengGe.value == 0 || D_SceneStyle.value == 0 || MsgCenter.nowScene == null || MsgCenter.nowHouse == null || MsgCenter.StyleTarget == TargetStyle.chuanghu || MsgCenter.StyleTarget == TargetStyle.Null)
                {
                    break;
                }
                xmlStr = InsertData.AddPanorama(I_Name.text, I_Code.text, I_Sequ.text, I_Group.text, MsgCenter.FengGe[D_FengGe.captionText.text], EnumToolV2.GetDescription(MsgCenter.StyleTarget), MsgCenter.nowHouse.ID.ToString(), MsgCenter.nowScene.ID.ToString(), MsgCenter.corpID, T_Picture.text, T_Spicture.text, T_Bpicture.text);
                break;

            case "4":

                break;

            case "5":

                break;

            case "6":

                break;

            case "7":

                break;

            default:
                break;
            }
            if (xmlStr == "" || xmlStr == null)
            {
                this.gameObject.SetActive(false);
            }
            else
            {
                StartCoroutine(WaitXML());
            }
            isClick = false;
        }
    }
Exemplo n.º 2
0
 private void SaveDetail1()
 {
     try
     {
         foreach (var row in dgv_DanhSach.Rows)
         {
             var hs = new DiemThi
             {
                 MaSV     = int.Parse(row.Cells["MaSV"].Text),
                 Diem     = double.Parse(row.Cells["DiemThi"].Text),
                 IdNamHoc = _idnamhoc,
                 HocKy    = _hocky
             };
             _listThongke.Add(hs);
         }
         if (_listThongke.Count > 0 || _listUpdate.Count > 0)
         {
             UpdateData.UpdateDiemThi(_listUpdate);
             InsertData.ThemThongKe(_listThongke);
             MessageBox.Show(@"Lưu lại thành công");
         }
     }
     catch (Exception ex)
     {
         Log2File.LogExceptionToFile(ex);
     }
 }
        private void btnUploadToDatabase_Click(object sender, EventArgs e)
        {
            try
            {
                InsertData insertdata = new InsertData();
                string     errorInfo  = insertdata.InsertDataIntoSQLServerUsingSQLBulkCopy(csv, TableName);
                if (errorInfo == "")
                {
                    MessageBox.Show("上传到数据库成功", "系统消息", MessageBoxButtons.OK, MessageBoxIcon.Information);
                }
                else
                {
                    MessageBox.Show($"上传到数据库失败,{errorInfo}", "系统消息", MessageBoxButtons.OK, MessageBoxIcon.Information);
                }
            }
            catch (Exception ex)
            {
                MessageBox.Show("上传到数据库失败,原因:" + ex.Message, "系统消息", MessageBoxButtons.OK, MessageBoxIcon.Information);
                return;
            }
            frmMain frmmain = (frmMain)this.Owner;
            string  sql     = "select LIST,MACADDRESS,DESCRIPTION,VALIDFROM,VALIDTHRU from DhcpFilterStatus where STATUS !='deleting'";

            frmmain.dt = SqlHelpers.ExecuteDataTable(CommandType.Text, sql);
            frmmain.dgvData.DataSource = frmmain.dt;
            dgvFileData.DataSource     = null;
        }
Exemplo n.º 4
0
        /// <summary>
        /// Lưu dữ liệu trên UltraGrid
        /// </summary>
        protected override void SaveDetail()
        {
            try
            {
                foreach (var row in dgv_DanhSach.Rows)
                {
                    var hs = new BaiLam
                    {
                        MaSV      = int.Parse(row.Cells["MaSV"].Text),
                        MaDe      = row.Cells["MaDe"].Text,
                        KetQua    = row.Cells["KetQua"].Text,
                        IdKyThi   = _idKythi,
                        MaHoiDong = row.Cells["MaHoiDong"].Text,
                        MaLoCham  = row.Cells["MaLoCham"].Text,
                        TenFile   = row.Cells["TenFile"].Text,
                    };
                    _listAdd.Add(hs);
                }

                InsertData.ThemBaiLam(_listAdd);
                Invoke((Action)(() => MessageBox.Show(@"Đã lưu vào CSDL", FormResource.MsgCaption, MessageBoxButtons.OK,
                                                      MessageBoxIcon.Information)));
            }
            catch (Exception ex)
            {
                Log2File.LogExceptionToFile(ex);
            }
        }
 static void Main(string[] args)
 {
     // ...
     _vm = InsertData.Insert();
     GetData.Read(_vm);
     // ...
 }
Exemplo n.º 6
0
 protected override void SaveDetail()
 {
     try
     {
         foreach (var row in dgv_DanhSach.Rows)
         {
             var hs = new DiemThi
             {
                 MaSV     = int.Parse(row.Cells["MaSV"].Text),
                 Diem     = double.Parse(row.Cells["TongDiem"].Text),
                 IdNamHoc = _idnamhoc,
                 HocKy    = _hocky
             };
             _listThongke.Add(hs);
         }
         if (_listThongke.Count > 0)
         {
             InsertData.ThemThongKe(_listThongke);
             MessageBox.Show(@"Thêm thành công");
         }
     }
     catch (Exception ex)
     {
         Log2File.LogExceptionToFile(ex);
     }
 }
 public RecyclerViewOnScrollListtener(SwipeRefreshLayout swipeRefreshLayout, LinearLayoutManager linearLayoutManager, RecyclerView.Adapter recyclerViewAdapter, InsertData InsertDataEvent)
 {
     _swipeRefreshLayout  = swipeRefreshLayout;
     _linearLayoutManager = linearLayoutManager;
     _adapter             = recyclerViewAdapter;
     _InsertDataEvent     = InsertDataEvent;
 }
Exemplo n.º 8
0
        static void Main(string[] args)
        {
            var exampleToRun = ExamplesEnumeration.GetChacters;

            switch (exampleToRun)
            {
            case ExamplesEnumeration.GetChacters:
                GetData.GetCharacters();
                break;

            case ExamplesEnumeration.GetCharactersWithLinq:
                GetData.GetCharactersWithLinq();
                break;

            case ExamplesEnumeration.UpdateCharacter:
                UpdateData.UpdateCharacter();
                break;

            case ExamplesEnumeration.InsertCharacter:
                InsertData.InsertCharacter();
                break;
            }

            Console.Read();
        }
Exemplo n.º 9
0
 // Use this for initialization
 void Start()
 {
     // set all other buttons to false so the player is forced to input their name and age before they can start the game
     id         = GameObject.FindWithTag("BackAudio");
     data       = id.GetComponent <Data>();
     insertdata = id.GetComponent <InsertData>();
 }
Exemplo n.º 10
0
 private void button1_Click(object sender, EventArgs e)
 {
     if (string.IsNullOrEmpty(txtProductName.Text))
     {
         MessageBox.Show("请输入商品名称");
     }
     if (string.IsNullOrEmpty(txtInPrice.Text))
     {
         MessageBox.Show("请输入进货价格");
     }
     if (string.IsNullOrEmpty(txtProductCode.Text))
     {
         MessageBox.Show("请输入商品编号");
     }
     //插入
     if (_opearType == "添加")
     {
         var sql = InsertSQL.InsertProduct(txtProductName.Text, txtInPrice.Text, txtOutPrice.Text,
                                           txtProductCode.Text, txtProductNum.Text, txtRemark.Text, _clientId, _pictureId);
         MessageBox.Show(InsertData.InsertIntoData(sql) ? "添加商品成功" : "添加商品失败");
     }
     //更新
     if (_opearType == "修改")
     {
         var updatesql = UpdateSQL.UpdateProduct(txtProductName.Text, txtInPrice.Text, txtOutPrice.Text,
                                                 txtProductCode.Text, txtProductNum.Text, txtRemark.Text, _clientId, _pictureId, _productId);
         MessageBox.Show(UpdateData.UpdateInfo(updatesql) ? "更新商品成功" : "更新商品失败");
     }
     Close();
 }
Exemplo n.º 11
0
        /// <summary>
        /// Lưu dữ liệu trên UltraGrid
        /// </summary>
        protected override void SaveDetail()
        {
            try
            {
                foreach (var row in dgv_DanhSach.Rows)
                {
                    var hs = new DapAn
                    {
                        IdKyThi   = _idKythi,
                        MaMon     = row.Cells["MaMon"].Text,
                        MaDe      = row.Cells["MaDe"].Text,
                        CauHoi    = int.Parse(row.Cells["CauHoi"].Text),
                        Dapan     = row.Cells["Dapan"].Text,
                        ThangDiem = 0
                    };

                    _listAdd.Add(hs);
                }
                if (_listAdd.Count <= 0)
                {
                    return;
                }
                InsertData.ThemDapAn(_listAdd);
                MessageBox.Show(@"Đã lưu vào CSDL", FormResource.MsgCaption, MessageBoxButtons.OK,
                                MessageBoxIcon.Information);
            }
            catch (Exception ex)
            {
                MessageBox.Show(ex.Message.Contains(FormResource.msgLostConnect) ? FormResource.txtLoiDB : ex.Message);
                Log2File.LogExceptionToFile(ex);
            }
        }
Exemplo n.º 12
0
        public ServiceResult InsertCallDetailsAsyc([System.Xml.Serialization.XmlElementAttribute(IsNullable = true)] InsertData data)
        {
            object[] results = this.Invoke("InsertCallDetailsAsyc", new object[] {
                data
            });

            return((ServiceResult)(results[0]));
        }
Exemplo n.º 13
0
        public static void DeleteOrder(string tgl, string nik, string nama)
        {
            string[] tanggalsplit = tgl.Split('/');
            string[] tanggalthn   = tanggalsplit[2].Split(' ');
            string   tanggalfix   = tanggalthn[0] + '-' + tanggalsplit[1] + '-' + tanggalsplit[0];

            InsertData.DelOrder(tanggalfix, nik, nama);
        }
Exemplo n.º 14
0
 public BaseRecyclerViewAdapter(Context context, List <T> list, int itemLayoutId, InsertData _InsertDataEvent)
 {
     this.context          = context;
     this.list             = list;
     this.itemLayoutId     = itemLayoutId;
     this._InsertDataEvent = _InsertDataEvent;
     inflater = LayoutInflater.From(context);
 }
Exemplo n.º 15
0
 /// <remarks/>
 public void InsertCallDetailsAsycAsync(InsertData data, object userState)
 {
     if ((this.InsertCallDetailsAsycOperationCompleted == null))
     {
         this.InsertCallDetailsAsycOperationCompleted = new System.Threading.SendOrPostCallback(this.OnInsertCallDetailsAsycOperationCompleted);
     }
     this.InvokeAsync("InsertCallDetailsAsyc", new object[] {
         data
     }, this.InsertCallDetailsAsycOperationCompleted, userState);
 }
 public JsonResult InsertRecord(EmployeeRecordModel newRecord)
 {
     if (InsertData.InsertRecord(newRecord))
     {
         return(Json(new { success = true }, JsonRequestBehavior.DenyGet));
     }
     else
     {
         return(Json(new { success = false }, JsonRequestBehavior.DenyGet));
     }
 }
Exemplo n.º 17
0
 public ActionResult InsertEmployee(EmployeeModel newEmployee)
 {
     if (InsertData.InsertEmployee(newEmployee))
     {
         return(Json(new { success = true }, JsonRequestBehavior.DenyGet));
     }
     else
     {
         return(Json(new { success = false }, JsonRequestBehavior.DenyGet));
     }
 }
Exemplo n.º 18
0
        public static string data(string str1, string str2, string str3)
        {
            string cardUID   = str1;
            string CardValue = str2;
            string modifier  = str3;

            string status;

            status = InsertData.insert(cardUID, CardValue, modifier);

            return(status);
        }
Exemplo n.º 19
0
        //insert data user ke database
        public static void inserttoDB(string nik, string nama, string[][] array)
        {
            int n = array.Length;
            int i;

            string[] token = new string[n];
            for (i = 0; i < n; i++)
            {
                token[i] = Code.CreateCode((i + 1), 6);
            }
            InsertData.insertDB(nik, nama, token, array);
        }
        public ActionResult Index(InsertData inD)
        {
            HttpClient hc = new HttpClient();

            hc.BaseAddress = new Uri("https://localhost:44360/api/InsertData");

            var insertRec = hc.PostAsJsonAsync <InsertData>("InsertData", inD);

            insertRec.Wait();
            ViewBag.message = "Values insert successfully";

            return(View());
        }
Exemplo n.º 21
0
        //insert data user ke database
        public static void inserttoDB(string nik, string nama, string[][] array, string modifier)
        {
            int n = array.Length;
            int i;

            string[] token = new string[n];
            Random   rnd   = new Random();

            for (i = 0; i < n; i++)
            {
                token[i] = Code.CreateCode((i + 1), 4) + rnd.Next(10, 99);
            }
            InsertData.insertDB(nik, nama, token, array, modifier);
        }
Exemplo n.º 22
0
 private void btnluu_Click_1(object sender, EventArgs e)
 {
     try
     {
         if (!Checkghi())
         {
             return;
         }
         if (!CheckUpdate)
         {
             var hs = new SinhVien
             {
                 MaSV     = int.Parse(txtmasinhvien.Text),
                 HoSV     = txthotendem.Text,
                 TenSV    = txttensinhvien.Text,
                 NgaySinh = cbongaysinh.Text,
                 IdLop    = _idlop,
             };
             InsertData.ThemSinhVien(hs);
             Themmoisinhvien(sender, hs, cbolop.Text, cbokhoa.Text);
             MessageBox.Show(@"Đã Thêm mới một sinh viên");
         }
         else
         {
             var hs1 = new SinhVien
             {
                 MaSV     = int.Parse(txtmasinhvien.Text),
                 HoSV     = txthotendem.Text,
                 TenSV    = txttensinhvien.Text,
                 NgaySinh = cbongaysinh.Text,
                 IdLop    = _idlop
             };
             if (UpdateData.UpdateSv(hs1))
             {
                 MessageBox.Show(@"Chỉnh sửa thành công", @"Thông báo");
                 CheckUpdate = false;
             }
             else
             {
                 MessageBox.Show(@"Sai thông tin lớp", @"Thông báo");
             }
             Close();
         }
     }
     catch (Exception ex)
     {
         Log2File.LogExceptionToFile(ex);
     }
 }
Exemplo n.º 23
0
        private void button2_Click(object sender, EventArgs e)
        {
            var amount  = numAmount.Value;
            var shenase = txtُShenase.Text;
            var receipt = txtReceipt.Text;
            var bank    = comboBox1.Text;



            //string cmd = string.Format("INSERT INTO Receipt(Shenase,Amount,ReceiptDate)VALUES('{0}','{1}','{2}')", shenase, amount, receipt);
            string cmd    = Helper.PardakhtCommand(1, shenase, amount.ToString(), bank, receipt);
            string result = InsertData.Payment(cmd);

            MessageBox.Show(result);
        }
Exemplo n.º 24
0
        private static FlatData FlattenInsertsData(InsertData data)
        {
            var inner = data.Inserts.Select(x => FlattenInsertsData(x)).ToList();

            return(new FlatData()
            {
                Debug_Name = data.Insert.Block.Name,
                Attributes = Combine(data, inner, x => x.Attributes, x => x.Attributes, skipScale: true, skipPos: true),
                AttributeDefinitions = Combine(data, inner, x => x.AttributeDefinitions, x => x.AttributeDefinitions),
                Texts = Combine(data, inner, x => x.Texts, x => x.Texts),
                MTexts = Combine(data, inner, x => x.MTexts, x => x.MTexts),
                Lines = Combine(data, inner, x => x.Lines, x => x.Lines),
                Circles = Combine(data, inner, x => x.Circles, x => x.Circles),
            });
        }
Exemplo n.º 25
0
        protected override void SaveDetail()
        {
            try
            {
                if (ValidateData())
                {
                    MessageBox.Show(@"Vui lòng nhập đầy đủ thông tin", @"Lỗi");
                }
                else
                {
                    foreach (var row in dgv_DanhSach.Rows.Where(row => string.IsNullOrEmpty(row.Cells["ID"].Text)))
                    {
                        var hs = new Taikhoan
                        {
                            TaiKhoan = row.Cells["TaiKhoan"].Value.ToString(),
                            HoTen    = row.Cells["HoTen"].Value.ToString(),
                            Quyen    = row.Cells["Quyen"].Value.ToString(),
                            MatKhau  = MaHoaMd5.Md5(row.Cells["MatKhau"].Value.ToString())
                        };
                        _listAdd.Add(hs);
                    }
                    if (_listAdd.Count <= 0 && _listUpdate.Count <= 0 && _listUpdatepass.Count <= 0)
                    {
                        return;
                    }
                    if (_listUpdate.Count > 0)
                    {
                        UpdateData.UpdateTaiKhoan(_listUpdate);
                    }
                    if (_listUpdatepass.Count > 0)
                    {
                        UpdateData.UpdateMatKhau(_listUpdatepass);
                    }
                    if (_listAdd.Count > 0)
                    {
                        InsertData.ThemTaiKhoan(_listAdd);
                    }

                    MessageBox.Show(FormResource.MsgThongbaothanhcong, FormResource.MsgCaption, MessageBoxButtons.OK,
                                    MessageBoxIcon.Information);
                    LoadFormDetail();
                }
            }
            catch (Exception ex)
            {
                Log2File.LogExceptionToFile(ex);
            }
        }
Exemplo n.º 26
0
 // Use this for initialization
 void Start()
 {
     CurrentStageLevelInput = SceneManager.GetActiveScene().buildIndex; // get the current scene index
     // getcomponent
     need         = GetComponent <Needed>();
     toolbox      = GetComponent <Toolbox>();
     scourceAudio = GetComponent <AudioSource>();
     // set next question to false
     nextQuestion.interactable = false;
     // find background audio // this is used to get the data and insertdata scripts
     id         = GameObject.FindWithTag("BackAudio");
     data       = id.GetComponent <Data>();
     insertData = id.GetComponent <InsertData>();
     // set current level, set question answers and send data
     CurrentStageActive(CurrentStageLevelInput);
 }
Exemplo n.º 27
0
        public void CheckDatabaseState()
        {
            mDb = Manager.GetContext;
            if (!System.IO.File.Exists(datafile))
            {
                UpdateDb creator = new CreateDb();
                creator.DoUpdate();

                UpdateDb inserter = new InsertData();
                inserter.DoUpdate();

                mDb.Configs.First(c => c.Key == "db_version").Value = CURRENT_VERSION.ToString();
            }
            UpdateDatabase();
            mDb.SubmitChanges();
        }
Exemplo n.º 28
0
 protected override void SaveDetail()
 {
     try
     {
         if (ValidateData())
         {
             MessageBox.Show(@"Vui lòng nhập đầy đủ thông tin", @"Lỗi");
         }
         else
         {
             foreach (var row in uG_DanhSach.Rows.Where(row => string.IsNullOrEmpty(row.Cells["ID"].Text)))
             {
                 var hs = new Kythi
                 {
                     MaKT      = row.Cells["MaKT"].Text,
                     TenKT     = row.Cells["TenKT"].Text,
                     NgayThi   = row.Cells["NgayThi"].Text,
                     TGLamBai  = row.Cells["TGLamBai"].Text,
                     TGBatDau  = row.Cells["TGBatDau"].Text,
                     TGKetThuc = row.Cells["TGKetThuc"].Text,
                     GhiChu    = row.Cells["GhiChu"].Text,
                 };
                 _listAdd.Add(hs);
             }
             if (_listUpdate.Count <= 0 && _listAdd.Count <= 0)
             {
                 return;
             }
             if (_listUpdate.Count > 0)
             {
                 UpdateData.UpdateKyThi(_listUpdate);
             }
             if (_listAdd.Count > 0)
             {
                 InsertData.ThemKythi(_listAdd);
             }
             Updatekythi(null);
             MessageBox.Show(FormResource.MsgThongbaothanhcong, FormResource.MsgCaption, MessageBoxButtons.OK,
                             MessageBoxIcon.Information);
             LoadFormDetail();
         }
     }
     catch (Exception ex)
     {
         Log2File.LogExceptionToFile(ex);
     }
 }
Exemplo n.º 29
0
 // Use this for initialization
 void Start()
 {
     // data
     id         = GameObject.FindWithTag("BackAudio");
     insertdata = id.GetComponent <InsertData>();
     data       = id.GetComponent <Data>();
     // turn ingamemenu of at the start of the scene
     if (inGameMenu != null)
     {
         inGameMenu.SetActive(false);
     }
     // set grodijn active at the start of the scene
     if (gordijn != null)
     {
         gordijn.SetActive(true);
     }
 }
        public IHttpActionResult InsertRecords(InsertData insertData)
        {
            Entities db = new Entities();

            db.InsertDataResults(insertData.JumperName,
                                 insertData.JumperSurname,
                                 insertData.JumperCountry,
                                 insertData.Meters,
                                 insertData.Points,
                                 insertData.HillName,
                                 insertData.Height,
                                 insertData.City,
                                 insertData.HillCountry,
                                 0, 0, 0, 0, 0);
            db.SaveChanges();
            return(Ok());
        }