Exemplo n.º 1
0
        private void SelectFish(int rowidx)
        {
            string condition = string.Format(" state={0} or state={1}", FishEntity.Constant.STATE_SELFMAKE, FishEntity.Constant.STATE_SELFBUY);

            UIForms.FormSelectFish form = new UIForms.FormSelectFish(-1, condition);
            if (form.ShowDialog() != System.Windows.Forms.DialogResult.OK)
            {
                return;
            }

            dataGridView1.Rows[rowidx].Cells["productname"].Value   = form.SelectedProduct.name;
            dataGridView1.Rows[rowidx].Cells["productcode"].Value   = form.SelectedProduct.code;
            dataGridView1.Rows[rowidx].Cells["productid"].Value     = form.SelectedProduct.id;
            dataGridView1.Rows[rowidx].Cells["specification"].Value = form.SelectedProduct.specification;
            dataGridView1.Rows[rowidx].Cells["goodbill"].Value      = form.SelectedProduct.billofgoods;

            int state = int.Parse(form.SelectedProduct.state);

            if (state == FishEntity.Constant.STATE_SELFMAKE)
            {
                dataGridView1.Rows[rowidx].Cells["unitprice"].Value = form.SelectedProduct.homemadeunitprice;
            }
            else
            {
                dataGridView1.Rows[rowidx].Cells["unitprice"].Value = form.SelectedProduct.price;
            }
        }
Exemplo n.º 2
0
        private void textBox6_Click(object sender, EventArgs e)
        {
            UIForms.FormSelectFish form = new UIForms.FormSelectFish(-1);
            form.StartPosition = FormStartPosition.CenterParent;
            if (form.ShowDialog() != System.Windows.Forms.DialogResult.OK)
            {
                return;
            }
            if (form.SelectedProduct == null)
            {
                return;
            }

            txtFishCode.Text = form.SelectedProduct.code;
            txtFishCode.Tag  = form.SelectedProduct.id;
            txtFishName.Text = form.SelectedProduct.name;
        }
Exemplo n.º 3
0
        private void txtFishCode_Click(object sender, EventArgs e)
        {
            UIForms.FormSelectFish form = new UIForms.FormSelectFish(-1);
            form.StartPosition = FormStartPosition.CenterParent;
            form.ShowInTaskbar = false;
            if (form.ShowDialog() != System.Windows.Forms.DialogResult.OK)
            {
                return;
            }
            if (form.SelectedProduct == null)
            {
                return;
            }

            txtFishCode.Text = form.SelectedProduct.code;
            txtFishCode.Tag  = form.SelectedProduct.id;
            txtfishname.Text = form.SelectedProduct.name;

            txtsgs_amine.Text    = form.SelectedProduct.sgs_amine.ToString();
            txtsgs_fat.Text      = form.SelectedProduct.sgs_fat.ToString();
            txtsgs_ffa.Text      = form.SelectedProduct.sgs_ffa.ToString();
            txtsgs_graypart.Text = form.SelectedProduct.sgs_graypart.ToString();
            txtsgs_protein.Text  = form.SelectedProduct.sgs_protein.ToString();
            txtsgs_sand.Text     = form.SelectedProduct.sgs_sand.ToString();
            txtsgs_sandsalt.Text = form.SelectedProduct.sgs_sandsalt.ToString();
            txtsgs_tvn.Text      = form.SelectedProduct.sgs_tvn.ToString();
            txtsgs_water.Text    = form.SelectedProduct.sgs_water.ToString();

            txtlabel_lysine.Text     = form.SelectedProduct.label_lysine.ToString();
            txtlabel_methionine.Text = form.SelectedProduct.label_methionine.ToString();

            txtdomestic_graypart.Text   = form.SelectedProduct.domestic_graypart.ToString();
            txtdomestic_lysine.Text     = form.SelectedProduct.domestic_lysine.ToString();
            txtdomestic_methionine.Text = form.SelectedProduct.domestic_methionine.ToString();
            txtdomestic_protein.Text    = form.SelectedProduct.domestic_protein.ToString();
            txtdomestic_sandsalt.Text   = form.SelectedProduct.domestic_sandsalt.ToString();
            txtdomestic_sour.Text       = form.SelectedProduct.domestic_sour.ToString();
            txtdomestic_tvn.Text        = form.SelectedProduct.domestic_tvn.ToString();
        }
Exemplo n.º 4
0
        private void txtFish_Click(object sender, EventArgs e)
        {
            UIForms.FormSelectFish form = new UIForms.FormSelectFish(-1);
            form.StartPosition = FormStartPosition.CenterParent;
            form.ShowInTaskbar = false;
            if (form.ShowDialog() != System.Windows.Forms.DialogResult.OK)
            {
                return;
            }
            if (form.SelectedProduct == null)
            {
                return;
            }

            txtFish.Text     = form.SelectedProduct.name;
            txtFish.Tag      = form.SelectedProduct.id;
            lblFishCode.Text = form.SelectedProduct.code;
            _productId       = form.SelectedProduct.id;
            _productName     = form.SelectedProduct.name;
            _productCode     = form.SelectedProduct.code;

            Query();
        }
