コード例 #1
0
    /*****************************************************
    * - Function name : Refresh1_Click
    * - Description : 刷新采购记录显示
    * - Variables : object sender, EventArgs e
    *****************************************************/
    protected void Refresh1_Click(object sender, EventArgs e)
    {
        if (Session["FinanceDepartmentUsername"] == null)
        {
            return;
        }

        // 记录数据刷新
        bindPurchase();

        // 统计显示未处理的采购申请
        FinanceDatabaseHelper FDH = new FinanceDatabaseHelper();
        int n = FDH.getUnsolvedApplies();

        label1.Text = "新的采购申请" + n + "条";
    }
コード例 #2
0
    /*****************************************************
    * - Function name : ButtonPermit_Click
    * - Description : 批准操作
    * - Variables : object sender, EventArgs e
    *****************************************************/
    protected void ButtonPermit_Click(object sender, EventArgs e)
    {
        // 获取确认人工号
        string purid = Session["FinanceDepartmentUsername"].ToString();

        // 修改采购单状态
        FinanceDatabaseHelper FDH = new FinanceDatabaseHelper();

        if (FDH.purchasePermitAction(id))
        {
            Response.Write("<script>alert('已批准申请');</script>");
        }
        else
        {
            Response.Write("<script>alert('申请批准操作异常!');</script>");
        }
    }
コード例 #3
0
    /*****************************************************
    * - Function name : init
    * - Description : 根据单号查询信息
    * - Variables : void
    *****************************************************/
    private void init()
    {
        // 创建一个服务类
        FinanceDatabaseHelper FDH = new FinanceDatabaseHelper();

        // 读取订单信息
        Purchase p = FDH.getPurchaseApplicationDetail(id);

        // 显示到界面
        LabelBrand.Text   = "品牌:" + FDH.getBrand(id);
        LabelModel.Text   = "型号:" + FDH.getModel(id);
        LabelPrice.Text   = "单价:" + p.getP_price() + "元";
        LabelAmount.Text  = "采购数量:" + p.getPur_amount() + "部";
        LabelSummary.Text = "总价:" + p.getP_summary() + "元";
        LabelDate.Text    = "申请日期:" + p.getPur_date();
        LabelBuyway.Text  = "采购方式:" + p.getPur_way() + "(" + id + ")";
        LabelBuy.Text     = "申请人:" + FDH.getBuyEmployeeName(id);
        LabelCard.Text    = "采购卡号:" + p.getPur_card();
    }
コード例 #4
0
    /*****************************************************
    * - Function name : submit_Click
    * - Description : 提交响应
    * - Variables : object sender, EventArgs e
    *****************************************************/
    protected void submit_Click(object sender, EventArgs e)
    {
        // 获取输入值
        double money     = double.Parse(TextBoxMoney.Text.ToString());
        string y         = DropDownListYear.Text.ToString();
        string m         = DropDownListMonth.Text.ToString();
        string d         = DropDownListDay.Text.ToString();
        string h         = System.DateTime.Now.Hour.ToString();
        string min       = System.DateTime.Now.Minute.ToString();
        string sec       = System.DateTime.Now.Second.ToString();
        string date      = y + "/" + m + "/" + d + " " + h + ":" + min + ":" + sec;
        string deal_kind = "";

        if (RadioButton1.Checked == true)
        {
            deal_kind = "收入";
        }
        else if (RadioButton2.Checked == true)
        {
            deal_kind = "支出";
        }
        string receive_name       = TextBoxReceiveMan.Text.ToString();
        string receive_card       = TextBoxReceiveCard.Text.ToString();
        string allocate_name      = TextBoxAllocateMan.Text.ToString();
        string allocate_card      = TextBoxAllocateCard.Text.ToString();
        string deal_way           = DropDownListDealway.Text.ToString();
        FinanceDatabaseHelper FDH = new FinanceDatabaseHelper();
        string deal_man           = TextBoxDealMan.Text.ToString();
        string assure_id          = FDH.getEmployeeID(deal_man);
        string note = TextBoxNote.Text.ToString();

        // 检验办理人是否合理
        if (deal_man != "匿名")
        {
            if (deal_man == "")
            {
                Response.Write("<script>alert('办理人不合法!');</script>");
                return;
            }
        }

        // 创建控制类
        IncomeExpenseAction IEA = new IncomeExpenseAction();

        // 新建收支对象
        IEA.addIncomeExpense();

        // 设置属性值
        IEA.setIEDeal(money, receive_name, receive_card, allocate_name, allocate_card);
        IEA.setIEDealMan(date, deal_kind, deal_way, assure_id);
        IEA.setIENote(note);

        // 保存
        IncomeExpenseService IES = new IncomeExpenseService();

        if (IES.saveIncomeExpenseRecord(IEA.getIncomeExpense()))
        {
            Response.Write("<script type='text/javascript'>alert('添加成功!');window.location='financeHome.aspx'</script>");
        }
        else
        {
            Response.Write("<script>alert('添加失败!');</script>");
        }
    }