Beispiel #1
0
    private void XS()
    {
        str        = new StringBuilder();
        lblxs.Text = "";
        str.Append("<table width=\"100%\">");   //定义表开始
        string strSOrdNet = "select Order_ID,Title,Net,Type,Content,Unit,Man,Time,Adjunct,Personnel,Net_Guid from" +
                            " SOrdNet where Order_ID = '" + ViewState["Order_ID"].ToString() + "'";
        DataRow SOrdNetRow = db.GetDataRow(strSOrdNet);

        str.Append(" <tr> <td colspan=\"4\" align=\"center\">   警卫局网站信息报送审批表 </td> </tr>" +
                   "<tr> <td  align=\"center\" style=\"width: 25%\"> 勤务编号</td> <td colspan=\"3\"> " +
                   SOrdNetRow[0].ToString().Trim() + "</td></tr> " +
                   "<tr><td  align=\"center\" style=\"width: 25%\"> 信息标题</td><td colspan=\"3\"> " +
                   SOrdNetRow[1].ToString().Trim() + "</td></tr> " +
                   "<tr><td  align=\"center\" style=\"width: 25%\">拟发网站</td><td  align=\"center\" style=\"width: 25%\"> " +
                   SOrdNetRow[2].ToString().Trim() + "</td> <td  align=\"center\" style=\"width: 25%\">栏目</td>" +
                   SOrdNetRow[3].ToString().Trim() + "</td> </tr>" +
                   "<tr><td colspan=\"4\" align=\"center\">内容</td></tr>" +
                   "<tr><td colspan=\"4\" align=\"center\"> " +
                   SOrdNetRow[4].ToString().Trim() + "</td> </tr> " +
                   "<tr> <td align=\"center\">附件:</td><td colspan=\"3\"> ");
        str.Append("<iframe  style=\"overflow: auto; border-top-style: none; border-right-style: none; border-left-style: none; border-bottom-style: none; width: 550px; height: 120px;\"   src = \"Abjunct.aspx?AttachmentBatch_Guid='" + SOrdNetRow[8].ToString().Trim() + "'\"></iframe>");

        str.Append("</td></tr> " +
                   "<tr> <td align=\"center\">承办单位</td>" +
                   "<td>" + SOrdNetRow[5].ToString().Trim() + "</td>" +
                   "<td>拟稿人</td> <td style=\"width: 189px\">" +
                   SOrdNetRow[6].ToString().Trim() + "</td> </tr>" +
                   "<tr> <td align=\"center\">拟稿时间</td>" +
                   "<td>" + SOrdNetRow[7].ToString().Trim() + "</td> " +
                   "<td>  部门拟稿</td> <td style=\"width: 189px\">" +
                   SOrdNetRow[9].ToString().Trim() + "</td></tr> ");


        string    strSOrdNetAuditing   = "select OrderNotion,PerNumber from SOrdNetAuditing where Net_Guid = '" + SOrdNetRow[10].ToString().Trim() + "' and StatusId <> '1'";
        DataTable SOrdNetAuditingtable = db.GetDataTable(strSOrdNetAuditing);

        for (int i = 0; i < SOrdNetAuditingtable.Rows.Count; i++)
        {
            str.Append(" <tr> <td align=\"center\" style=\"width=25%; height: 51px;\">领导意见</td> " +
                       "  <td align=\"left\" style=\"width=75%; height: 51px;\"> " +
                       SOrdNetAuditingtable.Rows[i][0].ToString() + "</td></tr> " +
                       "<tr> <td style=\"height: 4px\"></td> " +
                       "<td align=\"right\" style=\"width=75%; height: 4px;\"> " +
                       SOrdNetAuditingtable.Rows[i][1].ToString() + "</td> </tr>");
        }

        str.Append("</table>");
        lblxs.Text = str.ToString();
    }
Beispiel #2
0
    //查询考试人员信息方法
    private void selectExamStaff()
    {
        string  sql = "select a.Exam_Id,a.ExamName,b.Staff_Id,b.StartTime,b.EndTime,b.RightCount,b.WrongCount,b.UnfinishCount,b.Score,a.Average,b.Gradation from SExmExam a,SExmScore b where a.Exam_Id=b.Exam_Id and b.Score_Guid ='" + ViewState["ScoreGuid"] + "'";
        DataRow drQuestion;

        db = new MDataBase(config.DBConn);
        bool blnRtnCode = db.GetDataRow(sql, out drQuestion);

        if (blnRtnCode == false || drQuestion == null)
        {
            //错误
            return;
        }
        //赋值
        this.lblExamId.Text        = HttpUtility.HtmlDecode(drQuestion["Exam_Id"].ToString());
        this.lblExamName.Text      = HttpUtility.HtmlDecode(drQuestion["ExamName"].ToString());
        this.lblstaff.Text         = HttpUtility.HtmlDecode(drQuestion["Staff_Id"].ToString());
        this.lblStartTime.Text     = HttpUtility.HtmlDecode(drQuestion["StartTime"].ToString());
        this.lblEndTime.Text       = HttpUtility.HtmlDecode(drQuestion["EndTime"].ToString());
        this.lblRightCount.Text    = HttpUtility.HtmlDecode(drQuestion["RightCount"].ToString());
        this.lblWrongCount.Text    = HttpUtility.HtmlDecode(drQuestion["WrongCount"].ToString());
        this.lblUnfinishCount.Text = HttpUtility.HtmlDecode(drQuestion["UnfinishCount"].ToString());
        this.lblScore.Text         = HttpUtility.HtmlDecode(drQuestion["Score"].ToString());
        this.lblAverage.Text       = HttpUtility.HtmlDecode(drQuestion["Average"].ToString());
        this.lblGradation.Text     = HttpUtility.HtmlDecode(drQuestion["Gradation"].ToString());
    }
Beispiel #3
0
    //查询考试信息方法
    private void selectExam()
    {
        string  sql = "select Exam_Id,ExamName,ScoreType,StartTime,EndTime,Times,Count,ExamEmploees,CreatedBy,CreatedDate,ModifiedBy,ModifiedDate from SExmExam where Exam_Id ='" + ViewState["ExamId"].ToString() + "'";
        DataRow drQuestion;

        db = new MDataBase(config.DBConn);
        bool blnRtnCode = db.GetDataRow(sql, out drQuestion);

        if (blnRtnCode == false || drQuestion == null)
        {
            //错误
            return;
        }
        //赋值
        this.lblExamId.Text        = HttpUtility.HtmlDecode(drQuestion["Exam_Id"].ToString());
        this.lblExamName.Text      = HttpUtility.HtmlDecode(drQuestion["ExamName"].ToString());
        this.lblScoreType.Text     = HttpUtility.HtmlDecode(drQuestion["ScoreType"].ToString());
        this.lblStartTime.Text     = drQuestion["StartTime"].ToString();
        this.lblEndTime.Text       = drQuestion["EndTime"].ToString();
        this.lblTimes.Text         = drQuestion["Times"].ToString();
        this.lblCount.Text         = HttpUtility.HtmlDecode(drQuestion["Count"].ToString());
        this.lblEmploeesCount.Text = HttpUtility.HtmlDecode(drQuestion["ExamEmploees"].ToString());
        this.lblExamEmploees.Text  = HttpUtility.HtmlDecode(drQuestion["ExamEmploees"].ToString());
        this.lblRatio.Text         = Convert.ToString(Convert.ToSingle(lblExamEmploees.Text) * 100 / Convert.ToSingle(lblEmploeesCount.Text)) + "%";
        this.lblCreatedBy.Text     = HttpUtility.HtmlDecode(drQuestion["CreatedBy"].ToString());
        this.lblCreatedDate.Text   = HttpUtility.HtmlDecode(drQuestion["CreatedDate"].ToString());
        this.lblModifiedBy.Text    = HttpUtility.HtmlDecode(drQuestion["ModifiedBy"].ToString());
        this.lblModifiedDate.Text  = HttpUtility.HtmlDecode(drQuestion["ModifiedDate"].ToString());
    }
Beispiel #4
0
    //查询考试结束时间
    private void selectTime()
    {
        string  sql = "select BeginTime from SExmExam where Exam_Id='" + hfdGv.Value + "'";
        DataRow drQuestion;

        db = new MDataBase(config.DBConn);
        bool blnRtnCode = db.GetDataRow(sql, out drQuestion);

        if (blnRtnCode == false || drQuestion == null)
        {
            // 错误
            return;
        }
        //取系统时间
        DateTime dtNow = DateTime.Now;

        //如果系统时间大于考试开始时间,不给修改试卷
        if (DateTime.Compare(dtNow, Convert.ToDateTime(drQuestion["BeginTime"])) > 0)
        {
            Response.Write("<script type='text/javascript'>alert('考试已经开始!');window.location.href=window.location.href;</script>");
        }
        else
        {
            Server.Transfer("ExmCreate.aspx?Id=2" + hfdGv.Value);
        }
    }
