Exemple #1
0
    /// <summary>
    /// 审批通过
    /// </summary>
    /// <param name="sender"></param>
    /// <param name="e"></param>
    protected void button_shenpi_yes_Click(object sender, ImageClickEventArgs e)
    {
        SABLL     saBLL   = new SABLL(FactoryID);
        CARLogBLL logbll  = new CARLogBLL(FactoryID);
        LogInfo   loginfo = new LogInfo();

        #region data
        if (SP_Step == SP_Total_Step)
        {
            saInfo.STATUS     = 1;
            saInfo.CLOSE_DATE = DateTime.Now;
        }
        saBLL.Update(saInfo);
        #endregion
        #region log
        if (ApprovalTable.Rows.Count >= 1)
        {
            loginfo             = logbll.GetByKey(int.Parse(ApprovalTable.Rows[0]["rkey"].ToString()));
            loginfo.sp_end_date = DateTime.Now;
            loginfo.sp_content  = SP_Content.Text;
            loginfo.status      = 1;
            logbll.UpdateData(loginfo);
            if (ApprovalTable.Rows.Count >= 2)
            {
                loginfo = logbll.GetByKey(int.Parse(ApprovalTable.Rows[1]["rkey"].ToString()));
                loginfo.sp_start_date = DateTime.Now;
                logbll.UpdateData(loginfo);
            }
        }
        #endregion
        #region mail
        string sp_user = "";
        string subject = "";
        string body    = "";
        if (ApprovalTable.Rows.Count == 1)
        {
            if (SP_Step == SP_Total_Step)
            {
                sp_user = saInfo.ENT_USER;
                subject = "不良品确认单,审批通过。";
                string url = System.Configuration.ConfigurationManager.AppSettings["url"].ToString();
                body = url;
            }
            else
            {
                sp_user = ApprovalTable.Rows[1]["sp_user"].ToString();
                subject = "有新的不良品确认单,请审批。";
                string url = System.Configuration.ConfigurationManager.AppSettings["url"].ToString();
                body = url;
            }
            XmlSource.SendEmail(sp_user, subject, body);
        }
        #endregion
        Response.Write("<script language='javaScript'>alert('操作成功');window.opener = null;window.close();</script>");//无提示关闭页面
        button_shenpi_yes.Enabled = false;
        button_shenpi_no.Enabled  = false;
    }
Exemple #2
0
    /// <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
    }
Exemple #3
0
    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);
            }
        }
    }
Exemple #4
0
    protected void Initialize()
    {
        lnk_CSS.Href = Request.Path.Substring(0, Request.Path.LastIndexOf('/')) + "/CSS/GV.css";
        #region 判断用户权限
        if (!HasRight(XmlSource.GetRightIndex("SA")))
        {
            Page.ClientScript.RegisterStartupScript(this.GetType(), "alert", "<script>alert('你没有权限进入此页面!');</script>");
            Response.End();
            return;
        }
        #endregion
        #region 初始化界面
        did = String.IsNullOrEmpty(Request.QueryString["did"]) ? 0 : int.Parse(Request.QueryString["did"]);
        #region gridview3数据绑定
        tb_SA = new CARDataBLL(CurrentFactoryID).GetDataSet("select * from CAR_Table_SAList where sn_ptr = " + did.ToString());
        if (tb_SA.Rows.Count < row_Number)
        {
            for (int i = 0; i < row_Number - tb_SA.Rows.Count;)
            {
                DataRow row = tb_SA.NewRow();
                for (int j = 0; j < tb_SA.Columns.Count; j++)
                {
                    row[j] = DBNull.Value;
                }
                tb_SA.Rows.Add(row);
            }
        }
        GridView3.DataSource = tb_SA;
        GridView3.DataBind();
        #endregion
        if (did > 0)
        {
            saInfo                = new SABLL(CurrentFactoryID).getSAInfoByrkey(did);
            CAR_Content.Text      = Server.HtmlDecode(saInfo.CAR_CONTENT);
            CAR_Content.ActiveTab = CuteEditor.TabType.View;
            if (saInfo.STATUS != 0 && saInfo.STATUS != 14)//审批中或审批完成
            {
                CAR_Content.AutoConfigure = CuteEditor.AutoConfigure.None;
                CAR_Content.ShowBottomBar = false;
            }
            if (saInfo.STATUS == 0 || saInfo.STATUS == 14)   //未审批、未发启或审批拒绝
            {
                div_AppListEdit.Visible = true;
                #region 审批信息
                ApprovalTable = new CARLogBLL(CurrentFactoryID).GetDataSet("select sp_step as 步骤,'' as 审批人,sp_user as 帐号 from CAR_Table_LOG where sn_type = 'SA' and SN_PTR=" + saInfo.RKEY.ToString() + " order by sp_step");
                for (int i = 0; i < ApprovalTable.Rows.Count; i++)
                {
                    ApprovalTable.Rows[i][1] = GetUserName(ApprovalTable.Rows[i][2].ToString());
                }
                GridView1.DataSource = ApprovalTable;
                GridView1.DataBind();
                #endregion
            }
            else                        //已经发送审批,不可更改
            {
                sendApproval.Enabled    = false;
                ibtn_Save.Enabled       = false;
                div_AppListEdit.Visible = false;
            }
            #region 申请信息

            #endregion
        }
        #endregion
        #region 根据权限来控制页面功能
        if (!HasRight(XmlSource.GetRightIndex("EDIT")))
        {
            sendApproval.Enabled = false;
            ibtn_Save.Enabled    = false;
        }
        if (did > 0)
        {
            if (saInfo.ENT_USER != CurrentUser.UserADAcount && !CurrentUser.RightIsAdmin)//如果当前用户不是发启人,就只能查看
            {
                sendApproval.Enabled = false;
                ibtn_Save.Enabled    = false;
            }
        }
        #endregion
        #region 文件路径

        string id = System.Web.HttpContext.Current.User.Identity.Name.Replace("FOUNDERPCB\\", "");

        id = id + @"/" + System.DateTime.Now.Date.ToShortDateString();

        //Response.Write("id" + id);


        //建立用户目录
        string path = Server.MapPath(@"uploads/" + id);

        if (!System.IO.Directory.Exists(path))
        {
            System.IO.Directory.CreateDirectory(path);//在指定路径下新建一个文件夹
        }

        CAR_Content.SetSecurityImageGalleryPath(path);
        CAR_Content.SetSecurityImageGalleryPath(path);
        CAR_Content.SetSecurityMediaGalleryPath(path);
        CAR_Content.SetSecurityFlashGalleryPath(path);
        CAR_Content.SetSecurityFilesGalleryPath(path);

        #endregion
    }