예제 #1
0
 public AjoutCmd(DataGridView dgv, DataGridView dgvlig)
 {
     InitializeComponent();
     this.cmddgv    = dgv;
     this.ligcmddgv = dgvlig;
     nbrLigCmd      = this.ligcmddgv.Rows.Count;
     if (this.cmddgv.SelectedRows.Count > 0)
     {
         RefCmdTextBoxAjoutCmd.Text = this.cmddgv.SelectedRows[0].Cells[0].Value.ToString();
         //DateAjoutCmd.Value = this.cmddgv.SelectedRows[0].Cells[0].Value;
         DAL.Client c = BALClient.findById(this.cmddgv.SelectedRows[0].Cells[3].Value.ToString());
         idclient.Text                  = c.id.ToString();
         clientInput.Text               = c.nom;
         RueTextBoxAjoutCmd.Text        = c.rue;
         VilleTextBoxAjoutCmd.Text      = c.ville;
         CodePostalTextBoxAjoutCmd.Text = c.cp.ToString();
         TelTextBoxAjoutCmd.Text        = c.tel.ToString();
         for (int i = 0; i < dgvlig.Rows.Count; i++)
         {
             LignesCmdGrid.Rows.Add(
                 this.ligcmddgv.Rows[i].Cells[0].Value,
                 this.ligcmddgv.Rows[i].Cells[1].Value,
                 this.ligcmddgv.Rows[i].Cells[2].Value,
                 this.ligcmddgv.Rows[i].Cells[3].Value
                 );
         }
     }
     else
     {
         RefCmdTextBoxAjoutCmd.Text = BAL.Global.newGGID();
     }
 }
예제 #2
0
        private void load_combobox()
        {
            DataTable dt = new DataTable();

            dt.Columns.Add("id", typeof(decimal));
            dt.Columns.Add("name", typeof(string));
            //
            string  exp = "";
            DataRow dr;

            DAL.Accessdata m = new DAL.Accessdata();
            //
            list = DAL.Manager.listClient();
            for (int i = 0; i < list.Count; i++)
            {
                DAL.Client client = list[i];
                exp = "id=" + client.ID.ToString();
                dr  = m.getrowbyid(dt, exp);
                if (dr == null)
                {
                    dr         = dt.NewRow();
                    dr["id"]   = client.ID;
                    dr["name"] = client.DatabaseName + " [" + client.Host + "]";
                    dt.Rows.Add(dr);
                }
            }
            dt.AcceptChanges();
            //
            //
            cmbMayTram.DataSource    = dt;
            cmbMayTram.DisplayMember = "name";
            cmbMayTram.ValueMember   = "id";
            //
        }
예제 #3
0
        static void Main(string[] args)
        {
            using var client = new DAL.Client("https://localhost:10042");
            var countries = client.Country.GetAllAsync().Result;

            Console.WriteLine("Hello World!");
        }
        public void AddOperation(DateTime date, Manager manager, string clientName, string productName, Session session, int price)
        {
            DAL.Client  client  = _salesContext.Clients.FirstOrDefault(x => x.Name == clientName);
            DAL.Product product = _salesContext.Products.FirstOrDefault(x => x.Name == productName);

            if (client == null)
            {
                client = new DAL.Client()
                {
                    Name = clientName
                }
            }
            ;
            if (product == null)
            {
                product = new DAL.Product()
                {
                    Name = productName
                }
            }
            ;

            DAL.Operation operation = new DAL.Operation()
            {
                DateOfOperation = date,
                Manager         = ToEntity(manager),
                Client          = client,
                Product         = product,
                Session         = ToEntity(session),
                Price           = price
            };

            _salesContext.Operations.Add(operation);
            _salesContext.SaveChanges();
        }
예제 #5
0
 private void ValiderAjoutClientbtn_Click(object sender, EventArgs e)
 {
     DAL.Client client = new DAL.Client(clientBox.Text, rueBox.Text, villeBox.Text, Int32.Parse(cpBox.Text), Int32.Parse(telBox.Text));
     BALClient.addClient(client);
     BALClient.loadClients(clients);
     this.Close();
 }
예제 #6
0
 private void load_listview()
 {
     if (listView1.Items.Count > 0)
     {
         listView1.Items.Clear();
     }
     list = DAL.Manager.listClient();
     for (int i = 0; i < list.Count; i++)
     {
         DAL.Client   client = list[i];
         ListViewItem item   = new ListViewItem(client.Host);
         item.SubItems.Add(client.Port);
         item.SubItems.Add(client.Userdb);
         item.SubItems.Add(client.Passworddb);
         item.SubItems.Add(client.DatabaseName);
         item.SubItems.Add(client.ServerName);
         item.SubItems.Add(client.ID.ToString());
         item.SubItems.Add(client.DbLink);
         item.SubItems.Add(client.ImagePath);
         item.SubItems.Add(client.ImagePath_BN);
         item.SubItems.Add(client.ImagePath_Chungtu);
         listView1.Items.Add(item);
         //list.Add(client);
     }
 }
