コード例 #1
0
ファイル: AddPay.aspx.cs プロジェクト: sinyuewh/CJZC2007
    //保存支出单据
    protected void SaveDataClick(object sender, EventArgs e)
    {
        Hashtable ht = new Hashtable();

        string[] arr1 = new string[] { "bill", "billtime", "danwei", "zeren", "remark", "billmen",
                                       "fee1", "fee2", "fee3", "fee4", "fee5", "fee6", "fee7", "fee8",
                                       "fee9", "fee10", "fee11", "fee12" };
        for (int i = 0; i < arr1.Length; i++)
        {
            object obj1 = Util.GetControlValue(this.billmen.Parent.FindControl(arr1[i]));
            if (obj1 != null && obj1.ToString().Trim() != "")
            {
                ht.Add(arr1[i], obj1);
            }
        }
        ht.Add("zcid", Request.QueryString["zcid"]);
        try
        {
            CW_PayBU Pay1   = new CW_PayBU();
            bool     result = Pay1.InsertData(ht);
            Pay1.Close();
            if (result)
            {
                Comm.ShowInfo("【增加支出单据】操作成功!", Application["root"] + "/Caiwu/ZcSearch.aspx");
            }
        }
        catch
        {
            Comm.ShowInfo("【增加支出单据】操作失败,可能的原因是单据编号重复,请重新输入!", Request.RawUrl);
        }
    }
コード例 #2
0
ファイル: TJ_ZhiChu.aspx.cs プロジェクト: sinyuewh/CJZC2007
    //统计事件处理
    void SelectTime1_StaticEvent(object sender, EventArgs e)
    {
        string dt1 = "";
        string dt2 = "";

        if (this.SelectTime1.BeginTime != "")
        {
            dt1 = this.SelectTime1.BeginTime;
        }

        if (this.SelectTime1.EndTime != "")
        {
            dt2 = this.SelectTime1.EndTime;
        }

        CW_PayBU pay1 = new CW_PayBU();
        DataSet  ds   = pay1.GetZhiChuStaticDataByDefineTime(dt1, dt2);

        pay1.Close();

        //显示表头信息
        string tableTitle = "";

        switch (this.SelectTime1.StaticType)
        {
        case SearchStaticType.年统计:
            tableTitle = this.SelectTime1.StaticYear + "年度支出汇总表";
            break;

        case SearchStaticType.月统计:
            tableTitle = this.SelectTime1.StaticYear + "年" + this.SelectTime1.StaticMonth + "月支出汇总表";
            break;

        case SearchStaticType.季度统计:
            tableTitle = this.SelectTime1.StaticYear + "年" + this.SelectTime1.StaticJidu + "季度支出汇总表";
            break;

        default:
            string begtime = this.SelectTime1.BeginTime;
            if (begtime == "")
            {
                begtime = "过去";
            }

            string endtime = this.SelectTime1.EndTime;
            if (endtime == "")
            {
                endtime = "现在";
            }
            tableTitle = begtime + "~" + endtime + "支出汇总表";
            break;
        }
        this.SetTableData(tableTitle, ds);
    }
コード例 #3
0
    protected void GridView1_RowDeleting(object sender, GridViewDeleteEventArgs e)
    {
        string id = this.GridView1.DataKeys[e.RowIndex].Value.ToString();

        if (id != "")
        {
            CW_PayBU pay1 = new CW_PayBU();
            pay1.DelPayDJ(id);
            pay1.Close();
            this.BindData();
        }
    }
コード例 #4
0
    private void BindData(string begintime, string endtime)
    {
        CW_PayBU pay1 = new CW_PayBU();
        DataSet  ds   = pay1.GetZhiChuByDepart(begintime, endtime);

        for (int i = 0; i < ds.Tables[0].Rows.Count; i++)
        {
            ds.Tables[0].Rows[i]["Sumfee"] = PubComm.GetNumberFormat(ds.Tables[0].Rows[i]["Sumfee"].ToString());
            AllHK = AllHK + double.Parse(ds.Tables[0].Rows[i]["Sumfee"].ToString());
        }
        this.Repeater1.DataSource = ds;
        this.Repeater1.DataBind();
        pay1.Close();
    }
