private void Save()
        {
            Rp_BoxMonthYear bmy = new Rp_BoxMonthYear();
            bmy.Insert(Convert.ToInt32(this.rbInOut.SelectedValue),ViewState["Guid"] as string, Session["ORGID"] as string, Session["CompanyName"] as string, Convert.ToInt32(this.ddlYear.SelectedValue), Convert.ToInt32(this.ddlMonth.SelectedValue), DateTime.Now, Convert.ToInt32(this.rbIsMonth.SelectedValue), DateTime.Now);
            for (int i = 0; i < dvGJ.Table.Rows.Count; i++)
            {
                InsertDetail(i, dvGJ, "JZXGJ");

            }
            for (int i = 0; i < dvNZ.Table.Rows.Count; i++)
            {
                InsertDetail(i, dvNZ, "JZXNZ");
            }
            for (int i = 0; i < dvGN.Table.Rows.Count; i++)
            {
                InsertDetail(i, dvGN, "JZXGN");
            }
        }
        private void Save()
        {
            Rp_BoxMonthYear bmy = new Rp_BoxMonthYear();
            //先判断
            if (bmy.IsHasUp(ViewState["Guid"] as string,Session["ORGID"] as string,Convert.ToInt32(rbIsMonth.SelectedValue),Convert.ToInt32(ddlYear.SelectedValue),Convert.ToInt32(ddlMonth.SelectedValue)))//已存在其他与本时间段冲突的记录
            {
                throw new Exception(string.Format("已存在{0}的{1}的记录",Session["CompanyName"] as string,this.ddlYear.SelectedItem.Text+this.ddlMonth.SelectedItem.Text));
            }
            //先删除
            bmy.Delete(ViewState["Guid"] as string);
            bmy.Insert(Convert.ToInt32(this.rbInOut.SelectedValue),ViewState["Guid"] as string, Session["ORGID"] as string, Session["CompanyName"] as string, Convert.ToInt32(this.ddlYear.SelectedValue), Convert.ToInt32(this.ddlMonth.SelectedValue), DateTime.Now, Convert.ToInt32(this.rbIsMonth.SelectedValue), DateTime.Now);
            for (int i = 0; i < dvGJ.Table.Rows.Count; i++)
            {
                InsertDetail(i, dvGJ, "JZXGJ");

            }
            for (int i = 0; i < dvNZ.Table.Rows.Count; i++)
            {
                InsertDetail(i, dvNZ, "JZXNZ");
            }
            for (int i = 0; i < dvGN.Table.Rows.Count; i++)
            {
                InsertDetail(i, dvGN, "JZXGN");
            }
            new CawDataStatusDB().UpdateNoSubmit(ViewState["Guid"] as string, Session["UserID"].ToString(), Session["RealName"].ToString());
        }