예제 #7
0
 private void dataGridClient_DoubleClick(object sender, EventArgs e)
 {
     if (dataGridClient.CurrentRow.Index != -1)
     {
         Client                  = Convert.ToInt32(dataGridClient.CurrentRow.Cells["CodeClient"].Value);
         model                   = db.Clients.Where(x => x.CodeClient == Client).FirstOrDefault();
         Client                  = model.CodeClient;
         textcode.Text           = dataGridClient.CurrentRow.Cells["CodeClient"].Value.ToString();
         textnom.Text            = model.Libelle;
         textadresse.Text        = model.Adresse;
         textville.Text          = model.Ville;
         textemail.Text          = model.Email;
         textsiteweb.Text        = model.SiteWeb;
         textresponsable.Text    = model.Responsable;
         textcodepostal.Text     = model.CodePostal.ToString();
         textCIN.Text            = model.CIN.ToString();
         textcodeTVA.Text        = model.CodeTVA.ToString();
         textplafonCredit.Text   = model.PlafondCredit.ToString();
         textplafondEnCours.Text = model.PlafondEnCours.ToString();
         texttimbre.Text         = model.Timbre.ToString();
         textRIB.Text            = model.RIB.ToString();
         textfax.Text            = model.Fax.ToString();
         texttel.Text            = model.Tel.ToString();
         comboBoxbanque.Text     = model.Banque.Libelle;
         comboBoxcommercial.Text = model.NomCommercial;
         comboBoxPointVente.Text = model.PointVente.Libelle;;
         comboBoxRegTVA.Text     = model.RegTVA;
         comboBoxTarif.Text      = model.Tarif;
         comboBoxtypeclient.Text = model.TypeClient.Libelle;
     }
     btnsave.Text      = "Modifier";
     btndelete.Enabled = true;
 }
예제 #8
0
        internal IEnumerable <DTO.Client> Get()
        {
            IEnumerable <DTO.Client> clients = null;

#if DEBUG
            clients = new DAL.ClientMock().Get();
#else
            clients = new DAL.Client().Get();
#endif
            return(clients);
        }
 private DAL.Client ToEntity(Client client)
 {
     DAL.Client clientDAL = _salesContext.Clients.FirstOrDefault(x => x.Name == client.Name);
     if (clientDAL != null)
     {
         return(clientDAL);
     }
     else
     {
         return(DataMapper.Mapping(client));
     }
 }
예제 #10
0
 private void conXoa_Click(object sender, EventArgs e)
 {
     DAL.Accessdata dal = new DAL.Accessdata();
     if (listView1.SelectedItems.Count > 0)
     {
         foreach (ListViewItem item in listView1.SelectedItems)
         {
             DAL.Client _client = list.Find
                                  (
                 delegate(DAL.Client d_client) { return(d_client.Host == item.Text); }
                                  );
             if (MessageBox.Show("Bạn muốn xóa máy trạm :" + _client.Host, "Server", MessageBoxButtons.OKCancel, MessageBoxIcon.Question) == DialogResult.OK)
             {
                 if (dal.XoaClient(_client))
                 {
                     //dal.XoaClient(_client);
                     DateTime tn = DateTime.Now.AddDays(-(double)i_khoang_cach_ngay);
                     DateTime dn = DateTime.Now.AddDays((double)i_khoang_cach_ngay);
                     for (int j = tn.Year; j <= dn.Year; j++)
                     {
                         for (int i = tn.Month; i <= dn.Month; i++)
                         {
                             string mmyy = i.ToString().PadLeft(2, '0') + j.ToString().Substring(2, 2);
                             foreach (DataRow row in dsxml.Tables[0].Rows)
                             {
                                 dal.dropFunction(row["schema_name"].ToString().Replace("xxx", mmyy) + ".syn_" + row["table_name"].ToString() + "_from_" + _client.ServerName.ToLower());
                             }
                         }
                     }
                     //foreach (System.Data.DataRow row in dsxml.Tables[0].Rows)
                     //{
                     //    schema = row["schema_name"].ToString();
                     //    schema = schema.Replace("xxx", mmyy);
                     //    table = row["table_name"].ToString();
                     //    for (int i = 0; i < list.Count; i++)
                     //    {
                     //        dal.dropFunction(schema + ".syn_" + table + "_from_" + _client.ServerName.ToUpper());
                     //    }
                     //}
                 }
             }
         }
         load_listview();
     }
 }