Beispiel #5
0
    protected void Page_Load(object sender, EventArgs e)
    {
        if (!this.IsPostBack)
        {
            txtCreatedBy.Text = "";  //从登录得到用户名

            txtCreatedBy.Enabled = false;

            ControlDataBind drp = new ControlDataBind(ConfigurationManager.ConnectionStrings["OA"].ToString());
            drp.DropDownListBind(drpGuardSpec, "SOrdSpec", "SpecName", "SpecID", 1, "", txtCreatedBy.Text.Trim());
            drp.DropDownListBind(drpOrder_ID, "SOrdEstate", "Order_ID", "Order_ID", 4, "StatusId = 4", txtCreatedBy.Text.Trim());     //完结状态的勤务
            lblEnregisterTime.Text = System.DateTime.Now.Year.ToString() + "-" + System.DateTime.Now.Month.ToString() +
                                     "-" + System.DateTime.Now.Day.ToString();                                                        //得到当前的时间

            if (Request.QueryString["Order_ID"] == null || Request.QueryString["Order_ID"].ToString() == "")                          //勤务编号
            {
                ViewState["State"] = "Insert";
            }
            else
            {
                //  string Order_ID = Request.QueryString["Order_ID"].ToString();
                string Order_ID = "200842001";
                ViewState["Order_ID"] = Order_ID;
                ViewState["State"]    = "Update";
                string selectSql = " SELECT [Order_ID],[EnregisterTime],[GuardSpec],[MoveDate],[MoveTomeFrom],[MoveTomeTo],[FrontUnit]," +
                                   "[AppearedFugle],[CalendarArrange],[Principal],[Roster],[Remark],[Perform],[CreatedBy],[CreatedDate],[ModifiedBy],[ModifiedDate],[StatusId] " +
                                   " FROM SOrdSynodBenregister where Order_ID = '" + Order_ID + "'";
                DataRow selectRow = db.GetDataRow(selectSql);
                ViewState["Order_ID"]     = selectRow[0];
                drpOrder_ID.SelectedValue = selectRow[0].ToString();   //勤务编号
                drpOrder_ID.Enabled       = false;

                this.lblEnregisterTime.Text = selectRow[1].ToString(); //登记时间
                drpGuardSpec.SelectedValue  = selectRow[2].ToString(); ///警卫规格


                txtMoveDate.Text = selectRow[3].ToString();                          ///活动天数

                txtMoveTomeFrom1.Text          = GetDate(selectRow[4].ToString());   //得到日期
                drpMoveTomeFrom2.SelectedValue = GetHour(selectRow[4].ToString());   //时
                txtMoveTomeFrom3.Text          = GetMinute(selectRow[4].ToString()); //分

                txtMoveTomeTo1.Text          = GetDate(selectRow[5].ToString());     //得到日期
                drpMoveTomeTo2.SelectedValue = GetHour(selectRow[5].ToString());     //时
                txtMoveTomeTo3.Text          = GetMinute(selectRow[5].ToString());   //分


                txtFrontUnit.Text       = selectRow[6].ToString(); //主办单位
                txtAppearedFugle.Text   = selectRow[7].ToString(); //  省陪同领导:
                txtCalendarArrange.Text = selectRow[8].ToString(); // 活动日程:


                txtPrincipal.Text = selectRow[9].ToString();  // 负责人:
                txtRoster.Text    = selectRow[10].ToString(); //      值勤人员:
                txtPerform.Text   = selectRow[12].ToString(); //  情况

                txtRemark.Text = selectRow[11].ToString();    //  备注
            }
        }
    }
 public DataRow GetInfoDataRow(string KBaseTreeGuid, string SessionID)
 {
     try
     {
         sql = KnowledgeSql.GetInfoFGuidSql(KBaseTreeGuid);
         DataRow dataRow = db.GetDataRow(sql);
         return(dataRow);
     }
     catch (Exception Err)
     {
         ErrorLog.LogInsert(Err.Message, "CS/KnowledgeBase/KnowledgeMaintenanceRule", SessionID);
         return(null);
     }
 }
Beispiel #7
0
    //赋值
    private void GetQuestionInfo()
    {
        string  sql = "select a.Question,a.QuestionType_Id,b.QuestionTypeName,a.Answer,a.AnswerA,a.AnswerB,a.AnswerC,a.AnswerD,a.AnswerE from SExmQuestion a,SC_QuestionType b where a.QuestionType_Id=b.QuestionType_Id and a.Question_Guid = '" + ViewState["Question_Guid"].ToString() + "'";
        DataRow drQuestion;

        db = new MDataBase(config.DBConn);
        bool blnRtnCode = db.GetDataRow(sql, out drQuestion);

        if (blnRtnCode == false || drQuestion == null)
        {
            // 错误
            return;
        }
        this.txtQuestionChange.Text = HttpUtility.HtmlDecode(drQuestion["Question"].ToString());
        this.sltQuestionTypeId.Text = HttpUtility.HtmlDecode(drQuestion["QuestionType_Id"].ToString());
        this.lblAnswer.Text         = drQuestion["Answer"].ToString();
        //如果答案里包括A,ckbAnswerA钩上
        if (lblAnswer.Text.IndexOf("A") != -1)
        {
            ckbAnswerA.Checked = true;
        }
        //如果答案里包括B,ckbAnswerB钩上
        if (lblAnswer.Text.IndexOf("B") != -1)
        {
            ckbAnswerB.Checked = true;
        }
        //如果答案里包括C,ckbAnswerC钩上
        if (lblAnswer.Text.IndexOf("C") != -1)
        {
            ckbAnswerC.Checked = true;
        }
        //如果答案里包括D,ckbAnswerD钩上
        if (lblAnswer.Text.IndexOf("D") != -1)
        {
            ckbAnswerD.Checked = true;
        }
        //如果答案里包括E,ckbAnswerE钩上
        if (lblAnswer.Text.IndexOf("E") != -1)
        {
            ckbAnswerE.Checked = true;
        }
        this.txtAnswerA.Text = HttpUtility.HtmlDecode(drQuestion["AnswerA"].ToString());
        this.txtAnswerB.Text = HttpUtility.HtmlDecode(drQuestion["AnswerB"].ToString());
        this.txtAnswerC.Text = HttpUtility.HtmlDecode(drQuestion["AnswerC"].ToString());
        this.txtAnswerD.Text = HttpUtility.HtmlDecode(drQuestion["AnswerD"].ToString());
        this.txtAnswerE.Text = HttpUtility.HtmlDecode(drQuestion["AnswerE"].ToString());
    }
Beispiel #8
0
 //查询考试表
 private void ExmExam()
 {
     string sql = "select Count,ExamName,Times from SExmExam where Exam_Id = '" + Session["Guid"] + "'";
     DataRow drQuestion;
     db = new MDataBase(config.DBConn);
     bool blnRtnCode = db.GetDataRow(sql, out drQuestion);
     if (blnRtnCode == false || drQuestion == null)
     {
         //错误
         return;
     }
     //赋值
     this.lblExamCount.Text = "已生成试卷,共" + drQuestion["Count"].ToString() + "条题目";
     this.lblQuestionCount.Text = "共" + drQuestion["Count"].ToString() + "题,现在是第" + lblQuestionId.Text + "题";
     this.hfdTimes.Value = drQuestion["Times"].ToString();
     ViewState["Count"] = drQuestion["Count"];
 }
Beispiel #9
0
 //试题加载
 private void selectExmQuestion()
 {
     string sql = "select a.Question_Id,a.Question,a.Question_Guid,b.AnswerA,b.AnswerB,b.AnswerC,b.AnswerD,b.AnswerE,a.Answer from temp" + config.Staff.Username + " a,SExmQuestion b where a.Question_Guid=b.Question_Guid and a.Question_Id='1'";
     DataRow drQuestion;
     db = new MDataBase(config.DBConn);
     bool blnRtnCode = db.GetDataRow(sql, out drQuestion);
     if (blnRtnCode == false || drQuestion == null)
     {
         //错误
         return;
     }
     //赋值
     this.lblQuestionId.Text = drQuestion["Question_Id"].ToString();
     this.lblQuestion.Text = drQuestion["Question"].ToString();
     this.lblAnwerA.Text = drQuestion["AnswerA"].ToString();
     this.lblAnwerB.Text = drQuestion["AnswerB"].ToString();
     this.lblAnwerC.Text = drQuestion["AnswerC"].ToString();
     hfdQuestionGuid.Value = drQuestion["Question_Guid"].ToString();
     //如果D答案为空,选项框隐藏
     if (drQuestion["AnswerD"].ToString() != "")
     {
         chkAnswerD.Visible = true;
         this.lblAnwerD.Text = drQuestion["AnswerD"].ToString();
     }
     else
     {
         chkAnswerD.Visible = false;
     }
     //如果E答案为空,选项框隐藏
     if (drQuestion["AnswerE"].ToString() != "")
     {
         chkAnswerE.Visible = true;
         this.lblAnwerE.Text = drQuestion["AnswerE"].ToString();
     }
     else
     {
         chkAnswerE.Visible = false;
     }
     //装载默认为第1题,隐藏第一题和上一题按钮
     btnFrist.Visible = false;
     btnprev.Visible = false;
 }
Beispiel #10
0
    protected void Page_Load(object sender, EventArgs e)
    {
        if (!this.IsPostBack)
        {
            ControlDataBind drp       = new ControlDataBind(ConfigurationManager.ConnectionStrings["OA"].ToString());
            string          CreatedBy = "";
            drp.DropDownListBind(drpOrder_ID, "SOrdEstate", "Order_ID", "Order_ID", 4, "StatusId = 4", CreatedBy);     //完结状态的勤务

            if (Request.QueryString["Order_ID"] == null || Request.QueryString["Order_ID"].ToString() == "")           //勤务编号
            {
                ViewState["State"] = "Insert";
            }
            else
            {
                ViewState["State"] = "Update";
                //   string Order_ID = Request.QueryString["Order_ID"].ToString();
                string Order_ID = "200842001";
                ViewState["Order_ID"]     = Order_ID;
                drpOrder_ID.SelectedValue = Order_ID;
                drpOrder_ID.Enabled       = false;
                string Strselect = "SELECT [NJGuard],[XVGuard],[WXGuard],[CZGuard],[SZGuard],[NTGuard],[LYGGuard],[HAGuard],[ZJGuard],[TZGuard],[SQGuard],[YCGuard],[YZGuard],[Remark]" +
                                   " FROM SOrdSummarize where Order_ID = '" + ViewState["Order_ID"].ToString() + "'";

                DataRow row = db.GetDataRow(Strselect);
                SetCheck(row[0].ToString(), Chknj1, Chknj2, Chknj3, Chknj4, Chknj5, Chknj6, Chknj7, Chknj8, Chknj9, Chknj10, Chknj11, Chknj12);
                SetCheck(row[1].ToString(), Chkxz1, Chkxz2, Chkxz3, Chkxz4, Chkxz5, Chkxz6, Chkxz7, Chkxz8, Chkxz9, Chkxz10, Chkxz11, Chkxz12);
                SetCheck(row[2].ToString(), Chkwx1, Chkwx2, Chkwx3, Chkwx4, Chkwx5, Chkwx6, Chkwx7, Chkwx8, Chkwx9, Chkwx10, Chkwx11, Chkwx12);
                SetCheck(row[3].ToString(), Chkcz1, Chkcz2, Chkcz3, Chkcz4, Chkcz5, Chkcz6, Chkcz7, Chkcz8, Chkcz9, Chkcz10, Chkcz11, Chkcz12);
                SetCheck(row[4].ToString(), Chksz1, Chksz2, Chksz3, Chksz4, Chksz5, Chksz6, Chksz7, Chksz8, Chksz9, Chksz10, Chksz11, Chksz12);
                SetCheck(row[5].ToString(), Chknt1, Chknt2, Chknt3, Chknt4, Chknt5, Chknt6, Chknt7, Chknt8, Chknt9, Chknt10, Chknt11, Chknt12);
                SetCheck(row[6].ToString(), Chklyg1, Chklyg2, Chklyg3, Chklyg4, Chklyg5, Chklyg6, Chklyg7, Chklyg8, Chklyg9, Chklyg10, Chklyg11, Chklyg12);
                SetCheck(row[7].ToString(), Chkha1, Chkha2, Chkha3, Chkha4, Chkha5, Chkha6, Chkha7, Chkha8, Chkha9, Chkha10, Chkha11, Chkha12);
                SetCheck(row[8].ToString(), Chkzj1, Chkzj2, Chkzj3, Chkzj4, Chkzj5, Chkzj6, Chkzj7, Chkzj8, Chkzj9, Chkzj10, Chkzj11, Chkzj12);
                SetCheck(row[9].ToString(), Chktz1, Chktz2, Chktz3, Chktz4, Chktz5, Chktz6, Chktz7, Chktz8, Chktz9, Chktz10, Chktz11, Chktz12);
                SetCheck(row[10].ToString(), Chksq1, Chksq2, Chksq3, Chksq4, Chksq5, Chksq6, Chksq7, Chksq8, Chksq9, Chksq10, Chksq11, Chksq12);
                SetCheck(row[11].ToString(), Chkyc1, Chkyc2, Chkyc3, Chkyc4, Chkyc5, Chkyc6, Chkyc7, Chkyc8, Chkyc9, Chkyc10, Chkyc11, Chkyc12);
                SetCheck(row[12].ToString(), Chkyz1, Chkyz2, Chkyz3, Chkyz4, Chkyz5, Chkyz6, Chkyz7, Chkyz8, Chkyz9, Chkyz10, Chkyz11, Chkyz12);

                TextBox1.Text = row[13].ToString();
            }
        }
    }