Exemplo n.º 5
0
        private void txtFishCode_Click(object sender, EventArgs e)
        {
            if (_entity != null)
            {
                MessageBox.Show("修改进仓单时,不能改变鱼粉Id。");
                return;
            }

            //选择 状态为 “确盘”的鱼粉资料
            UIForms.FormSelectFish form = new UIForms.FormSelectFish(FishEntity.Constant.STATE_CONFIRM);
            form.StartPosition = FormStartPosition.CenterParent;
            if (form.ShowDialog() != System.Windows.Forms.DialogResult.OK)
            {
                return;
            }
            if (form.SelectedProduct == null)
            {
                return;
            }

            txtFishCode.Text = form.SelectedProduct.code;
            txtFishCode.Tag  = form.SelectedProduct.id;
            txtFishName.Text = form.SelectedProduct.name;
        }
        private void dataGridView1_CellClick(object sender, DataGridViewCellEventArgs e)
        {
            if (e.ColumnIndex < 0 || e.RowIndex < 0)
            {
                return;
            }
            if (dataGridView1.Columns[e.ColumnIndex].Name.Equals("productcode", StringComparison.OrdinalIgnoreCase) == false)
            {
                return;
            }

            //int no = 0;
            //if (dataGridView1.Rows[e.RowIndex].Cells["no"].Value == null) no = 0;
            //int.TryParse(dataGridView1.Rows[e.RowIndex].Cells["no"].Value.ToString(), out no);

            int state = FishEntity.Constant.STATE_SELFMAKE;

            /*if (no == FinishNo)*/ state = FishEntity.Constant.STATE_SELFMAKE;

            UIForms.FormSelectFish form = new UIForms.FormSelectFish(state);
            form.StartPosition = FormStartPosition.CenterParent;
            form.ShowInTaskbar = false;
            if (form.ShowDialog() != System.Windows.Forms.DialogResult.OK)
            {
                return;
            }

            //int no =0;
            // int.TryParse ( dataGridView1.Rows[e.RowIndex].Cells["no"].Value .ToString (), out no );
            dataGridView1.Rows[e.RowIndex].Cells[e.ColumnIndex].ErrorText = string.Empty;

            dataGridView1.Rows[e.RowIndex].Cells["productname"].Value = form.SelectedProduct.name;
            dataGridView1.Rows[e.RowIndex].Cells["productcode"].Value = form.SelectedProduct.code;
            dataGridView1.Rows[e.RowIndex].Cells["productid"].Value   = form.SelectedProduct.id;
            dataGridView1.Rows[e.RowIndex].Cells["nature"].Value      = form.SelectedProduct.nature;
            dataGridView1.Rows[e.RowIndex].Cells["brand"].Value       = form.SelectedProduct.brand;
            dataGridView1.Rows[e.RowIndex].Cells["remark"].Value      = form.SelectedProduct.remark;
            dataGridView1.Rows[e.RowIndex].Cells["shipno"].Value      = form.SelectedProduct.shipno;
            dataGridView1.Rows[e.RowIndex].Cells["billofgoods"].Value = form.SelectedProduct.billofgoods;
            dataGridView1.Rows[e.RowIndex].Cells["salermb"].Value     = form.SelectedProduct.salermb;
            dataGridView1.Rows[e.RowIndex].Cells["selfrmb"].Value     = form.SelectedProduct.selfrmb;

            //if (no == FinishNo) return;

            dataGridView1.Rows[e.RowIndex].Cells["domestic_protein"].Value    = form.SelectedProduct.domestic_protein;
            dataGridView1.Rows[e.RowIndex].Cells["domestic_tvn"].Value        = form.SelectedProduct.domestic_tvn;
            dataGridView1.Rows[e.RowIndex].Cells["domestic_graypart"].Value   = form.SelectedProduct.domestic_graypart;
            dataGridView1.Rows[e.RowIndex].Cells["domestic_sandsalt"].Value   = form.SelectedProduct.domestic_sandsalt;
            dataGridView1.Rows[e.RowIndex].Cells["domestic_sour"].Value       = form.SelectedProduct.domestic_sour;
            dataGridView1.Rows[e.RowIndex].Cells["domestic_lysine"].Value     = form.SelectedProduct.domestic_lysine;
            dataGridView1.Rows[e.RowIndex].Cells["domestic_methionine"].Value = form.SelectedProduct.domestic_methionine;
            dataGridView1.Rows[e.RowIndex].Cells["domestic_amine"].Value      = form.SelectedProduct.domestic_amine;
            dataGridView1.Rows[e.RowIndex].Cells["domestic_aminototal"].Value = form.SelectedProduct.domestic_aminototal;
            dataGridView1.Rows[e.RowIndex].Cells["domestic_fat"].Value        = form.SelectedProduct.domestic_fat;

            //decimal unitprice = 0;
            //if (form.SelectedProduct.homemadeweight == 0) unitprice = 0;
            //else
            //{
            //    unitprice = form.SelectedProduct.homemadecost.Value / form.SelectedProduct.homemadeweight.Value;
            //}

            //dataGridView1.Rows[e.RowIndex].Cells["homemadeunitprice"].Value = unitprice;
            //decimal costDec = 0;
            //decimal tonsDec= 0;
            //if (dataGridView1.Rows[e.RowIndex].Cells["tons"].Value != null)
            //{
            //    decimal.TryParse(dataGridView1.Rows[e.RowIndex].Cells["tons"].Value.ToString(), out tonsDec);
            //    costDec = unitprice * tonsDec;
            //}
            //dataGridView1.Rows[e.RowIndex].Cells["cost"].Value = costDec;

            //dataGridView1.Rows[e.RowIndex].Cells["tons"].Value = form.SelectedProduct.
            //dataGridView1.Rows[e.RowIndex].Cells["tons"].Selected = true;



            Calc();
        }