예제 #11
0
 private void cmbMayTram_SelectedIndexChanged(object sender, EventArgs e)
 {
     if (this.ActiveControl == cmbMayTram || sender == null)
     {
         if (cmbMayTram.SelectedIndex < 0)
         {
             return;
         }
         int i_IDMaytram = int.Parse(cmbMayTram.SelectedValue.ToString());
         if (macc == null)
         {
             macc = new DAL.Accessdata();
         }
         DAL.Client c_client = macc.TimClient(i_IDMaytram);
         clientUI1.Client     = c_client;
         txtPath.Text         = c_client.ImagePath;
         txtPathBN.Text       = c_client.ImagePath_BN;
         txtPath_chungtu.Text = c_client.ImagePath_Chungtu;
     }
 }
예제 #12
0
 public frmDsMaytram(DAL.Client m_server)
 {
     InitializeComponent();
     _server = m_server;
 }
예제 #13
0
 /// <summary>
 /// Required method for Designer support - do not modify
 /// the contents of this method with the code editor.
 /// </summary>
 private void InitializeComponent()
 {
     DAL.Client client1 = new DAL.Client();
     System.ComponentModel.ComponentResourceManager resources = new System.ComponentModel.ComponentResourceManager(typeof(frmKhaibaomaytram));
     this.btnLuu  = new System.Windows.Forms.Button();
     this.button2 = new System.Windows.Forms.Button();
     this.folderBrowserDialog1 = new System.Windows.Forms.FolderBrowserDialog();
     this.label1          = new System.Windows.Forms.Label();
     this.image           = new System.Windows.Forms.Button();
     this.txtPath         = new System.Windows.Forms.TextBox();
     this.openFileDialog1 = new System.Windows.Forms.OpenFileDialog();
     this.label2          = new System.Windows.Forms.Label();
     this.txtPathBN       = new System.Windows.Forms.TextBox();
     this.label3          = new System.Windows.Forms.Label();
     this.butImageBN      = new System.Windows.Forms.Button();
     this.cmbMayTram      = new System.Windows.Forms.ComboBox();
     this.label4          = new System.Windows.Forms.Label();
     this.butMoi          = new System.Windows.Forms.Button();
     this.butSua          = new System.Windows.Forms.Button();
     this.butBoqua        = new System.Windows.Forms.Button();
     this.butHuy          = new System.Windows.Forms.Button();
     this.txtPath_chungtu = new System.Windows.Forms.TextBox();
     this.label5          = new System.Windows.Forms.Label();
     this.butDirHinhCtu   = new System.Windows.Forms.Button();
     this.clientUI1       = new UI.ClientUI();
     this.SuspendLayout();
     //
     // btnLuu
     //
     this.btnLuu.Font     = new System.Drawing.Font("Microsoft Sans Serif", 8.25F, System.Drawing.FontStyle.Bold, System.Drawing.GraphicsUnit.Point, ((byte)(0)));
     this.btnLuu.Location = new System.Drawing.Point(96, 307);
     this.btnLuu.Name     = "btnLuu";
     this.btnLuu.Size     = new System.Drawing.Size(75, 26);
     this.btnLuu.TabIndex = 9;
     this.btnLuu.Text     = "Lưu";
     this.btnLuu.UseVisualStyleBackColor = true;
     this.btnLuu.Click += new System.EventHandler(this.btnLuu_Click);
     //
     // button2
     //
     this.button2.Font     = new System.Drawing.Font("Microsoft Sans Serif", 8.25F, System.Drawing.FontStyle.Bold, System.Drawing.GraphicsUnit.Point, ((byte)(0)));
     this.button2.Location = new System.Drawing.Point(400, 307);
     this.button2.Name     = "button2";
     this.button2.Size     = new System.Drawing.Size(75, 26);
     this.button2.TabIndex = 13;
     this.button2.Text     = "Kết thúc";
     this.button2.UseVisualStyleBackColor = true;
     this.button2.Click += new System.EventHandler(this.button2_Click);
     //
     // label1
     //
     this.label1.AutoSize = true;
     this.label1.Location = new System.Drawing.Point(3, 213);
     this.label1.Name     = "label1";
     this.label1.Size     = new System.Drawing.Size(87, 13);
     this.label1.TabIndex = 14;
     this.label1.Text     = "Thư mục lưu ảnh";
     //
     // image
     //
     this.image.Font       = new System.Drawing.Font("Microsoft Sans Serif", 8.25F, System.Drawing.FontStyle.Bold, System.Drawing.GraphicsUnit.Point, ((byte)(0)));
     this.image.Image      = global::Server.Properties.Resources.openinnewwindow;
     this.image.ImageAlign = System.Drawing.ContentAlignment.MiddleLeft;
     this.image.Location   = new System.Drawing.Point(125, 206);
     this.image.Name       = "image";
     this.image.Size       = new System.Drawing.Size(33, 23);
     this.image.TabIndex   = 2;
     this.image.Text       = "...";
     this.image.UseVisualStyleBackColor = true;
     this.image.Click += new System.EventHandler(this.image_Click);
     //
     // txtPath
     //
     this.txtPath.Location = new System.Drawing.Point(158, 208);
     this.txtPath.Name     = "txtPath";
     this.txtPath.Size     = new System.Drawing.Size(322, 20);
     this.txtPath.TabIndex = 3;
     //
     // openFileDialog1
     //
     this.openFileDialog1.FileName = "openFileDialog1";
     //
     // label2
     //
     this.label2.AutoSize = true;
     this.label2.Location = new System.Drawing.Point(125, 276);
     this.label2.Name     = "label2";
     this.label2.Size     = new System.Drawing.Size(140, 13);
     this.label2.TabIndex = 12;
     this.label2.Text     = "Example: \\\\\\\\Server\\\\folder";
     //
     // txtPathBN
     //
     this.txtPathBN.Location = new System.Drawing.Point(158, 230);
     this.txtPathBN.Name     = "txtPathBN";
     this.txtPathBN.Size     = new System.Drawing.Size(322, 20);
     this.txtPathBN.TabIndex = 5;
     //
     // label3
     //
     this.label3.AutoSize = true;
     this.label3.Location = new System.Drawing.Point(3, 233);
     this.label3.Name     = "label3";
     this.label3.Size     = new System.Drawing.Size(105, 13);
     this.label3.TabIndex = 13;
     this.label3.Text     = "Thư mục lưu ảnh BN";
     //
     // butImageBN
     //
     this.butImageBN.Font       = new System.Drawing.Font("Microsoft Sans Serif", 8.25F, System.Drawing.FontStyle.Bold, System.Drawing.GraphicsUnit.Point, ((byte)(0)));
     this.butImageBN.Image      = global::Server.Properties.Resources.openinnewwindow;
     this.butImageBN.ImageAlign = System.Drawing.ContentAlignment.MiddleLeft;
     this.butImageBN.Location   = new System.Drawing.Point(125, 228);
     this.butImageBN.Name       = "butImageBN";
     this.butImageBN.Size       = new System.Drawing.Size(33, 23);
     this.butImageBN.TabIndex   = 4;
     this.butImageBN.Text       = "...";
     this.butImageBN.UseVisualStyleBackColor = true;
     this.butImageBN.Click += new System.EventHandler(this.butImageBN_Click);
     //
     // cmbMayTram
     //
     this.cmbMayTram.FormattingEnabled = true;
     this.cmbMayTram.Location          = new System.Drawing.Point(80, 6);
     this.cmbMayTram.Name                  = "cmbMayTram";
     this.cmbMayTram.Size                  = new System.Drawing.Size(404, 21);
     this.cmbMayTram.TabIndex              = 0;
     this.cmbMayTram.SelectedIndexChanged += new System.EventHandler(this.cmbMayTram_SelectedIndexChanged);
     //
     // label4
     //
     this.label4.AutoSize = true;
     this.label4.Location = new System.Drawing.Point(12, 9);
     this.label4.Name     = "label4";
     this.label4.Size     = new System.Drawing.Size(60, 13);
     this.label4.TabIndex = 15;
     this.label4.Text     = "Máy Trạm :";
     //
     // butMoi
     //
     this.butMoi.Font     = new System.Drawing.Font("Microsoft Sans Serif", 8.25F, System.Drawing.FontStyle.Bold, System.Drawing.GraphicsUnit.Point, ((byte)(0)));
     this.butMoi.Location = new System.Drawing.Point(20, 307);
     this.butMoi.Name     = "butMoi";
     this.butMoi.Size     = new System.Drawing.Size(75, 26);
     this.butMoi.TabIndex = 8;
     this.butMoi.Text     = "Mới";
     this.butMoi.UseVisualStyleBackColor = true;
     this.butMoi.Click += new System.EventHandler(this.butMoi_Click);
     //
     // butSua
     //
     this.butSua.Font     = new System.Drawing.Font("Microsoft Sans Serif", 8.25F, System.Drawing.FontStyle.Bold, System.Drawing.GraphicsUnit.Point, ((byte)(0)));
     this.butSua.Location = new System.Drawing.Point(172, 307);
     this.butSua.Name     = "butSua";
     this.butSua.Size     = new System.Drawing.Size(75, 26);
     this.butSua.TabIndex = 10;
     this.butSua.Text     = "Sửa";
     this.butSua.UseVisualStyleBackColor = true;
     this.butSua.Click += new System.EventHandler(this.butSua_Click);
     //
     // butBoqua
     //
     this.butBoqua.Font     = new System.Drawing.Font("Microsoft Sans Serif", 8.25F, System.Drawing.FontStyle.Bold, System.Drawing.GraphicsUnit.Point, ((byte)(0)));
     this.butBoqua.Location = new System.Drawing.Point(248, 307);
     this.butBoqua.Name     = "butBoqua";
     this.butBoqua.Size     = new System.Drawing.Size(75, 26);
     this.butBoqua.TabIndex = 11;
     this.butBoqua.Text     = "Bỏ qua";
     this.butBoqua.UseVisualStyleBackColor = true;
     this.butBoqua.Click += new System.EventHandler(this.butBoqua_Click);
     //
     // butHuy
     //
     this.butHuy.Font     = new System.Drawing.Font("Microsoft Sans Serif", 8.25F, System.Drawing.FontStyle.Bold, System.Drawing.GraphicsUnit.Point, ((byte)(0)));
     this.butHuy.Location = new System.Drawing.Point(324, 307);
     this.butHuy.Name     = "butHuy";
     this.butHuy.Size     = new System.Drawing.Size(75, 26);
     this.butHuy.TabIndex = 12;
     this.butHuy.Text     = "Hủy";
     this.butHuy.UseVisualStyleBackColor = true;
     this.butHuy.Click += new System.EventHandler(this.butHuy_Click);
     //
     // txtPath_chungtu
     //
     this.txtPath_chungtu.Location = new System.Drawing.Point(158, 253);
     this.txtPath_chungtu.Name     = "txtPath_chungtu";
     this.txtPath_chungtu.Size     = new System.Drawing.Size(322, 20);
     this.txtPath_chungtu.TabIndex = 7;
     //
     // label5
     //
     this.label5.AutoSize = true;
     this.label5.Location = new System.Drawing.Point(3, 256);
     this.label5.Name     = "label5";
     this.label5.Size     = new System.Drawing.Size(116, 13);
     this.label5.TabIndex = 18;
     this.label5.Text     = "Thư mục ảnh Chứng từ";
     //
     // butDirHinhCtu
     //
     this.butDirHinhCtu.Font       = new System.Drawing.Font("Microsoft Sans Serif", 8.25F, System.Drawing.FontStyle.Bold, System.Drawing.GraphicsUnit.Point, ((byte)(0)));
     this.butDirHinhCtu.Image      = global::Server.Properties.Resources.openinnewwindow;
     this.butDirHinhCtu.ImageAlign = System.Drawing.ContentAlignment.MiddleLeft;
     this.butDirHinhCtu.Location   = new System.Drawing.Point(125, 251);
     this.butDirHinhCtu.Name       = "butDirHinhCtu";
     this.butDirHinhCtu.Size       = new System.Drawing.Size(33, 23);
     this.butDirHinhCtu.TabIndex   = 6;
     this.butDirHinhCtu.Text       = "...";
     this.butDirHinhCtu.UseVisualStyleBackColor = true;
     this.butDirHinhCtu.Click += new System.EventHandler(this.button1_Click);
     //
     // clientUI1
     //
     client1.DatabaseName      = "medisoft_phuocan";
     client1.DbLink            = "may114";
     client1.Host              = "192.168.1.114";
     client1.ID                = ((long)(-1));
     client1.ImagePath         = null;
     client1.ImagePath_BN      = null;
     client1.ImagePath_Chungtu = null;
     client1.Passworddb        = "links1920";
     client1.Port              = "5432";
     client1.ServerName        = "may114";
     client1.STT               = -5;
     client1.Thoigian          = 5;
     client1.Userdb            = "medisoft";
     this.clientUI1.Client     = client1;
     this.clientUI1.Location   = new System.Drawing.Point(80, 33);
     this.clientUI1.Name       = "clientUI1";
     this.clientUI1.Size       = new System.Drawing.Size(240, 179);
     this.clientUI1.TabIndex   = 1;
     //
     // frmKhaibaomaytram
     //
     this.AutoScaleDimensions = new System.Drawing.SizeF(6F, 13F);
     this.AutoScaleMode       = System.Windows.Forms.AutoScaleMode.Font;
     this.ClientSize          = new System.Drawing.Size(491, 347);
     this.Controls.Add(this.txtPath_chungtu);
     this.Controls.Add(this.label5);
     this.Controls.Add(this.butDirHinhCtu);
     this.Controls.Add(this.butHuy);
     this.Controls.Add(this.butBoqua);
     this.Controls.Add(this.butSua);
     this.Controls.Add(this.butMoi);
     this.Controls.Add(this.label4);
     this.Controls.Add(this.cmbMayTram);
     this.Controls.Add(this.txtPathBN);
     this.Controls.Add(this.label3);
     this.Controls.Add(this.butImageBN);
     this.Controls.Add(this.label2);
     this.Controls.Add(this.txtPath);
     this.Controls.Add(this.label1);
     this.Controls.Add(this.image);
     this.Controls.Add(this.button2);
     this.Controls.Add(this.btnLuu);
     this.Controls.Add(this.clientUI1);
     this.Icon          = ((System.Drawing.Icon)(resources.GetObject("$this.Icon")));
     this.Name          = "frmKhaibaomaytram";
     this.StartPosition = System.Windows.Forms.FormStartPosition.CenterScreen;
     this.Text          = "Khai báo máy trạm";
     this.Load         += new System.EventHandler(this.frmKhaibaomaytram_Load);
     this.ResumeLayout(false);
     this.PerformLayout();
 }