Beispiel #11
0
    //查询考试信息方法
    private void selectExam()
    {
        string  sql = "select a.ExamName,b.Staff_Id,b.QuestionTypeIdOne,b.QuestionTypeIdTwo,b.QuestionTypeIdThree,b.QuestionTypeIdFour,b.QuestionTypeIdFive,b.QuestionTypeIdSix,b.OneCount,b.TwoCount,b.ThreeCount,b.FourCount,b.FiveCount,b.SixCount,a.ScoreType,a.StartTime,a.EndTime,a.Times,a.Count from SExmExam a,tmp" + ViewState["ExamId"] + " b where a.Exam_Id=b.Exam_Id and a.Exam_Id='" + ViewState["ExamId"] + "'";
        DataRow drQuestion;

        db = new MDataBase(config.DBConn);
        bool blnRtnCode = db.GetDataRow(sql, out drQuestion);

        if (blnRtnCode == false || drQuestion == null)
        {
            //错误
            return;
        }
        //赋值
        this.txtExamName.Text = HttpUtility.HtmlDecode(drQuestion["ExamName"].ToString());
        this.txtStaff.Text    = HttpUtility.HtmlDecode(drQuestion["Staff_Id"].ToString());
        if (drQuestion["ScoreType"].ToString() == "0")
        {
            sltScoreType.Text = "当时评分";
        }
        else
        {
            sltScoreType.Text = "统一评分";
        }
        this.sltQuestionTypeIdOne.Text   = drQuestion["QuestionTypeIdOne"].ToString();
        this.sltQuestionTypeIdTwo.Text   = drQuestion["QuestionTypeIdTwo"].ToString();
        this.sltQuestionTypeIdThree.Text = drQuestion["QuestionTypeIdThree"].ToString();
        this.sltQuestionTypeIdFour.Text  = drQuestion["QuestionTypeIdFour"].ToString();
        this.sltQuestionTypeIdFive.Text  = drQuestion["QuestionTypeIdFive"].ToString();
        this.sltQuestionTypeIdSix.Text   = drQuestion["QuestionTypeIdSix"].ToString();
        this.txtPercentageOne.Text       = drQuestion["OneCount"].ToString();
        this.txtPercentageTwo.Text       = drQuestion["TwoCount"].ToString();
        this.txtPercentageThree.Text     = drQuestion["ThreeCount"].ToString();
        this.txtPercentageFour.Text      = drQuestion["FourCount"].ToString();
        this.txtPercentageFive.Text      = drQuestion["FiveCount"].ToString();
        this.txtPercentageSix.Text       = drQuestion["SixCount"].ToString();
        this.txtTimeStart.Text           = drQuestion["StartTime"].ToString();
        this.txtTimeEnd.Text             = drQuestion["EndTime"].ToString();
        this.txtQuestionCount.Text       = drQuestion["Count"].ToString();
        this.txtQuestionTime.Text        = drQuestion["Times"].ToString();
    }
Beispiel #12
0
 //检索答案与答题者填写对比,未填GV保存0,正确GV保存1,错误GV保存2
 private void selectAnswer(string Answer)
 {
     string sql = "select Answer from SExmQuestion where Question_Guid ='" + hfdQuestionGuid.Value + "'";
     DataRow drQuestion;
     db = new MDataBase(config.DBConn);
     bool blnRtnCode = db.GetDataRow(sql, out drQuestion);
     if (blnRtnCode == false || drQuestion == null)
     {
         //错误
         return;
     }
     //如果答案正确,GV保存为1
     if (Answer == drQuestion["Answer"].ToString())
     {
         hfdState.Value = "1";
     }
     //如果答案错误,GV保存为2
     else
     {
         hfdState.Value = "2";
     }
 }
Beispiel #13
0
    /// <summary>
    /// SSysStaffProjectRole对象GetInfo方法
    /// </summary>
    private bool executeGetInfo()
    {
        bool   blnFirstField = true;
        string sql           = "select * from SSysStaffProjectRole";

        // (Staff_Id)字段
        if (_blnStaff_IdChanged == true)
        {
            if (blnFirstField == true)
            {
                blnFirstField = false;
                sql          += " WHERE ";
            }
            else
            {
                sql += " AND ";
            }
            sql += "Staff_Id = '" + _Staff_Id + "'";
        }
        // (Project_Id)字段
        if (_blnProject_IdChanged == true)
        {
            if (blnFirstField == true)
            {
                blnFirstField = false;
                sql          += " WHERE ";
            }
            else
            {
                sql += " AND ";
            }
            sql += "Project_Id = '" + _Project_Id + "'";
        }
        // (Role_Id)字段
        if (_blnRole_IdChanged == true)
        {
            if (blnFirstField == true)
            {
                blnFirstField = false;
                sql          += " WHERE ";
            }
            else
            {
                sql += " AND ";
            }
            sql += "Role_Id = '" + _Role_Id + "'";
        }
        // (IsDefault)字段
        if (_blnIsDefaultChanged == true)
        {
            if (blnFirstField == true)
            {
                blnFirstField = false;
                sql          += " WHERE ";
            }
            else
            {
                sql += " AND ";
            }
            sql += "IsDefault = " + _IsDefault.ToString();
        }

        try
        {
            MDataBase db = new MDataBase(_DBConn);
            DataRow   dr;
            bool      blnReturnCode = db.GetDataRow(sql, out dr);
            if (blnReturnCode == false || dr == null)
            {
                return(false);
            }

            // 对属性赋值
            try
            {
                _Staff_Id = dr["Staff_Id"].ToString();
            }
            catch (Exception err)
            { }
            try
            {
                _Project_Id = dr["Project_Id"].ToString();
            }
            catch (Exception err)
            { }
            try
            {
                _Role_Id = dr["Role_Id"].ToString();
            }
            catch (Exception err)
            { }
            try
            {
                _IsDefault = Convert.ToInt32(dr["IsDefault"]);
            }
            catch (Exception err)
            { }

            return(true);
        }
        catch (Exception err)
        {
            throw;
            return(false);
        }
    }
