protected void Page_Load(object sender, System.EventArgs e) { if (!Page.IsPostBack) { ViewState["TableName"] = oAddPage.TableDetail.TableName; #region 判断是否是辅表,如果是辅表,并且没有父表的RowID,自动转到相应的主表 string ParentRowGuid = Request.QueryString["ParentRowGuid"]; if (oAddPage.TableDetail.TableType == 2) { if (ParentRowGuid == null || ParentRowGuid == "") { this.AlertAjaxMessage("禁止直接对子表添加记录!"); return; } } #endregion Epoint.MisBizLogic2.Web.CodeGenerator.InitiateControl_AddPage(oAddPage, tdContainer); //添加上传文件的大小和类型检查 this.Add_FileUploadCheck_Script(); string strSql = " select top(1) DWGuid from rg_ouinfo where DWGuid=(select distinct DanWeiGuid from RG_User where RowGuid='" + Session["UserGuid"].ToString() + "') order by row_id desc "; DWGuid_2020.Text = Epoint.MisBizLogic2.DB.ExecuteToString(strSql); strSql = " select top(1) EnterpriseName from rg_ouinfo where DWGuid=(select distinct DanWeiGuid from RG_User where RowGuid='" + Session["UserGuid"].ToString() + "') order by row_id desc "; DWName_2020.Text = Epoint.MisBizLogic2.DB.ExecuteToString(strSql); CF.BindYearDDL(ddlYear, 2012, true); CF.BindMonthDDL(ddlMonth, "0"); } }
protected void Page_Load(object sender, System.EventArgs e) { if (!Page.IsPostBack) { ViewState["TableName"] = oAddPage.TableDetail.TableName; #region 判断是否是辅表,如果是辅表,并且没有父表的RowID,自动转到相应的主表 string ParentRowGuid = Request.QueryString["ParentRowGuid"]; if (oAddPage.TableDetail.TableType == 2) { if (ParentRowGuid == null || ParentRowGuid == "") { this.AlertAjaxMessage("禁止直接对子表添加记录!"); return; } } #endregion Epoint.MisBizLogic2.Web.CodeGenerator.InitiateControl_AddPage(oAddPage, tdContainer); //添加上传文件的大小和类型检查 this.Add_FileUploadCheck_Script(); CF.BindYearDDL(ddlYear, 2012, true); CF.BindMonthDDL(ddlMonth, "0"); } }
protected void Page_Load(object sender, System.EventArgs e) { if (!Page.IsPostBack) { string DWGuid = ""; string RowGuid = ""; string strURL = ""; //先判断是否是跳转过来的 if (String.IsNullOrEmpty(Request["RowGuid"]))//不是跳转 { //判断有没有记录,如果没有记录的话,就直接跳转到新增页面 string strSql = " select top(1) DWGuid from rg_ouinfo where DWGuid=(select distinct DanWeiGuid from RG_User where RowGuid='" + Session["UserGuid"].ToString() + "') order by row_id desc "; DWGuid = Epoint.MisBizLogic2.DB.ExecuteToString(strSql); strSql = " select top(1) RowGuid from RG_YueDuCaiWu where DWGuid='" + DWGuid + "' order by row_id desc "; RowGuid = Epoint.MisBizLogic2.DB.ExecuteToString(strSql); if (RowGuid == "")//说明没有记录,就跳转到新增页面 { strURL = "RG_YueDuCaiWu_Add.aspx?ParentRowGuid=&RowGuid=" + Guid.NewGuid().ToString() + "&DWGuid=" + DWGuid + ""; this.WriteAjaxMessage("window.location.href='" + strURL + "';"); return; } else//如果有记录,也要跳转到本页面重新加载 { strURL = "RG_YueDuCaiWu_Edit.aspx?RowGuid=" + RowGuid + "&DWGuid=" + DWGuid + ""; this.WriteAjaxMessage("window.location.href='" + strURL + "';"); return; } } else//是跳转 { RowGuid = Request["RowGuid"]; DWGuid = Request["DWGuid"]; } ViewState["TableName"] = oEditPage.TableDetail.TableName; Epoint.MisBizLogic2.Data.MisGuidRow oRow = new Epoint.MisBizLogic2.Data.MisGuidRow(oEditPage.TableDetail.SQL_TableName, RowGuid); if (!oRow.R_HasFilled) { btnEdit.Visible = false; this.AlertAjaxMessage("没有对应的数据记录!"); this.WriteAjaxMessage("window.close();"); return; } Epoint.MisBizLogic2.Web.CodeGenerator.InitiateControl_EditPage(oEditPage, tdContainer, oRow); //添加上传文件的大小和类型检查 this.Add_FileUploadCheck_Script(); CF.BindYearDDL(ddlYear, 2012, true); CF.BindMonthDDL(ddlMonth, "0"); ddlYear.SelectedValue = Year_2020.Text; ddlMonth.SelectedValue = Month_2020.Text; if (Status_2020.Text == OUStatus.待审核 || Status_2020.Text == OUStatus.通过) { string url = "RG_YueDuCaiWu_Detail.aspx?RowGuid=" + RowGuid + "&DWGuid=" + DWGuid_2020.Text + "&sType=0"; this.WriteAjaxMessage("window.location.href='" + url + "';"); } RefreshGrid(); } }