예제 #14
0
 public frmDmTableAuto(DAL.Client _server)
 {
     InitializeComponent();
     m_server = _server;
 }
예제 #15
0
 /// <summary>
 /// Required method for Designer support - do not modify
 /// the contents of this method with the code editor.
 /// </summary>
 private void InitializeComponent()
 {
     DAL.Client client1 = new DAL.Client();
     System.ComponentModel.ComponentResourceManager resources = new System.ComponentModel.ComponentResourceManager(typeof(frmKhaibaomaychu));
     this.btnLuu     = new System.Windows.Forms.Button();
     this.btnKetthuc = new System.Windows.Forms.Button();
     this.clientUI1  = new UI.ClientUI();
     this.SuspendLayout();
     //
     // btnLuu
     //
     this.btnLuu.Location = new System.Drawing.Point(104, 202);
     this.btnLuu.Name     = "btnLuu";
     this.btnLuu.Size     = new System.Drawing.Size(75, 23);
     this.btnLuu.TabIndex = 1;
     this.btnLuu.Text     = "Lưu";
     this.btnLuu.UseVisualStyleBackColor = true;
     this.btnLuu.Click += new System.EventHandler(this.btnLuu_Click);
     //
     // btnKetthuc
     //
     this.btnKetthuc.Location = new System.Drawing.Point(185, 202);
     this.btnKetthuc.Name     = "btnKetthuc";
     this.btnKetthuc.Size     = new System.Drawing.Size(75, 23);
     this.btnKetthuc.TabIndex = 2;
     this.btnKetthuc.Text     = "Kết thúc";
     this.btnKetthuc.UseVisualStyleBackColor = true;
     this.btnKetthuc.Click += new System.EventHandler(this.btnKetthuc_Click);
     //
     // clientUI1
     //
     client1.DatabaseName    = "medisoft_phuocan";
     client1.DbLink          = "may114";
     client1.Host            = "192.168.1.114";
     client1.ID              = ((long)(-1));
     client1.Passworddb      = "links1920";
     client1.Port            = "5432";
     client1.ServerName      = "may114";
     client1.Thoigian        = 5;
     client1.Userdb          = "medisoft";
     this.clientUI1.Client   = client1;
     this.clientUI1.Location = new System.Drawing.Point(47, 3);
     this.clientUI1.Name     = "clientUI1";
     this.clientUI1.Size     = new System.Drawing.Size(240, 178);
     this.clientUI1.TabIndex = 0;
     //
     // frmKhaibaomaychu
     //
     this.AutoScaleDimensions = new System.Drawing.SizeF(6F, 13F);
     this.AutoScaleMode       = System.Windows.Forms.AutoScaleMode.Font;
     this.ClientSize          = new System.Drawing.Size(387, 237);
     this.Controls.Add(this.btnKetthuc);
     this.Controls.Add(this.btnLuu);
     this.Controls.Add(this.clientUI1);
     this.Icon          = ((System.Drawing.Icon)(resources.GetObject("$this.Icon")));
     this.Name          = "frmKhaibaomaychu";
     this.StartPosition = System.Windows.Forms.FormStartPosition.CenterScreen;
     this.Text          = "Khai bao may chu";
     this.WindowState   = System.Windows.Forms.FormWindowState.Maximized;
     this.Load         += new System.EventHandler(this.frmKhaibaomaychu_Load);
     this.ResumeLayout(false);
 }