Beispiel #14
0
    /// <summary>
    /// SExmExam对象GetInfo方法
    /// </summary>
    private bool executeGetInfo()
    {
        bool   blnFirstField = true;
        string sql           = "select * from SExmExam";

        // (Exam_Id)字段
        if (_blnExam_IdChanged == true)
        {
            if (blnFirstField == true)
            {
                blnFirstField = false;
                sql          += " WHERE ";
            }
            else
            {
                sql += " AND ";
            }
            sql += "Exam_Id = '" + _Exam_Id + "'";
        }
        // (ExamName)字段
        if (_blnExamNameChanged == true)
        {
            if (blnFirstField == true)
            {
                blnFirstField = false;
                sql          += " WHERE ";
            }
            else
            {
                sql += " AND ";
            }
            sql += "ExamName = '" + _ExamName + "'";
        }
        // (ScoreType)字段
        if (_blnScoreTypeChanged == true)
        {
            if (blnFirstField == true)
            {
                blnFirstField = false;
                sql          += " WHERE ";
            }
            else
            {
                sql += " AND ";
            }
            sql += "ScoreType = " + _ScoreType.ToString();
        }
        // (BeginTime)字段
        if (_blnBeginTimeChanged == true)
        {
            if (blnFirstField == true)
            {
                blnFirstField = false;
                sql          += " WHERE ";
            }
            else
            {
                sql += " AND ";
            }
            sql += "BeginTime = '" + _BeginTime.ToString() + "'";
        }
        // (EndTime)字段
        if (_blnEndTimeChanged == true)
        {
            if (blnFirstField == true)
            {
                blnFirstField = false;
                sql          += " WHERE ";
            }
            else
            {
                sql += " AND ";
            }
            sql += "EndTime = '" + _EndTime.ToString() + "'";
        }
        // (Times)字段
        if (_blnTimesChanged == true)
        {
            if (blnFirstField == true)
            {
                blnFirstField = false;
                sql          += " WHERE ";
            }
            else
            {
                sql += " AND ";
            }
            sql += "Times = " + _Times.ToString();
        }
        // (Count)字段
        if (_blnCountChanged == true)
        {
            if (blnFirstField == true)
            {
                blnFirstField = false;
                sql          += " WHERE ";
            }
            else
            {
                sql += " AND ";
            }
            sql += "Count = " + _Count.ToString();
        }
        // (ExamEmploees)字段
        if (_blnExamEmploeesChanged == true)
        {
            if (blnFirstField == true)
            {
                blnFirstField = false;
                sql          += " WHERE ";
            }
            else
            {
                sql += " AND ";
            }
            sql += "ExamEmploees = " + _ExamEmploees.ToString();
        }
        // (Average)字段
        if (_blnAverageChanged == true)
        {
            if (blnFirstField == true)
            {
                blnFirstField = false;
                sql          += " WHERE ";
            }
            else
            {
                sql += " AND ";
            }
            sql += "Average = " + _Average.ToString();
        }
        // (CreatedBy)字段
        if (_blnCreatedByChanged == true)
        {
            if (blnFirstField == true)
            {
                blnFirstField = false;
                sql          += " WHERE ";
            }
            else
            {
                sql += " AND ";
            }
            sql += "CreatedBy = '" + _CreatedBy + "'";
        }
        // (CreatedDate)字段
        if (_blnCreatedDateChanged == true)
        {
            if (blnFirstField == true)
            {
                blnFirstField = false;
                sql          += " WHERE ";
            }
            else
            {
                sql += " AND ";
            }
            sql += "CreatedDate = '" + _CreatedDate.ToString() + "'";
        }
        // (ModifiedBy)字段
        if (_blnModifiedByChanged == true)
        {
            if (blnFirstField == true)
            {
                blnFirstField = false;
                sql          += " WHERE ";
            }
            else
            {
                sql += " AND ";
            }
            sql += "ModifiedBy = '" + _ModifiedBy + "'";
        }
        // (ModifiedDate)字段
        if (_blnModifiedDateChanged == true)
        {
            if (blnFirstField == true)
            {
                blnFirstField = false;
                sql          += " WHERE ";
            }
            else
            {
                sql += " AND ";
            }
            sql += "ModifiedDate = '" + _ModifiedDate.ToString() + "'";
        }
        // (StatusId)字段
        if (_blnStatusIdChanged == true)
        {
            if (blnFirstField == true)
            {
                blnFirstField = false;
                sql          += " WHERE ";
            }
            else
            {
                sql += " AND ";
            }
            sql += "StatusId = " + _StatusId.ToString();
        }

        try
        {
            MDataBase db = new MDataBase(_DBConn);
            DataRow   dr;
            bool      blnReturnCode = db.GetDataRow(sql, out dr);
            if (blnReturnCode == false || dr == null)
            {
                return(false);
            }

            // 对属性赋值
            try
            {
                _Exam_Id = dr["Exam_Id"].ToString();
            }
            catch (Exception err)
            { }
            try
            {
                _ExamName = dr["ExamName"].ToString();
            }
            catch (Exception err)
            { }
            try
            {
                _ScoreType = Convert.ToInt32(dr["ScoreType"]);
            }
            catch (Exception err)
            { }
            try
            {
                _BeginTime = Convert.ToDateTime(dr["BeginTime"]);
            }
            catch (Exception err)
            { }
            try
            {
                _EndTime = Convert.ToDateTime(dr["EndTime"]);
            }
            catch (Exception err)
            { }
            try
            {
                _Times = Convert.ToInt32(dr["Times"]);
            }
            catch (Exception err)
            { }
            try
            {
                _Count = Convert.ToInt32(dr["Count"]);
            }
            catch (Exception err)
            { }
            try
            {
                _ExamEmploees = Convert.ToInt32(dr["ExamEmploees"]);
            }
            catch (Exception err)
            { }
            try
            {
                _Average = Convert.ToSingle(dr["Average"]);
            }
            catch (Exception err)
            { }
            try
            {
                _CreatedBy = dr["CreatedBy"].ToString();
            }
            catch (Exception err)
            { }
            try
            {
                _CreatedDate = Convert.ToDateTime(dr["CreatedDate"]);
            }
            catch (Exception err)
            { }
            try
            {
                _ModifiedBy = dr["ModifiedBy"].ToString();
            }
            catch (Exception err)
            { }
            try
            {
                _ModifiedDate = Convert.ToDateTime(dr["ModifiedDate"]);
            }
            catch (Exception err)
            { }
            try
            {
                _StatusId = Convert.ToInt32(dr["StatusId"]);
            }
            catch (Exception err)
            { }

            return(true);
        }
        catch (Exception err)
        {
            throw;
            return(false);
        }
    }
Beispiel #15
0
 //保存当前题并装载上一题的方法
 private void selectExmQuestioPrev(string Answer)
 {
     //保存当前题目
     string sqlOk = "update temp" + config.Staff.Username + " set QuestionState= '" + hfdState.Value + "',Answer='" + Answer + "' where Question_Id='" + lblQuestionId.Text + "'";
     db = new MDataBase(config.DBConn);
     db.executeUpdate(sqlOk);
     //装载下一题
     string sql = "select a.Question_Id,a.Question,a.Question_Guid,b.AnswerA,b.AnswerB,b.AnswerC,b.AnswerD,b.AnswerE,a.Answer from temp" + config.Staff.Username + " a,SExmQuestion b where a.Question_Guid=b.Question_Guid and a.Question_Id='" + Convert.ToString(Convert.ToInt32(lblQuestionId.Text) - 1) + "'";
     DataRow drQuestion;
     db = new MDataBase(config.DBConn);
     bool blnRtnCode = db.GetDataRow(sql, out drQuestion);
     if (blnRtnCode == false || drQuestion == null)
     {
         // 错误
         return;
     }
     //赋值
     this.lblQuestionId.Text = drQuestion["Question_Id"].ToString();
     this.lblQuestion.Text = drQuestion["Question"].ToString();
     this.lblAnwerA.Text = drQuestion["AnswerA"].ToString();
     this.lblAnwerB.Text = drQuestion["AnswerB"].ToString();
     this.lblAnwerC.Text = drQuestion["AnswerC"].ToString();
     this.lblAnswer.Text = drQuestion["Answer"].ToString();
     hfdQuestionGuid.Value = drQuestion["Question_Guid"].ToString();
     //如果答案里包括A,chkAnswerA钩上
     if (lblAnswer.Text.IndexOf("A") != -1)
     {
         chkAnswerA.Checked = true;
     }
     //如果答案里包括B,chkAnswerB钩上
     if (lblAnswer.Text.IndexOf("B") != -1)
     {
         chkAnswerB.Checked = true;
     }
     //如果答案里包括C,chkAnswerC钩上
     if (lblAnswer.Text.IndexOf("C") != -1)
     {
         chkAnswerC.Checked = true;
     }
     //如果答案里包括D,chkAnswerD钩上
     if (lblAnswer.Text.IndexOf("D") != -1)
     {
         chkAnswerD.Checked = true;
     }
     //如果答案里包括E,chkAnswerE钩上
     if (lblAnswer.Text.IndexOf("E") != -1)
     {
         chkAnswerE.Checked = true;
     }
     //如果D答案为空,选项框隐藏
     if (drQuestion["AnswerD"].ToString() != "")
     {
         chkAnswerD.Visible = true;
         this.lblAnwerD.Text = drQuestion["AnswerD"].ToString();
     }
     else
     {
         lblAnwerD.Text = "";
         chkAnswerD.Visible = false;
     }
     //如果E答案为空,选项框隐藏
     if (drQuestion["AnswerE"].ToString() != "")
     {
         chkAnswerE.Visible = true;
         this.lblAnwerE.Text = drQuestion["AnswerE"].ToString();
     }
     else
     {
         lblAnwerE.Text = "";
         chkAnswerE.Visible = false;
     }
 }