コード例 #5
0
    //审核单据
    protected void SaveDataClick(object sender, EventArgs e)
    {
        CW_PayBU pay1   = new CW_PayBU();
        bool     check1 = pay1.CheckBill(Request.QueryString["id"], User.Identity.Name);

        pay1.Close();

        if (check1)
        {
            Comm.ShowInfo("提示:审核单据成功!", Application["root"] + "/Caiwu/CheckPayList.aspx");
        }
        else
        {
            Comm.ShowInfo("提示:审核单据失败,请重新审核!", Request.RawUrl);
        }
    }
コード例 #6
0
    protected void Page_Load(object sender, EventArgs e)
    {
        if (!Page.IsPostBack)
        {
            CW_PayBU  pay1 = new CW_PayBU();
            Hashtable ht   = pay1.GetObjectByID(Request.QueryString["id"]);
            pay1.Close();

            for (int i = 0; i < arr1.Length; i++)
            {
                Util.SetControlValue(this.bill.Parent.FindControl(arr1[i]), ht[arr1[i]]);
            }
            if (this.billtime.Text != "" && this.billtime.Text != null)
            {
                this.billtime.Text = DateTime.Parse(this.billtime.Text).ToString("yyyy-M-d");
            }
            for (int j = 0; j < arr2.Length; j++)
            {
                Label lab1 = this.bill.Parent.FindControl(arr2[j]) as Label;
                if (lab1 != null)
                {
                    lab1.Text = Comm.GetNumberFormat(lab1.Text);
                }
            }
            if (ht["checktime"] != DBNull.Value)
            {
                this.Button1.Visible = false;
                this.Button2.Attributes["onclick"] = "history.go(-1);return false;";
            }
            else
            {
                this.Button2.Attributes["onclick"] = "top.location.href='CheckShouKuanList.aspx';return false;";
            }


            //会计和出纳和修改单据的信息
            U_RolesBU role1 = new U_RolesBU();
            bool      caiwu = role1.isRole(new string[] { "会计", "出纳" });
            role1.Close();

            if (caiwu == false)
            {
                this.Button3.Visible = false;
            }
        }
    }
コード例 #7
0
ファイル: AddPay.aspx.cs プロジェクト: sinyuewh/CJZC2007
    protected void Page_Load(object sender, EventArgs e)
    {
        if (!Page.IsPostBack)
        {
            this.billtime.Text = DateTime.Now.ToString("yyyy-M-d");
            this.billmen.Text  = User.Identity.Name;
            U_ZCBU  zc1 = new U_ZCBU();
            DataSet ds  = zc1.GetDetailByID(Request.QueryString["zcid"], "danwei,zeren");
            zc1.Close();
            if (ds.Tables[0].Rows.Count > 0)
            {
                Util.SetControlValue(danwei, ds.Tables[0].Rows[0]["danwei"]);
                Util.SetControlValue(zeren, ds.Tables[0].Rows[0]["zeren"]);

                CW_PayBU Pay1 = new CW_PayBU();
                this.bill.Text = Pay1.GetBillNum();
                Pay1.Close();
            }
            this.billtime.Attributes["onfocus"] = "setday(this)";
        }
    }
コード例 #8
0
    protected void Repeater1_DataBound(object sender, RepeaterItemEventArgs e)
    {
        CW_PayBU pay1 = new CW_PayBU();

        DataSet ds10 = pay1.GetGSFYHJ(btime, etime);

        ds10.Tables[0].Rows[0]["fyhj"] = PubComm.GetNumberFormat(AllHK);

        GridView gridview10 = e.Item.FindControl("GridView10") as GridView;

        if (gridview10 != null)
        {
            gridview10.ShowHeader = false;
            gridview10.DataSource = ds10;
            gridview10.DataBind();
        }
        Label lab1 = e.Item.FindControl("labDepart") as Label;

        if (lab1 != null)
        {
            DataSet ds1 = pay1.GetZhiChu(btime, etime, lab1.Text);

            for (int i = 0; i < ds1.Tables[0].Rows.Count; i++)
            {
                for (int k = 1; k < 13; k++)
                {
                    ds1.Tables[0].Rows[i]["Sumfee" + k] = PubComm.GetNumberFormat(ds1.Tables[0].Rows[i]["Sumfee" + k].ToString());
                }
                ds1.Tables[0].Rows[i]["Sumfee"] = PubComm.GetNumberFormat(ds1.Tables[0].Rows[i]["Sumfee"].ToString());
            }
            GridView gridview1 = e.Item.FindControl("GridView1") as GridView;
            if (gridview1 != null)
            {
                gridview1.DataSource = ds1;
                gridview1.DataBind();
            }
            gridview1.Dispose();
        }
        pay1.Close();
    }