예제 #16
0
 private void btnLuu_Click(object sender, EventArgs e)
 {
     //Xóa dblink
     DAL.Client f_client = clientUI1.Client;
     //
     if (macc == null)
     {
         macc = new DAL.Accessdata();
     }
     if (bNew)
     {
         bool bFound = macc.TimClient_TheoSTT(f_client.STT);
         if (bFound)
         {
             MessageBox.Show("STT Máy này đã tồn tại, chọn lại STT máy");
             return;
         }
     }
     //
     f_client.XoaDBLink();
     // Nếu tạo thành công dblink thì lưu xuống database link
     if (!f_client.TaoDBLink())
     {
         UI.Thongbao.Message("MC001");
         return;
     }
     //Lưu thông tin máy trạm lên server trung tâm.
     f_client.ImagePath         = @txtPath.Text;
     f_client.ImagePath_BN      = @txtPathBN.Text;
     f_client.ImagePath_Chungtu = txtPath_chungtu.Text;
     if (!DAL.Manager.LuuClient(f_client))
     {
         UI.Thongbao.Message("MC002");
         return;
     }
     //
     //
     // tạo các function liên quan đến máy trạm
     //string schema = "", table = "", field = "", key = "";
     //DAL.Accessdata acc = new DAL.Accessdata();
     //foreach (System.Data.DataRow row in dsxml.Tables[0].Rows)
     //{
     //    schema = row["schema"].ToString();
     //    schema = schema.Replace("xxx", mmyy);
     //    table = row["tablename"].ToString();
     //    field = row["field"].ToString();
     //    key = row["key"].ToString();
     //    acc.CreateFunction(m_server, f_client, schema, table, field, key);
     //}
     //try
     //{
     //    using (DAL.Accessdata acc = new DAL.Accessdata())
     //    {
     //        DateTime tn = DateTime.Now.AddDays(-(double)i_khoang_cach_ngay);
     //        DateTime dn = DateTime.Now.AddDays((double)i_khoang_cach_ngay);
     //        for (int j = tn.Year; j <= dn.Year; j++)
     //        {
     //            for (int i = tn.Month; i <= dn.Month; i++)
     //            {
     //                string mmyy = i.ToString().PadLeft(2, '0') + j.ToString().Substring(2, 2);
     //                foreach (DataRow row in dsxml.Tables[0].Rows)
     //                {
     //                    acc.CreateFunction(f_client, row["schema_name"].ToString().Replace("xxx", mmyy), row["table_name"].ToString());
     //                }
     //            }
     //        }
     //    }
     //}
     //catch { }
     //this.Close();
     MessageBox.Show("Lưu thành công.");
     clientUI1.emptyText();
     //
     load_combobox();
     //
     Empty_text();
     ena_obj(false);
     butMoi.Focus();
 }
