Esempio n. 1
0
        protected void btnAdd_Click(object sender, System.EventArgs e)
        {
            //string RowGuid = Guid.NewGuid().ToString();
            //oAddPage.SaveTableValues(RowGuid, tdContainer, Request.QueryString["ParentRowGuid"]);

            ////如果是父表,要转入多表编辑页面
            //if (oAddPage.TableDetail.TableType == 1)
            //{
            //    Response.Redirect("MultiPageTab.aspx?mode=Mode&TableID=" + oAddPage.TableDetail.TableID + "&RowGuid=" + RowGuid);
            //}
            //else
            //{
            //    this.WriteAjaxMessage ("refreshParent();");
            //}
            //Epoint.MisBizLogic2.Web.CodeGenerator.InitiateControl_AddPage(oAddPage, tdContainer);
            //this.WriteAjaxMessage("EP_ShowMessageDiv(" + tdContainer.ClientID + ",'数据保存成功')");

            string RowGuid = Request["RowGuid"];
            string DWGuid  = Request["DWGuid"];
            //先判断下某个月是否已经提交过
            string strSql = string.Format("select count(*) from RG_OtherInfo where DWGuid='{0}' and Year='{1}' and Month='{2}'", DWGuid, ddlYear.SelectedValue, ddlMonth.SelectedValue);

            if (Epoint.MisBizLogic2.DB.ExecuteToString(strSql) != "0")//说明已经有了
            {
                //进行提示
                WriteAjaxMessage("alert('该月已经存在信息');");
                return;
            }
            Year_2021.Text           = ddlYear.SelectedValue;
            Month_2021.Text          = ddlMonth.SelectedValue;
            YearMonth_2021.Text      = ddlYear.SelectedValue + "-" + ddlMonth.SelectedValue + "-01 00:00:00";
            UpdateUserName_2021.Text = this.DisplayName;
            UpdateUserGuid_2021.Text = this.UserGuid;
            IsHistory_2021.Text      = "0";
            UpdateTime_2021.Text     = DateTime.Now.ToString();
            Status_2021.Text         = EpointRegisterUser_Bizlogic.OUStatus.编辑中;//0:编辑   1:待审核   2:通过
            DWGuid_2021.Text         = DWGuid;
            oAddPage.SaveTableValues(RowGuid, tdContainer, Request.QueryString["ParentRowGuid"]);

            #region 保存附件
            CL_CWBB.MisRowGuid  = DWGuid;
            CL_CWBB.MisTableID  = TableID;
            CL_CWBB.ProjectGuid = "";
            CL_CWBB.Comment     = DWGuid;
            CL_CWBB.d_TiJiaoSJ  = DateTime.Now.ToString();
            CL_CWBB.Save();

            CL_NDSJBG.MisRowGuid  = DWGuid;
            CL_NDSJBG.MisTableID  = TableID;
            CL_NDSJBG.ProjectGuid = "";
            CL_NDSJBG.Comment     = DWGuid;
            CL_NDSJBG.d_TiJiaoSJ  = DateTime.Now.ToString();
            CL_NDSJBG.Save();

            #endregion

            string url = "RG_OtherInfo_Edit.aspx?RowGuid=" + RowGuid + "&DWGuid=" + DWGuid + "&sType=0";
            this.WriteAjaxMessage("alert('添加成功');window.location.href='" + url + "';");
        }