Beispiel #16
0
    /// <summary>
    /// SPsnWorkTime对象GetInfo方法
    /// </summary>
    private bool executeGetInfo()
    {
        bool   blnFirstField = true;
        string sql           = "select * from SPsnWorkTime";

        // (WorkTime_Guid)字段
        if (_blnWorkTime_GuidChanged == true)
        {
            if (blnFirstField == true)
            {
                blnFirstField = false;
                sql          += " WHERE ";
            }
            else
            {
                sql += " AND ";
            }
            sql += "WorkTime_Guid = '" + _WorkTime_Guid + "'";
        }
        // (Staff_Id)字段
        if (_blnStaff_IdChanged == true)
        {
            if (blnFirstField == true)
            {
                blnFirstField = false;
                sql          += " WHERE ";
            }
            else
            {
                sql += " AND ";
            }
            sql += "Staff_Id = '" + _Staff_Id + "'";
        }
        // (Day)字段
        if (_blnDayChanged == true)
        {
            if (blnFirstField == true)
            {
                blnFirstField = false;
                sql          += " WHERE ";
            }
            else
            {
                sql += " AND ";
            }
            sql += "Day = '" + _Day.ToString() + "'";
        }
        // (WorkStatusId)字段
        if (_blnWorkStatusIdChanged == true)
        {
            if (blnFirstField == true)
            {
                blnFirstField = false;
                sql          += " WHERE ";
            }
            else
            {
                sql += " AND ";
            }
            sql += "WorkStatusId = " + _WorkStatusId.ToString();
        }
        // (Job)字段
        if (_blnJobChanged == true)
        {
            if (blnFirstField == true)
            {
                blnFirstField = false;
                sql          += " WHERE ";
            }
            else
            {
                sql += " AND ";
            }
            sql += "Job = '" + _Job + "'";
        }
        // (Address)字段
        if (_blnAddressChanged == true)
        {
            if (blnFirstField == true)
            {
                blnFirstField = false;
                sql          += " WHERE ";
            }
            else
            {
                sql += " AND ";
            }
            sql += "Address = '" + _Address + "'";
        }
        // (Remark)字段
        if (_blnRemarkChanged == true)
        {
            if (blnFirstField == true)
            {
                blnFirstField = false;
                sql          += " WHERE ";
            }
            else
            {
                sql += " AND ";
            }
            sql += "Remark = '" + _Remark + "'";
        }
        // (CreatedBy)字段
        if (_blnCreatedByChanged == true)
        {
            if (blnFirstField == true)
            {
                blnFirstField = false;
                sql          += " WHERE ";
            }
            else
            {
                sql += " AND ";
            }
            sql += "CreatedBy = '" + _CreatedBy + "'";
        }
        // (CreatedDate)字段
        if (_blnCreatedDateChanged == true)
        {
            if (blnFirstField == true)
            {
                blnFirstField = false;
                sql          += " WHERE ";
            }
            else
            {
                sql += " AND ";
            }
            sql += "CreatedDate = '" + _CreatedDate.ToString() + "'";
        }
        // (ModifiedBy)字段
        if (_blnModifiedByChanged == true)
        {
            if (blnFirstField == true)
            {
                blnFirstField = false;
                sql          += " WHERE ";
            }
            else
            {
                sql += " AND ";
            }
            sql += "ModifiedBy = '" + _ModifiedBy + "'";
        }
        // (ModifiedDate)字段
        if (_blnModifiedDateChanged == true)
        {
            if (blnFirstField == true)
            {
                blnFirstField = false;
                sql          += " WHERE ";
            }
            else
            {
                sql += " AND ";
            }
            sql += "ModifiedDate = '" + _ModifiedDate.ToString() + "'";
        }
        // (StatusId)字段
        if (_blnStatusIdChanged == true)
        {
            if (blnFirstField == true)
            {
                blnFirstField = false;
                sql          += " WHERE ";
            }
            else
            {
                sql += " AND ";
            }
            sql += "StatusId = " + _StatusId.ToString();
        }

        try
        {
            MDataBase db = new MDataBase(_DBConn);
            DataRow   dr;
            bool      blnReturnCode = db.GetDataRow(sql, out dr);
            if (blnReturnCode == false || dr == null)
            {
                return(false);
            }

            // 对属性赋值
            try
            {
                _WorkTime_Guid = dr["WorkTime_Guid"].ToString();
            }
            catch (Exception err)
            { }
            try
            {
                _Staff_Id = dr["Staff_Id"].ToString();
            }
            catch (Exception err)
            { }
            try
            {
                _Day = Convert.ToDateTime(dr["Day"]);
            }
            catch (Exception err)
            { }
            try
            {
                _WorkStatusId = Convert.ToInt32(dr["WorkStatusId"]);
            }
            catch (Exception err)
            { }
            try
            {
                _Job = dr["Job"].ToString();
            }
            catch (Exception err)
            { }
            try
            {
                _Address = dr["Address"].ToString();
            }
            catch (Exception err)
            { }
            try
            {
                _Remark = dr["Remark"].ToString();
            }
            catch (Exception err)
            { }
            try
            {
                _CreatedBy = dr["CreatedBy"].ToString();
            }
            catch (Exception err)
            { }
            try
            {
                _CreatedDate = Convert.ToDateTime(dr["CreatedDate"]);
            }
            catch (Exception err)
            { }
            try
            {
                _ModifiedBy = dr["ModifiedBy"].ToString();
            }
            catch (Exception err)
            { }
            try
            {
                _ModifiedDate = Convert.ToDateTime(dr["ModifiedDate"]);
            }
            catch (Exception err)
            { }
            try
            {
                _StatusId = Convert.ToInt32(dr["StatusId"]);
            }
            catch (Exception err)
            { }

            return(true);
        }
        catch (Exception err)
        {
            throw;
            return(false);
        }
    }
Beispiel #17
0
    /// <summary>
    /// SSysRunParameter对象GetInfo方法
    /// </summary>
    private bool executeGetInfo()
    {
        bool   blnFirstField = true;
        string sql           = "select * from SSysRunParameter";

        // (Parameter_Guid)字段
        if (_blnParameter_GuidChanged == true)
        {
            if (blnFirstField == true)
            {
                blnFirstField = false;
                sql          += " WHERE ";
            }
            else
            {
                sql += " AND ";
            }
            sql += "Parameter_Guid = '" + _Parameter_Guid + "'";
        }
        // (ParameterName)字段
        if (_blnParameterNameChanged == true)
        {
            if (blnFirstField == true)
            {
                blnFirstField = false;
                sql          += " WHERE ";
            }
            else
            {
                sql += " AND ";
            }
            sql += "ParameterName = '" + _ParameterName + "'";
        }
        // (ParameterValue)字段
        if (_blnParameterValueChanged == true)
        {
            if (blnFirstField == true)
            {
                blnFirstField = false;
                sql          += " WHERE ";
            }
            else
            {
                sql += " AND ";
            }
            sql += "ParameterValue = '" + _ParameterValue + "'";
        }
        // (Detail)字段
        if (_blnDetailChanged == true)
        {
            if (blnFirstField == true)
            {
                blnFirstField = false;
                sql          += " WHERE ";
            }
            else
            {
                sql += " AND ";
            }
            sql += "Detail = '" + _Detail + "'";
        }
        // (IsUser)字段
        if (_blnIsUserChanged == true)
        {
            if (blnFirstField == true)
            {
                blnFirstField = false;
                sql          += " WHERE ";
            }
            else
            {
                sql += " AND ";
            }
            sql += "IsUser = "******"Parameter_Guid"].ToString();
            }
            catch (Exception err)
            {}
            try
            {
                _ParameterName = dr["ParameterName"].ToString();
            }
            catch (Exception err)
            {}
            try
            {
                _ParameterValue = dr["ParameterValue"].ToString();
            }
            catch (Exception err)
            {}
            try
            {
                _Detail = dr["Detail"].ToString();
            }
            catch (Exception err)
            {}
            try
            {
                _IsUser = Convert.ToInt32(dr["IsUser"]);
            }
            catch (Exception err)
            {}

            return(true);
        }
        catch (Exception err)
        {
            throw;
            return(false);
        }
    }
Beispiel #18
0
    /// <summary>
    /// SExmScore对象GetInfo方法
    /// </summary>
    private bool executeGetInfo()
    {
        bool   blnFirstField = true;
        string sql           = "select * from SExmScore";

        // (Score_Guid)字段
        if (_blnScore_GuidChanged == true)
        {
            if (blnFirstField == true)
            {
                blnFirstField = false;
                sql          += " WHERE ";
            }
            else
            {
                sql += " AND ";
            }
            sql += "Score_Guid = '" + _Score_Guid + "'";
        }
        // (Exam_Id)字段
        if (_blnExam_IdChanged == true)
        {
            if (blnFirstField == true)
            {
                blnFirstField = false;
                sql          += " WHERE ";
            }
            else
            {
                sql += " AND ";
            }
            sql += "Exam_Id = '" + _Exam_Id + "'";
        }
        // (Staff_Id)字段
        if (_blnStaff_IdChanged == true)
        {
            if (blnFirstField == true)
            {
                blnFirstField = false;
                sql          += " WHERE ";
            }
            else
            {
                sql += " AND ";
            }
            sql += "Staff_Id = '" + _Staff_Id + "'";
        }
        // (StartTime)字段
        if (_blnStartTimeChanged == true)
        {
            if (blnFirstField == true)
            {
                blnFirstField = false;
                sql          += " WHERE ";
            }
            else
            {
                sql += " AND ";
            }
            sql += "StartTime = '" + _StartTime.ToString() + "'";
        }
        // (EndTime)字段
        if (_blnEndTimeChanged == true)
        {
            if (blnFirstField == true)
            {
                blnFirstField = false;
                sql          += " WHERE ";
            }
            else
            {
                sql += " AND ";
            }
            sql += "EndTime = '" + _EndTime.ToString() + "'";
        }
        // (RightCount)字段
        if (_blnRightCountChanged == true)
        {
            if (blnFirstField == true)
            {
                blnFirstField = false;
                sql          += " WHERE ";
            }
            else
            {
                sql += " AND ";
            }
            sql += "RightCount = " + _RightCount.ToString();
        }
        // (WrongCount)字段
        if (_blnWrongCountChanged == true)
        {
            if (blnFirstField == true)
            {
                blnFirstField = false;
                sql          += " WHERE ";
            }
            else
            {
                sql += " AND ";
            }
            sql += "WrongCount = " + _WrongCount.ToString();
        }
        // (UnfinishCount)字段
        if (_blnUnfinishCountChanged == true)
        {
            if (blnFirstField == true)
            {
                blnFirstField = false;
                sql          += " WHERE ";
            }
            else
            {
                sql += " AND ";
            }
            sql += "UnfinishCount = " + _UnfinishCount.ToString();
        }
        // (Score)字段
        if (_blnScoreChanged == true)
        {
            if (blnFirstField == true)
            {
                blnFirstField = false;
                sql          += " WHERE ";
            }
            else
            {
                sql += " AND ";
            }
            sql += "Score = " + _Score.ToString();
        }
        // (Gradation)字段
        if (_blnGradationChanged == true)
        {
            if (blnFirstField == true)
            {
                blnFirstField = false;
                sql          += " WHERE ";
            }
            else
            {
                sql += " AND ";
            }
            sql += "Gradation = " + _Gradation.ToString();
        }

        try
        {
            MDataBase db = new MDataBase(_DBConn);
            DataRow   dr;
            bool      blnReturnCode = db.GetDataRow(sql, out dr);
            if (blnReturnCode == false || dr == null)
            {
                return(false);
            }

            // 对属性赋值
            try
            {
                _Score_Guid = dr["Score_Guid"].ToString();
            }
            catch (Exception err)
            { }
            try
            {
                _Exam_Id = dr["Exam_Id"].ToString();
            }
            catch (Exception err)
            { }
            try
            {
                _Staff_Id = dr["Staff_Id"].ToString();
            }
            catch (Exception err)
            { }
            try
            {
                _StartTime = Convert.ToDateTime(dr["StartTime"]);
            }
            catch (Exception err)
            { }
            try
            {
                _EndTime = Convert.ToDateTime(dr["EndTime"]);
            }
            catch (Exception err)
            { }
            try
            {
                _RightCount = Convert.ToInt32(dr["RightCount"]);
            }
            catch (Exception err)
            { }
            try
            {
                _WrongCount = Convert.ToInt32(dr["WrongCount"]);
            }
            catch (Exception err)
            { }
            try
            {
                _UnfinishCount = Convert.ToInt32(dr["UnfinishCount"]);
            }
            catch (Exception err)
            { }
            try
            {
                _Score = Convert.ToSingle(dr["Score"]);
            }
            catch (Exception err)
            { }
            try
            {
                _Gradation = Convert.ToInt32(dr["Gradation"]);
            }
            catch (Exception err)
            { }

            return(true);
        }
        catch (Exception err)
        {
            throw;
            return(false);
        }
    }
