コード例 #1
0
ファイル: SA_New.aspx.cs プロジェクト: JackChen2017/CAR
    /// <summary>
    /// 将信息写入库
    /// </summary>
    private int Writedata(int status)
    {
        SABLL  saBLL = new SABLL(CurrentFactoryID);
        SAInfo sa    = new SAInfo();

        if (did == 0)
        {
            sa.RKEY     = 0;
            sa.SERIALNO = saBLL.GetSerialNo();
        }
        else
        {
            sa = saBLL.getSAInfoByrkey(did);
            if (sa.STATUS == 14)
            {
                string temp = sa.SERIALNO;
                sa          = new SAInfo();
                sa.RKEY     = did;
                sa.SERIALNO = temp;
            }
        }
        #region 赋值
        sa.ENT_DATE    = DateTime.Now;
        sa.ENT_USER    = CurrentUser.UserADAcount;
        sa.CAR_CONTENT = CAR_Content.Text;
        sa.STATUS      = status;
        #endregion
        #region 保存
        int a = 0;
        if (did == 0)
        {
            a = saBLL.add(sa);
        }
        else
        {
            a = saBLL.Update(sa);
        }
        if (a != 0)
        {
            return(-1);
        }
        return(int.Parse(sa.RKEY.ToString()));

        #endregion
    }
コード例 #2
0
ファイル: SA_View.aspx.cs プロジェクト: JackChen2017/CAR
    protected void Page_Load(object sender, EventArgs e)
    {
        if (!IsPostBack)
        {
            FactoryID = String.IsNullOrEmpty(Request.QueryString["FID"]) ? 98 : int.Parse(Request.QueryString["FID"]);
            did       = String.IsNullOrEmpty(Request.QueryString["did"]) ? 0 : int.Parse(Request.QueryString["did"]);
            type      = String.IsNullOrEmpty(Request.QueryString["type"]) ? "view" : Request.QueryString["type"];
            try
            {
                this.UserAD = CurrentUser.UserADAcount;
            }
            catch
            {
                Page.ClientScript.RegisterStartupScript(this.GetType(), "alert", "<script>alert('用户AD丢失!');</script>");
                Response.End();
            }

            SABLL saBLL = new SABLL(FactoryID);
            saInfo = saBLL.getSAInfoByrkey(did);

            if (type == "view")
            {
                if (!HasRight(XmlSource.GetRightIndex("VIEW")) || !HasRight(XmlSource.GetRightIndex("SA")))
                {
                    Page.ClientScript.RegisterStartupScript(this.GetType(), "alert", "<script>alert('您没有查看此页面的权限!');</script>");
                    Response.End();
                }
                div_sp.Visible = false;
                InitPage(saInfo);
            }
            else if (type == "approval")
            {
                Check();
                InitPage(saInfo);
            }
        }
    }