Exemplo n.º 1
0
        private void BindDepartmentYearCategoryCount()
        {
            if (this.IdDepartShortCall.SelectedValue == null ||
                this.IdCategory.SelectedValue == null ||
                (ComboboxItem)this.IdYear.SelectedItem == null ||
                (ComboboxItem)this.IdYear.SelectedItem == null)
            {
                //MessageBox.Show("请将编号填写完整!", "警告", MessageBoxButtons.OK, MessageBoxIcon.Warning);
                return;
            }

            //MessageBox.Show(this.IdDepartShortCall.Text);
            Search search = new Search
            {
                SDepartmentShortlCall = this.IdDepartShortCall.Text,
                CategoryShortCall     = this.IdCategory.Text,
                Year = int.Parse(this.IdYear.Text),
            };

            int count = _sc.GetDepartmentCategoryYearContractCount(search);

            //  modigy by gatieme @2016-02-26
            //  编号应该是2位,因此最后两位都是编号的信息
            if (count + 1 >= 100)       //  编号超出3位
            {
                if (UserHelper.UserInfo.CanStatistic == 0)
                {
                    MessageBox.Show("系统中编号限制为两位, 当前编号的会签单数目已达上限\n如有需要, 请找管理员\n当然您也可以换个部门审批", "警告", MessageBoxButtons.OK, MessageBoxIcon.Warning);
                    this.IdNo.Text = "";
                    return;
                }
            }
            else if (count + 1 < 10)
            {
                this.IdNo.Text = "0" + (count + 1).ToString();
            }
            else
            {
                this.IdNo.Text = (count + 1).ToString();
            }
        }