Beispiel #19
0
    private void EditPanel()
    {
        //查找没有下送时的修改情况
        string XSSqlOne = "SELECT top 1 Number, PFunction, PExecute FROM STelFlow WHERE (Tel_ID = '" + Tel_ID +
                          "') AND (OperateStep = '1') order by CreatedDate DESC";

        DataRow XSRowOne = db.GetDataRow(XSSqlOne);
        string  staff_Id = ViewState["Satff_Id"].ToString();  //登录人的编号

        if (XSRowOne != null)
        {
            //修改保存但是没有下送的信息
            //权限验证
            XSRowOne[2].ToString();    //操作人的编号

            if (XSRowOne[2].ToString().Trim() != staff_Id)
            {
                ViewState["XS"] = "TRUE";
                return;
            }
            ViewState["Number"] = XSRowOne[0].ToString();


            ViewState["PFunction"] = XSRowOne[1].ToString(); //为当前步骤(没有下送前的修改情况)
            if (XSRowOne[1].ToString() == "1")               //电话登记
            {
                PanelVisibleFalse();
                this.panelDJ.Visible = true;
                this.panelAN.Visible = true;   //按钮
                XGEditDJ(XSRowOne[0].ToString());
                return;
            }
            else if (XSRowOne[1].ToString() == "2")
            {
                                                      //办公室审阅
                {
                    PanelVisibleFalse();
                    this.panelDJ.Visible = true;
                    this.panelSY.Visible = true;
                    this.panelAN.Visible = true; //按钮

                    XGEditDJ(XSRowOne[0].ToString());
                    return;
                }
            }
            else if (XSRowOne[1].ToString() == "3")
            {
                                                       //领导批示
                {
                    PanelVisibleFalse();
                    this.panelPS.Visible = true;
                    this.panelAN.Visible = true;  //按钮
                    this.Button5.Visible = false; //只能有一步的领导审批 ,所以按扭置为不可见
                    this.btnNext.Visible = false;
                    btnSave.Visible      = false;
                    XGEditPS(XSRowOne[0].ToString());

                    return;
                }
            }
        }

        #region

        string TelFlow_Guid = Guid.NewGuid().ToString();   //编号,随便生成一个新的 
        //string Number = Guid.NewGuid().ToString();           //该步骤编号,要在保存里用到 
        //ViewState["Number"] = Number;             //保存住这个值,在功能保存中要用到
        string PFunction = "";                    //该步骤的功能

        string SY = "";                           //Insert语句


        //查找下步执行功能和下步执行人,标记是已经完成
        string XSSql = "select  top 1 NFunction,NExecute from STelFlow where Tel_ID = '" + Tel_ID +
                       "' and OperateStep = '2' and (NExecute <> '' or NExecute <> null) order by CreatedDate DESC";
        DataRow XSRow = db.GetDataRow(XSSql);
        //XSRow[1].ToString()为上步指派的操作人员
        //判断该操作人员是不是属于上步指派的操作人员,如果不是退出AAA


        //查找该人员编号在不在上步指定的人员编号中,在可以查看该步功能,否则只能查看已经做过的功能
        string strYZ = "select Count(*) from ( " +
                       " select top 1 * from STelFlow  where   Tel_ID = '" + Tel_ID + "' and OperateStep = '2' Order by STelFlow.CreatedDate Desc)  as STelFlow " +
                       " left join SOrdArrangeMan on STelFlow.NExecute = SOrdArrangeMan.Guid   where  Man  = '" + staff_Id + "'";

        string YZ = db.GetDataScalar(strYZ);

        if (YZ == "0")
        {
            ViewState["XS"] = "TRUE";
            return;
        }

        ViewState["PFunction"] = XSRow[0].ToString();   //为当前步骤(没有下送前的新增情况)
        if (XSRow[0].ToString() == "2")
        {
                                          //办公室审阅
            {
                //电话登记部分的显示,办公室是可以修改的   AAA
                panelDJ.Visible = true;
                panelSY.Visible = true;
                XGEditDJ(""); //办公室人员操作时要能对值班室登记的信息进行修改
                //往流程表STelFlow里加一条记录,写进去 编号TelFlow_Guid 勤务编号Tel_ID
                //该步骤编号Number 该步骤的功能PFunction  该步骤执行人员PExecute
                PFunction = "2";
                SY        = "insert into STelFlow(TelFlow_Guid,Tel_ID,Number,PFunction,PExecute,CreatedBy,CreatedDate,OperateStep) " +
                            " values('" + TelFlow_Guid + "','" + Tel_ID + "','" + ViewState["Number"].ToString() + "','" + PFunction + "','" + staff_Id + "','" + staff_Id + "',getdate(),1)";
                db.executeInsert(SY);
                this.panelAN.Visible = true; //按钮
                return;
            }
        }
        else if (XSRow[0].ToString() == "3")
        {
                                                //领导批示
            {
                //权限判断 AAA
                panelPS.Visible = true;
                btnSave.Visible = false;
                PFunction       = "3";
                SY = "insert into STelFlow(TelFlow_Guid,Tel_ID,Number,PFunction,PExecute,CreatedBy,CreatedDate,OperateStep) " +
                     " values('" + TelFlow_Guid + "','" + Tel_ID + "','" + ViewState["Number"].ToString() + "','" + PFunction + "','" + ViewState["Satff_Id"].ToString() + "','" + ViewState["Satff_Id"].ToString() + "',getdate(),1)";
                db.executeInsert(SY);
                this.panelAN.Visible = true; //按钮
                return;
            }
        }

        #endregion
    }
Beispiel #20
0
    protected void Page_Load(object sender, EventArgs e)
    {
        if (!this.IsPostBack)
        {
            txtCreatedBy.Text = "";  //从登录得到用户名

            txtCreatedBy.Enabled = false;
            txtTaskName.Enabled  = false;   //勤务名称不能修改
            ControlDataBind drp = new ControlDataBind(ConfigurationManager.ConnectionStrings["OA"].ToString());
            drp.DropDownListBind(drpGuardSpec, "SOrdSpec", "SpecName", "SpecID", 1, "", txtCreatedBy.Text.Trim());
            drp.DropDownListBind(drpOrder_ID, "SOrdEstate", "Order_ID", "Order_ID", 4, "StatusId = 4", txtCreatedBy.Text.Trim());     //完结状态的勤务
            lblEnregisterTime.Text = System.DateTime.Now.Year.ToString() + "-" + System.DateTime.Now.Month.ToString() +
                                     "-" + System.DateTime.Now.Day.ToString();                                                        //得到当前的时间

            if (Request.QueryString["Order_ID"] == null || Request.QueryString["Order_ID"].ToString() == "")                          //勤务编号
            {
                ViewState["State"] = "Insert";
            }
            else
            {
                string Order_ID = Request.QueryString["Order_ID"].ToString();

                ViewState["Order_ID"] = Order_ID;
                ViewState["State"]    = "Update";
                string selectSql = " SELECT [Order_ID],[EnregisterTime],[GuardSpec],[DayNumber],[ArrivalTime],[FromArea],[RiteVehicle]," +
                                   " [ArrivalArea],[ArrivalTimeTwo],[FromAreaTwo],[RiteVehicleTwo],[ArrivalAreaTwo],[ReceiveArea],[AccompanyFugle],[MoveDate], " +
                                   " [AccompanyPeo],[GuardCuston],[Principal],[Roster],[Perform],[Remark],[CreatedBy],[CreatedDate],[ModifiedBy],[ModifiedDate]," +
                                   " [StatusId]  FROM SOrdNWBenregister where Order_ID = '" + Order_ID + "'";
                DataRow selectRow = db.GetDataRow(selectSql);
                ViewState["Order_ID"]     = selectRow[0];
                drpOrder_ID.SelectedValue = selectRow[0].ToString();   //勤务编号
                drpOrder_ID.Enabled       = false;

                this.lblEnregisterTime.Text = selectRow[1].ToString(); //登记时间
                drpGuardSpec.SelectedValue  = selectRow[2].ToString(); ///警卫规格

                if (drpOrder_ID.SelectedValue != "0")                  //勤务名称
                {
                    string Sql = "select Order_Name from SOrdEstate where Order_ID = '" + selectRow[0].ToString() + "'";
                    try
                    {
                        string Order_Name = db.GetDataScalar(Sql);
                        txtTaskName.Text = Order_Name;
                    }
                    catch { }
                }

                txtDayNumber.Text = selectRow[3].ToString();                         ///警卫规格

                txtArrivalTime1.Text          = GetDate(selectRow[4].ToString());    //得到日期
                drpArrivalTime2.SelectedValue = GetHour(selectRow[4].ToString());    //时

                txtFromArea.Text    = selectRow[5].ToString();                       //  自
                txtRiteVehicle.Text = selectRow[6].ToString();                       //  乘
                txtArrivalArea.Text = selectRow[7].ToString();                       //  抵

                txtArrivalTimeTwo1.Text          = GetDate(selectRow[8].ToString()); //得到日期
                drpArrivalTimeTwo2.SelectedValue = GetHour(selectRow[8].ToString()); //时
                txtFromAreaTwo.Text    = selectRow[9].ToString();                    //  自
                txtRiteVehicleTwo.Text = selectRow[10].ToString();                   //  乘
                txtArrivalAreaTwo.Text = selectRow[11].ToString();                   //  抵

                txtReceiveArea.Text    = selectRow[12].ToString();                   // 接待单位:
                txtAccompanyFugle.Text = selectRow[13].ToString();                   //  省陪同领导:
                txtMoveDate.Text       = selectRow[14].ToString();                   // 活动日程:
                txtAccompanyPeo.Text   = selectRow[15].ToString();                   // 随行人员(姓名/职务):
                txtGuardCuston.Text    = selectRow[16].ToString();                   //  警卫对象生活习惯:


                txtPrincipal.Text = selectRow[17].ToString(); // 负责人:
                txtRoster.Text    = selectRow[18].ToString(); //      值勤人员:
                txtPerform.Text   = selectRow[19].ToString(); //  情况

                txtRemark.Text = selectRow[20].ToString();    //  备注
            }
        }
    }