예제 #17
0
 public frmEventlog(DAL.Client server)
 {
     InitializeComponent();
     m_server = server;
 }
예제 #18
0
 public Client Mapping(DAL.Client client)
 {
     Mapper.Initialize(cfg => cfg.CreateMap <DAL.Client, Client>());
     return(Mapper.Map <DAL.Client, Client>(client));
 }
예제 #19
0
 public frmKhaibaomaytram(DAL.Client server, List <DAL.Client> listClient)
 {
     InitializeComponent();
     m_server = server;
     list     = listClient;
 }
예제 #20
0
 private void butOK_Click(object sender, EventArgs e)
 {
     using (DAL.Accessdata acc = new DAL.Accessdata())
     {
         foreach (DataRow r in dtChinhanh.Select("chon=True"))
         {
             DAL.Client client = new DAL.Client(r["ip"].ToString(), r["port"].ToString(), r["database_local"].ToString(), "medisoft", "links1920", r["database_local"].ToString());
             client.ID       = int.Parse(r["id"].ToString());
             lblstatuss.Text = "btdbn";
             acc.update(client, "medibv", "btdbn", txtText, lblstatuss, proStatus, "to_number(to_char(ngayud,'yymmdd'))", txtTungay.Text, txtDenngay.Text, txtMabn.Text);
             //acc.update(client, "medibv", "btdbn", txtText, lblstatuss, proStatus);
             statusServer.Text = "";
             lblstatuss.Text   = "";
             DateTime tn = txtTungay.Value;
             DateTime dn = txtDenngay.Value;
             for (int j = tn.Year; j <= dn.Year; j++)
             {
                 for (int i = tn.Month; i <= dn.Month; i++)
                 {
                     string mmyy   = i.ToString().PadLeft(2, '0') + j.ToString().Substring(2, 2);
                     string schema = acc.User + mmyy;
                     if (acc.bShemaValid(schema))
                     {
                         lblstatuss.Text = schema + ".lienhe";
                         Application.DoEvents();
                         acc.update(client, schema, "lienhe", txtText, lblstatuss, proStatus, "maql", txtTungay.Text, txtDenngay.Text, txtMabn.Text);
                         lblstatuss.Text = schema + ".tiepdon";
                         Application.DoEvents();
                         acc.update(client, schema, "tiepdon", txtText, lblstatuss, proStatus, "maql", txtTungay.Text, txtDenngay.Text, txtMabn.Text);
                         lblstatuss.Text = schema + ".bhyt";
                         //Application.DoEvents();
                         //acc.update(client, schema, "bhyt", txtText, lblstatuss, proStatus, "maql", txtTungay.Text, txtDenngay.Text, txtMabn.Text);
                         //lblstatuss.Text = schema + ".lydokham";
                         Application.DoEvents();
                         acc.update(client, schema, "lydokham", txtText, lblstatuss, proStatus, "maql", txtTungay.Text, txtDenngay.Text, txtMabn.Text);
                         lblstatuss.Text = schema + ".trieuchung";
                         Application.DoEvents();
                         acc.update(client, schema, "trieuchung", txtText, lblstatuss, proStatus, "maql", txtTungay.Text, txtDenngay.Text, txtMabn.Text);
                         lblstatuss.Text = schema + ".v_chidinh";
                         Application.DoEvents();
                         acc.update(client, schema, "v_chidinh", txtText, lblstatuss, proStatus, "maql", txtTungay.Text, txtDenngay.Text, txtMabn.Text);
                         //lblstatuss.Text = schema + ".xn_phieu";
                         //Application.DoEvents();
                         //acc.update(client, schema, "xn_phieu", txtText, lblstatuss, proStatus, "id", txtTungay.Text, txtDenngay.Text);
                         //lblstatuss.Text = schema + ".xn_ketqua";
                         //Application.DoEvents();
                         //acc.update(client, schema, "xn_ketqua", txtText, lblstatuss, proStatus, "id", txtTungay.Text, txtDenngay.Text);
                         //lblstatuss.Text = "";
                     }
                 }
             }
         }
         foreach (DataRow r in dtChinhanh.Select("server=True"))
         {
             DAL.Client client = new DAL.Client(r["ip"].ToString(), r["port"].ToString(), r["database_local"].ToString(), "medisoft", "links1920", r["database_local"].ToString());
             client.ID       = int.Parse(r["id"].ToString());
             lblstatuss.Text = "btdbn";
             //acc.update(client, "medibv", "btdbn", txtText, lblstatuss, proStatus, "to_number(to_char(ngayud,'yymmdd'))", txtTungay.Text, txtDenngay.Text);
             //acc.update(client, "medibv", "btdbn", txtText, lblstatuss, proStatus);
             statusServer.Text = "";
             lblstatuss.Text   = "";
             string   s_id = "", tmp = "";
             DateTime tn = txtTungay.Value;
             DateTime dn = txtDenngay.Value;
             for (int j = tn.Year; j <= dn.Year; j++)
             {
                 for (int i = tn.Month; i <= dn.Month; i++)
                 {
                     string mmyy   = i.ToString().PadLeft(2, '0') + j.ToString().Substring(2, 2);
                     string schema = acc.User + mmyy;
                     if (acc.bShemaValid(schema))
                     {
                         lblstatuss.Text = schema + ".xn_phieu";
                         Application.DoEvents();
                         acc.update(client, schema, "xn_phieu", txtText, lblstatuss, proStatus, "id", txtTungay.Text, txtDenngay.Text, ref s_id, "");
                         if (s_id.Trim(',') == "")
                         {
                             return;
                         }
                         lblstatuss.Text = schema + ".xn_ketqua";
                         Application.DoEvents();
                         acc.update(client, schema, "xn_ketqua", txtText, lblstatuss, proStatus, "id", txtTungay.Text, txtDenngay.Text, ref tmp, s_id);
                         lblstatuss.Text = "";
                     }
                 }
             }
         }
         lblstatuss.Text = "Finish.";
         this.Cursor     = Cursors.Default;
     }
 }