Beispiel #1
0
        public MKTWHcount(View.Main Main, string storelocation)
        {
            InitializeComponent();
            this.KeyPreview = true;
            this.KeyUp     += new System.Windows.Forms.KeyEventHandler(Control_KeyPress); // để đọc từ bàn phím phím tắt


            this.main1         = Main;
            this.storelocation = storelocation;
            this.Username      = Utils.getusername();
            this.Createdby     = Utils.getname();
            //      this.Loadnumberserri = Loadnumberserri;
            txtdatacapture.Text = "";


            txtdatacapture.Text = Utils.getname();



            datecreated.Value = DateTime.Today;


            loaddetailNewinventory();

            btluu.Enabled = true;
            //btinphieu.Enabled = false;

            txtstorelocation.Text = this.storelocation;
            dataGridViewLoaddetail.Focus();
        }
Beispiel #2
0
        public Beemainload(View.Main Main)
        {
            InitializeComponent();

            Model.Username used = new Username();
            this.main1 = Main;
            //    treeView1.Visible = false;
            //     panel1.Visible = false;
        }
 //  IQueryable rs, LinqtoSQLDataContext d
 public MKTViewchooseiqueryloadtomain(View.Main Main, IQueryable rs, LinqtoSQLDataContext dc, string fornname, string columhead)
 {
     InitializeComponent();
     this.main1     = Main;
     label7.Text    = fornname;
     this.columhead = columhead;
     this.fornname  = fornname;
     this.dataGridView1.DataSource       = rs;
     dataGridView1.Columns["id"].Visible = false;
     //   Valuechoose = "";
     chon = false;
 }
        public MKTWHcountaproval(View.Main Main, int idstorecount, string vieworaction)
        {
            InitializeComponent();
            this.KeyPreview = true;
            this.KeyUp     += new System.Windows.Forms.KeyEventHandler(Control_KeyPress); // để đọc từ bàn phím phím tắt


            if (vieworaction == "STOCK COUNT LIST")
            {
                btAproval.Visible = false;
                btreject.Visible  = false;
            }

            this.main1 = Main;

            string connection_string = Utils.getConnectionstr();
            LinqtoSQLDataContext dc  = new LinqtoSQLDataContext(connection_string);

            var storc = (from pp in dc.tbl_MKT_Stockcounts
                         where pp.id == idstorecount
                         select pp).FirstOrDefault();

            if (storc != null)
            {
                this.storelocation = storc.Store_code;
                this.CountingDate  = (DateTime)storc.CountingDate;
                this.Countingtimes = (int)storc.Idsub;
            }


            //   this.storelocation = storelocation;
            this.Username = Utils.getusername();
            //    this.Createdby = Utils.getname();
            //      this.Loadnumberserri = Loadnumberserri;
            txtnguoinhan.Text = "";


            txtnguoinhan.Text = Utils.getname();



            dateupdate.Value = DateTime.Today;

            loaddetailinventoryforapproval();
            //  loaddetailNewinventory();

            //btluu.Enabled = true;
            //btinphieu.Enabled = false;

            txtstorelocation.Text = this.storelocation;
            dataGridViewLoaddetail.Focus();
        }
        public MKTWHDeviceRegion(View.Main Main, string storelocation)
        {
            InitializeComponent();
            this.KeyPreview = true;
            this.KeyUp     += new System.Windows.Forms.KeyEventHandler(Control_KeyPress); // để đọc từ bàn phím phím tắt


            this.main1         = Main;
            this.storelocation = storelocation;
            this.Username      = Utils.getusername();
            this.Createdby     = Utils.getname();
            //      this.Loadnumberserri = Loadnumberserri;
            txtdatacapture.Text = "";


            txtdatacapture.Text = Utils.getname();



            datecreated.Value = DateTime.Today;


            #region  DeleteTempFBL5nnew DeleteTempFBL5nnew
            SqlConnection conn2 = null;
            SqlDataReader rdr1  = null;

            string destConnString = Utils.getConnectionstr();
            try
            {
                conn2 = new SqlConnection(destConnString);
                conn2.Open();
                SqlCommand cmd1 = new SqlCommand("UpdateBudgetuse", conn2);
                cmd1.CommandType = CommandType.StoredProcedure;

                cmd1.Parameters.Add("@location", SqlDbType.NVarChar).Value = storelocation.Trim();
                ///     cmd1.Parameters.Add("@todate", SqlDbType.Date).Value = todate;
                //  System.Data.SqlDbType.DateTime
                try
                {
                    rdr1 = cmd1.ExecuteReader();
                    //  MessageBox.Show("OK, please go to Input verify to reinput !", "Thông báo", MessageBoxButtons.OK, MessageBoxIcon.Information);
                }
                catch (Exception ex)
                {
                    MessageBox.Show("Error  update Budget used \n" + ex.ToString(), "Thông báo", MessageBoxButtons.OK, MessageBoxIcon.Error);
                }



                //       rdr1 = cmd1.ExecuteReader();
            }
            finally
            {
                if (conn2 != null)
                {
                    conn2.Close();
                }
                if (rdr1 != null)
                {
                    rdr1.Close();
                }
            }

            #endregion

            loaddetailStoredivice();

            //      btluu.Enabled = true;
            //btinphieu.Enabled = false;

            txtstorelocation.Text = this.storelocation;
            dataGridViewLoaddetail.Focus();
        }