Esempio n. 2
0
        protected void btnEdit_Click(object sender, System.EventArgs e)
        {
            //oEditPage.SaveTableValues(Request["RowGuid"], tdContainer);
            //this.WriteAjaxMessage("refreshParent();");
            //this.WriteAjaxMessage("EP_ShowMessageDiv(" + tdContainer.ClientID + ",'数据保存成功')");
            string RowGuid        = Request["RowGuid"];
            string DWGuid         = Request["DWGuid"];
            string strSql         = "SELECT top(1) EnterpriseName FROM RG_OUInfo WHERE dwGuid='" + DWGuid + "' order by row_ID desc";
            string EnterpriseName = Epoint.MisBizLogic2.DB.ExecuteToString(strSql);

            //先获取投资经理
            strSql = "SELECT s_xiangmujl_guid,s_xiangmujl FROM VIEW_CurrentVersion WHERE dwGuid='" + DWGuid + "'";
            DataView dvUser = Epoint.MisBizLogic2.DB.ExecuteDataView(strSql);

            if (dvUser.Count == 0)
            {
                WriteAjaxMessage("该企业没有对应的项目,请联系系统管理员。");
                return;
            }
            //判断是不是已经有了
            strSql = string.Format("select count(*) from RG_OtherInfo where DWGuid='{0}'", Request["DWGuid"]);
            if (Epoint.MisBizLogic2.DB.ExecuteToString(strSql) == "1")//说明没有
            {
                //提交时直接提交,不用保存版本
                Year_2021.Text           = ddlYear.SelectedValue;
                Month_2021.Text          = ddlMonth.SelectedValue;
                YearMonth_2021.Text      = ddlYear.SelectedValue + "-" + ddlMonth.SelectedValue + "-01 00:00:00";
                UpdateUserName_2021.Text = this.DisplayName;
                UpdateUserGuid_2021.Text = this.UserGuid;
                UpdateTime_2021.Text     = DateTime.Now.ToString();
                Status_2021.Text         = EpointRegisterUser_Bizlogic.OUStatus.待审核;
                IsHistory_2021.Text      = "0";
                oEditPage.SaveTableValues(RowGuid, tdContainer);
            }
            else
            {
                //先将原来的设置为历史记录
                Epoint.MisBizLogic2.Data.MisGuidRow oRow = new Epoint.MisBizLogic2.Data.MisGuidRow(oEditPage.TableDetail.SQL_TableName, Request["RowGuid"]);
                oRow["IsHistory"] = "1";
                //oRow["UpdateUserName"] = this.DisplayName;
                //oRow["UpdateUserGuid"] = this.UserGuid;
                //oRow["UpdateTime"] = DateTime.Now;
                oRow.Update();
                //然后再将本版本进行提交审核
                Year_2021.Text           = ddlYear.SelectedValue;
                Month_2021.Text          = ddlMonth.SelectedValue;
                YearMonth_2021.Text      = ddlYear.SelectedValue + "-" + ddlMonth.SelectedValue + "-01 00:00:00";
                UpdateUserName_2021.Text = this.DisplayName;
                UpdateUserGuid_2021.Text = this.UserGuid;
                UpdateTime_2021.Text     = DateTime.Now.ToString();
                Status_2021.Text         = EpointRegisterUser_Bizlogic.OUStatus.待审核;
                IsHistory_2021.Text      = "0";
                RowGuid = Guid.NewGuid().ToString();
                oAddPage.SaveTableValues(RowGuid, tdContainer, Request.QueryString["ParentRowGuid"]);
            }

            #region 保存附件
            CL_CWBB.MisRowGuid  = DWGuid;
            CL_CWBB.MisTableID  = TableID;
            CL_CWBB.ProjectGuid = "";
            CL_CWBB.Comment     = DWGuid;
            CL_CWBB.d_TiJiaoSJ  = DateTime.Now.ToString();
            CL_CWBB.Save();

            CL_NDSJBG.MisRowGuid  = DWGuid;
            CL_NDSJBG.MisTableID  = TableID;
            CL_NDSJBG.ProjectGuid = "";
            CL_NDSJBG.Comment     = DWGuid;
            CL_NDSJBG.d_TiJiaoSJ  = DateTime.Now.ToString();
            CL_NDSJBG.Save();

            #endregion


            #region 通知投资经理

            for (int m = 0; m < dvUser.Count; m++)
            {
                msg.WaitHandle_Insert(
                    Guid.NewGuid().ToString(),
                    "【审核】" + EnterpriseName + "其他重要财务数据",
                    "",
                    dvUser[m]["s_xiangmujl_guid"].ToString(),
                    dvUser[m]["s_xiangmujl"].ToString(),
                    Session["UserGuid"].ToString(),
                    Session["DisplayName"].ToString(),
                    "",
                    "EpointRegisterUser/Pages_RG/RG_Other/RG_OtherInfo_DetailForCheck.aspx?RowGuid=" + RowGuid + "&DWGuid=" + DWGuid,
                    "",
                    "",
                    1,
                    "",
                    "",
                    ""
                    );
            }

            #endregion

            //this.WriteAjaxMessage("refreshParent();");
            //this.WriteAjaxMessage("EP_ShowMessageDiv(" + tdContainer.ClientID + ",'数据保存成功')");
            this.WriteAjaxMessage("alert('提交成功');");
            RefreshGrid();

            btnEdit.Visible = false;
        }