Beispiel #21
0
    /// <summary>
    /// SC_QuestionType对象GetInfo方法
    /// </summary>
    private bool executeGetInfo()
    {
        bool   blnFirstField = true;
        string sql           = "select * from SC_QuestionType";

        // (QuestionType_Id)字段
        if (_blnQuestionType_IdChanged == true)
        {
            if (blnFirstField == true)
            {
                blnFirstField = false;
                sql          += " WHERE ";
            }
            else
            {
                sql += " AND ";
            }
            sql += "QuestionType_Id = '" + _QuestionType_Id + "'";
        }
        // (QuestionTypeName)字段
        if (_blnQuestionTypeNameChanged == true)
        {
            if (blnFirstField == true)
            {
                blnFirstField = false;
                sql          += " WHERE ";
            }
            else
            {
                sql += " AND ";
            }
            sql += "QuestionTypeName = '" + _QuestionTypeName + "'";
        }

        try
        {
            MDataBase db = new MDataBase(_DBConn);
            DataRow   dr;
            bool      blnReturnCode = db.GetDataRow(sql, out dr);
            if (blnReturnCode == false || dr == null)
            {
                return(false);
            }

            // 对属性赋值
            try
            {
                _QuestionType_Id = dr["QuestionType_Id"].ToString();
            }
            catch (Exception err)
            {}
            try
            {
                _QuestionTypeName = dr["QuestionTypeName"].ToString();
            }
            catch (Exception err)
            {}

            return(true);
        }
        catch (Exception err)
        {
            throw;
            return(false);
        }
    }
Beispiel #22
0
    /// <summary>
    /// CustomerSensitive对象GetInfo方法
    /// </summary>
    private bool executeGetInfo()
    {
        bool   blnFirstField = true;
        string sql           = "select * from CustomerSensitive";

        // (SenCustomer_Guid)字段
        if (_blnSenCustomer_GuidChanged == true)
        {
            if (blnFirstField == true)
            {
                blnFirstField = false;
                sql          += " WHERE ";
            }
            else
            {
                sql += " AND ";
            }
            sql += "SenCustomer_Guid = '" + _SenCustomer_Guid + "'";
        }
        // (Mobile)字段
        if (_blnMobileChanged == true)
        {
            if (blnFirstField == true)
            {
                blnFirstField = false;
                sql          += " WHERE ";
            }
            else
            {
                sql += " AND ";
            }
            sql += "Mobile = '" + _Mobile + "'";
        }
        // (SenPeriod)字段
        if (_blnSenPeriodChanged == true)
        {
            if (blnFirstField == true)
            {
                blnFirstField = false;
                sql          += " WHERE ";
            }
            else
            {
                sql += " AND ";
            }
            sql += "SenPeriod = " + _SenPeriod.ToString();
        }
        // (SenEndTime)字段
        if (_blnSenEndTimeChanged == true)
        {
            if (blnFirstField == true)
            {
                blnFirstField = false;
                sql          += " WHERE ";
            }
            else
            {
                sql += " AND ";
            }
            sql += "SenEndTime = '" + _SenEndTime.ToString() + "'";
        }
        // (CreatedBy)字段
        if (_blnCreatedByChanged == true)
        {
            if (blnFirstField == true)
            {
                blnFirstField = false;
                sql          += " WHERE ";
            }
            else
            {
                sql += " AND ";
            }
            sql += "CreatedBy = '" + _CreatedBy + "'";
        }
        // (CreatedDate)字段
        if (_blnCreatedDateChanged == true)
        {
            if (blnFirstField == true)
            {
                blnFirstField = false;
                sql          += " WHERE ";
            }
            else
            {
                sql += " AND ";
            }
            sql += "CreatedDate = '" + _CreatedDate.ToString() + "'";
        }
        // (ModifiedBy)字段
        if (_blnModifiedByChanged == true)
        {
            if (blnFirstField == true)
            {
                blnFirstField = false;
                sql          += " WHERE ";
            }
            else
            {
                sql += " AND ";
            }
            sql += "ModifiedBy = '" + _ModifiedBy + "'";
        }
        // (ModifiedDate)字段
        if (_blnModifiedDateChanged == true)
        {
            if (blnFirstField == true)
            {
                blnFirstField = false;
                sql          += " WHERE ";
            }
            else
            {
                sql += " AND ";
            }
            sql += "ModifiedDate = '" + _ModifiedDate.ToString() + "'";
        }

        try
        {
            MDataBase db = new MDataBase(_DBConn);
            DataRow   dr;
            bool      blnReturnCode = db.GetDataRow(sql, out dr);
            if (blnReturnCode == false || dr == null)
            {
                return(false);
            }

            // 对属性赋值
            try
            {
                _SenCustomer_Guid = dr["SenCustomer_Guid"].ToString();
            }
            catch (Exception err)
            {}
            try
            {
                _Mobile = dr["Mobile"].ToString();
            }
            catch (Exception err)
            {}
            try
            {
                _SenPeriod = Convert.ToInt32(dr["SenPeriod"]);
            }
            catch (Exception err)
            {}
            try
            {
                _SenEndTime = Convert.ToDateTime(dr["SenEndTime"]);
            }
            catch (Exception err)
            {}
            try
            {
                _CreatedBy = dr["CreatedBy"].ToString();
            }
            catch (Exception err)
            {}
            try
            {
                _CreatedDate = Convert.ToDateTime(dr["CreatedDate"]);
            }
            catch (Exception err)
            {}
            try
            {
                _ModifiedBy = dr["ModifiedBy"].ToString();
            }
            catch (Exception err)
            {}
            try
            {
                _ModifiedDate = Convert.ToDateTime(dr["ModifiedDate"]);
            }
            catch (Exception err)
            {}

            return(true);
        }
        catch (Exception err)
        {
            throw;
            return(false);
        }
    }
Beispiel #23
0
    /// <summary>
    /// SExmQuestion对象GetInfo方法
    /// </summary>
    private bool executeGetInfo()
    {
        bool   blnFirstField = true;
        string sql           = "select * from SExmQuestion";

        // (Question_Guid)字段
        if (_blnQuestion_GuidChanged == true)
        {
            if (blnFirstField == true)
            {
                blnFirstField = false;
                sql          += " WHERE ";
            }
            else
            {
                sql += " AND ";
            }
            sql += "Question_Guid = '" + _Question_Guid + "'";
        }
        // (QuestionType_Id)字段
        if (_blnQuestionType_IdChanged == true)
        {
            if (blnFirstField == true)
            {
                blnFirstField = false;
                sql          += " WHERE ";
            }
            else
            {
                sql += " AND ";
            }
            sql += "QuestionType_Id = '" + _QuestionType_Id + "'";
        }
        // (Question)字段
        if (_blnQuestionChanged == true)
        {
            if (blnFirstField == true)
            {
                blnFirstField = false;
                sql          += " WHERE ";
            }
            else
            {
                sql += " AND ";
            }
            sql += "Question = '" + _Question + "'";
        }
        // (AnswerA)字段
        if (_blnAnswerAChanged == true)
        {
            if (blnFirstField == true)
            {
                blnFirstField = false;
                sql          += " WHERE ";
            }
            else
            {
                sql += " AND ";
            }
            sql += "AnswerA = '" + _AnswerA + "'";
        }
        // (AnswerB)字段
        if (_blnAnswerBChanged == true)
        {
            if (blnFirstField == true)
            {
                blnFirstField = false;
                sql          += " WHERE ";
            }
            else
            {
                sql += " AND ";
            }
            sql += "AnswerB = '" + _AnswerB + "'";
        }
        // (AnswerC)字段
        if (_blnAnswerCChanged == true)
        {
            if (blnFirstField == true)
            {
                blnFirstField = false;
                sql          += " WHERE ";
            }
            else
            {
                sql += " AND ";
            }
            sql += "AnswerC = '" + _AnswerC + "'";
        }
        // (AnswerD)字段
        if (_blnAnswerDChanged == true)
        {
            if (blnFirstField == true)
            {
                blnFirstField = false;
                sql          += " WHERE ";
            }
            else
            {
                sql += " AND ";
            }
            sql += "AnswerD = '" + _AnswerD + "'";
        }
        // (AnswerE)字段
        if (_blnAnswerEChanged == true)
        {
            if (blnFirstField == true)
            {
                blnFirstField = false;
                sql          += " WHERE ";
            }
            else
            {
                sql += " AND ";
            }
            sql += "AnswerE = '" + _AnswerE + "'";
        }
        // (Answer)字段
        if (_blnAnswerChanged == true)
        {
            if (blnFirstField == true)
            {
                blnFirstField = false;
                sql          += " WHERE ";
            }
            else
            {
                sql += " AND ";
            }
            sql += "Answer = '" + _Answer + "'";
        }
        // (Times)字段
        if (_blnTimesChanged == true)
        {
            if (blnFirstField == true)
            {
                blnFirstField = false;
                sql          += " WHERE ";
            }
            else
            {
                sql += " AND ";
            }
            sql += "Times = " + _Times.ToString();
        }
        // (CreatedBy)字段
        if (_blnCreatedByChanged == true)
        {
            if (blnFirstField == true)
            {
                blnFirstField = false;
                sql          += " WHERE ";
            }
            else
            {
                sql += " AND ";
            }
            sql += "CreatedBy = '" + _CreatedBy + "'";
        }
        // (CreatedDate)字段
        if (_blnCreatedDateChanged == true)
        {
            if (blnFirstField == true)
            {
                blnFirstField = false;
                sql          += " WHERE ";
            }
            else
            {
                sql += " AND ";
            }
            sql += "CreatedDate = '" + _CreatedDate.ToString() + "'";
        }
        // (ModifiedBy)字段
        if (_blnModifiedByChanged == true)
        {
            if (blnFirstField == true)
            {
                blnFirstField = false;
                sql          += " WHERE ";
            }
            else
            {
                sql += " AND ";
            }
            sql += "ModifiedBy = '" + _ModifiedBy + "'";
        }
        // (ModifiedDate)字段
        if (_blnModifiedDateChanged == true)
        {
            if (blnFirstField == true)
            {
                blnFirstField = false;
                sql          += " WHERE ";
            }
            else
            {
                sql += " AND ";
            }
            sql += "ModifiedDate = '" + _ModifiedDate.ToString() + "'";
        }
        // (StatusId)字段
        if (_blnStatusIdChanged == true)
        {
            if (blnFirstField == true)
            {
                blnFirstField = false;
                sql          += " WHERE ";
            }
            else
            {
                sql += " AND ";
            }
            sql += "StatusId = " + _StatusId.ToString();
        }

        try
        {
            MDataBase db = new MDataBase(_DBConn);
            DataRow   dr;
            bool      blnReturnCode = db.GetDataRow(sql, out dr);
            if (blnReturnCode == false || dr == null)
            {
                return(false);
            }

            // 对属性赋值
            try
            {
                _Question_Guid = dr["Question_Guid"].ToString();
            }
            catch (Exception err)
            {}
            try
            {
                _QuestionType_Id = dr["QuestionType_Id"].ToString();
            }
            catch (Exception err)
            {}
            try
            {
                _Question = dr["Question"].ToString();
            }
            catch (Exception err)
            {}
            try
            {
                _AnswerA = dr["AnswerA"].ToString();
            }
            catch (Exception err)
            {}
            try
            {
                _AnswerB = dr["AnswerB"].ToString();
            }
            catch (Exception err)
            {}
            try
            {
                _AnswerC = dr["AnswerC"].ToString();
            }
            catch (Exception err)
            {}
            try
            {
                _AnswerD = dr["AnswerD"].ToString();
            }
            catch (Exception err)
            {}
            try
            {
                _AnswerE = dr["AnswerE"].ToString();
            }
            catch (Exception err)
            {}
            try
            {
                _Answer = dr["Answer"].ToString();
            }
            catch (Exception err)
            {}
            try
            {
                _Times = Convert.ToInt32(dr["Times"]);
            }
            catch (Exception err)
            {}
            try
            {
                _CreatedBy = dr["CreatedBy"].ToString();
            }
            catch (Exception err)
            {}
            try
            {
                _CreatedDate = Convert.ToDateTime(dr["CreatedDate"]);
            }
            catch (Exception err)
            {}
            try
            {
                _ModifiedBy = dr["ModifiedBy"].ToString();
            }
            catch (Exception err)
            {}
            try
            {
                _ModifiedDate = Convert.ToDateTime(dr["ModifiedDate"]);
            }
            catch (Exception err)
            {}
            try
            {
                _StatusId = Convert.ToInt32(dr["StatusId"]);
            }
            catch (Exception err)
            {}

            return(true);
        }
        catch (Exception err)
        {
            throw;
            return(false);
        }
    }
