Ejemplo n.º 1
0
        private void BtnUpdateCost_Click(object sender, EventArgs e)
        {
            if (DgvCostApply.SelectedRows.Count != 1)
            {
                MessageBox.Show("请仅选择一个费用单进行修改!", "信息提示", MessageBoxButtons.OK, MessageBoxIcon.Error);
                return;
            }
            int         costId   = (int)DgvCostApply.SelectedRows[0].Cells["cost_id"].Value;
            List <cost> costList = new CostApplyBLL().Query(new Dictionary <string, object> {
                { "id", costId }
            });

            if (costList.Count != 0)
            {
                if (costList[0].Main.status != 0)
                {
                    MessageBox.Show("该费用单已审核,不可修改", "信息提示", MessageBoxButtons.OK, MessageBoxIcon.Information);
                    return;
                }
            }
            CostApplyForm costApplyForm = new CostApplyForm(costId);

            costApplyForm.Text = "费用单修改";
            costApplyForm.ShowDialog();
            BtnSearchCostApply_Click(null, null);
        }
Ejemplo n.º 2
0
        //</张乐_3>
        #endregion

        #region 陈波
        //<陈波_3>
        //
        private void BtnAddCost_Click(object sender, EventArgs e)
        {
            CostApplyForm costApplyForm = new CostApplyForm();

            costApplyForm.ShowDialog();
            BtnSearchCostApply_Click(null, null);
        }
Ejemplo n.º 3
0
        private void BtnAddCostKind_Click(object sender, EventArgs e)
        {
            string CountPattern = @"^[0-9]*$";

            if (texCostCount.Text == "" || !Regex.Match(texCostCount.Text, CountPattern).Success || comboBoxCostType.SelectedItem == null || (string)comboBoxCostType.SelectedItem == "")
            {
                MessageBox.Show("您输入的数据不正确!", "错误提示", MessageBoxButtons.OK, MessageBoxIcon.Error);
            }
            else
            {
                string        TypeStr  = comboBoxCostType.SelectedItem.ToString().Trim();
                string        CountStr = texCostCount.Text.Trim();
                CostApplyForm form     = (CostApplyForm)this.Owner;
                form.addDetail(TypeStr, CountStr);
                this.Close();
            }
        }