Beispiel #24
0
    protected void Page_Load(object sender, EventArgs e)
    {
        Config Config   = (Config)Session["Config"];
        string staff_Id = Config.Staff.Staff_Id;  //得到登录的用户名
        //   string staff_Id = "";
        string Order_ID          = "";
        string type              = "";
        string OrderArrange_Guid = "";

        ViewState["Satff_Id"] = staff_Id;

        if (Request.QueryString["Order_ID"] == null || Request.QueryString["Order_ID"].ToString() == "") //编码
        {
            Response.Redirect("error2.htm");
        }
        else
        {
            Order_ID = Request.QueryString["Order_ID"].ToString();
            ViewState["Order_ID"] = Order_ID;
        }

        if (Request.QueryString["type"] == null || Request.QueryString["type"].ToString() == "") //状态 新建:1 修改:2
        {
            Response.Redirect("error2.htm");
        }
        else
        {
            type = Request.QueryString["type"].ToString();
            ViewState["type"] = type;
        }

        //子勤务编号
        if (Request.QueryString["OrderArrange_Guid"] == null || Request.QueryString["OrderArrange_Guid"].ToString() == "")
        {
            OrderArrange_Guid = "";
        }
        else
        {
            OrderArrange_Guid = Request.QueryString["OrderArrange_Guid"].ToString();
            ViewState["OrderArrange_Guid"] = OrderArrange_Guid;
        }

        if (!this.IsPostBack)
        {
            ControlDataBind drp = new ControlDataBind(ConfigurationManager.ConnectionStrings["OA"].ToString());
            drp.DropDownListBind(dropOrderNotion, "SSFugleideaConfig", "IdeaContent", "IdeaID", 1, "", staff_Id);


            if (OrderArrange_Guid == "")  //新增的情况
            {
                //权限验证
                ButtonVisible();
                Panelvisible();
                this.panelAP.Visible  = true;
                this.panelAP1.Visible = true;
                this.panelAN.Visible  = true;
                ViewState["state"]    = "AP";
                btnZCompere.Attributes.Add("onclick", "PopWindow1();");
                btnFCompere.Attributes.Add("onclick", "PopWindow2();");
                btnPrincipal.Attributes.Add("onclick", "PopWindow3();");
                btnXGMan.Attributes.Add("onclick", "PopWindow4();");
            }
            else if (OrderArrange_Guid != "")   //不是新增的情况下 有可能是领导批示/有可能是公文编写等功能
            {
                if (db.GetDataScalar("select Count(*) from SZOrdAuditing where Order_ID = '" +
                                     Order_ID + "' and OrderArrange_Guid = '" + OrderArrange_Guid + "'") == "0") //查不到记录说明是勤务安排的修改阶段
                {
                    //权限验证 得到第一次填写的人
                    string CreatedBy = db.GetDataScalar("select CreatedBy from SOrdCArrange where Order_ID = '" + Order_ID + "' and OrderArrange_Guid = '" + OrderArrange_Guid + "'");

                    if (CreatedBy != staff_Id)
                    {
                        ButtonVisible();     //如果没有权限修改,就只能看
                        Panelvisible();
                        this.panelXS.Visible = true;
                        XSAP(OrderArrange_Guid);
                        XSAP2(OrderArrange_Guid);
                    }
                    else
                    {
                        ButtonVisible();
                        Panelvisible();
                        ViewState["state"]    = "EditAP";
                        this.panelAP.Visible  = true;
                        this.panelAP1.Visible = true;
                        this.panelAN.Visible  = true;
                        XGEditAP(OrderArrange_Guid);
                        XSAP2Edit(OrderArrange_Guid);
                        btnZCompere.Attributes.Add("onclick", "PopWindow1();");
                        btnFCompere.Attributes.Add("onclick", "PopWindow2();");
                        btnPrincipal.Attributes.Add("onclick", "PopWindow3();");
                        btnXGMan.Attributes.Add("onclick", "PopWindow4();");
                    }
                }
                else
                {
                    string StrZOrdAuditing = "select PerNumber,OrderNotion,IsPer,StatusId,Per from SZOrdAuditing where Order_ID = '" +
                                             Order_ID + "' and OrderArrange_Guid = '" + OrderArrange_Guid + "'"; //勤务审批信息

                    try
                    {
                        DataRow ZOrdAuditingRow = db.GetDataRow(StrZOrdAuditing);

                        string PerNumber   = ZOrdAuditingRow[0].ToString();
                        string OrderNotion = ZOrdAuditingRow[1].ToString();
                        string IsPer       = ZOrdAuditingRow[2].ToString();
                        string StatusId    = ZOrdAuditingRow[3].ToString();
                        string Per         = ZOrdAuditingRow[4].ToString();

                        if ((PerNumber != "" || PerNumber != null) && StatusId == "0")    //审批后修改审批内容的状态
                        {
                            //权限验证 得到第一次填写的人
                            string CreatedBy = db.GetDataScalar("select CreatedBy from SZOrdAuditing where Order_ID = '" + Order_ID + "' and OrderArrange_Guid = '" + OrderArrange_Guid + "'");
                            if (CreatedBy != staff_Id)
                            {
                                ButtonVisible();     //如果没有权限修改,就只能看
                                Panelvisible();
                                this.panelXS.Visible = true;
                                XSAP(OrderArrange_Guid);
                                XSAP2(OrderArrange_Guid);
                            }
                            else
                            {
                                ViewState["state"] = "EditSP";
                                ButtonVisible();
                                Panelvisible();
                                XSAP(OrderArrange_Guid);
                                XSAP2(OrderArrange_Guid);
                                XGEditPS(OrderArrange_Guid);
                                this.panelPS.Visible = true;
                                this.panelAN.Visible = true;
                                this.panelXS.Visible = true;
                                this.btnSave.Visible = false;
                                this.Button5.Visible = false;
                            }
                        }
                        else if (PerNumber == "" || PerNumber == null)  // 第一次审批
                        {
                            //用当前登陆的用户名去上步指定人中去查询,能查到,说名指定了 
                            string CreatBy = "select Count(*) from SZOrdAuditing  left join SOrdArrangeMan on SZOrdAuditing.Per = SOrdArrangeMan.Guid where " +
                                             " Man  = '" + ViewState["Satff_Id"].ToString() + "' and  Order_ID = '" + Order_ID + "' and OrderArrange_Guid = '" + OrderArrange_Guid + "'";

                            if (db.GetDataScalar(CreatBy) == "0")
                            {
                                ButtonVisible();     //如果没有权限修改,就只能看勤务安排的内容
                                Panelvisible();
                                this.panelXS.Visible = true;
                                XSAP(OrderArrange_Guid);
                                XSAP2(OrderArrange_Guid);
                            }
                            else
                            {
                                ViewState["state"] = "SP";
                                ButtonVisible();
                                Panelvisible();
                                XSAP(OrderArrange_Guid);
                                XSAP2(OrderArrange_Guid);
                                this.panelPS.Visible = true;
                                this.panelAN.Visible = true;
                                this.panelXS.Visible = true;
                                this.btnSave.Visible = false;
                                this.Button5.Visible = false;
                            }
                        }
                        else if ((PerNumber != "" || PerNumber != null) && StatusId == "1")  // 审批并且下送后
                        {
                            ViewState["state"] = "Write";
                            Panelvisible();
                            XSAP(OrderArrange_Guid);
                            XSAP2(OrderArrange_Guid);
                            XSPS(OrderArrange_Guid);
                            XSAP2Edit(OrderArrange_Guid);
                            this.panelXS.Visible  = true;
                            this.panelAP1.Visible = true;
                            this.btnSave.Visible  = false;
                        }
                    }
                    catch
                    {
                    }
                }
            }
        }
        txtZCompere.Value  = hfStaffId1.Value.TrimEnd(',');
        txtFCompere.Value  = hfStaffId2.Value.TrimEnd(',');
        txtPrincipal.Value = hfStaffId3.Value.TrimEnd(',');
        txtXGMan.Value     = hfStaffId4.Value.TrimEnd(',');
    }