protected void Page_Load(object sender, EventArgs e)
        {
            Response.Buffer = true;
            Response.ExpiresAbsolute = DateTime.Now.AddSeconds(-1);
            Response.Expires = 0;
            Response.CacheControl = "no-cache";
            try
            {
                StimulationCheck stimuche = StimulationCheck.getNew();
                string SQLWhere = "StimulatedType='2' and StimulationId='" + stimuche.Id + "'";
                stimtype = StimulationType.SelecByWhere(SQLWhere);
                stimuappexist = StimulationAppliction.GetStimuAppWhere("StimulationAndTypeId='" + stimtype.Id + "'");
                if (!IsPostBack)
                {
                    this.SubmitApp.Attributes.Add("onclick", "javascript:return checkfill()");
                    BindPage();

                }
            }
            catch
            {
                Page.ClientScript.RegisterStartupScript(this.GetType(), "", "<script type='text/javascript'>alert('页面加载错误!将返回网站主页');window.location = '../../Home.aspx'</script>");
                return;
            }
        }
예제 #2
0
        protected void Page_Load(object sender, EventArgs e)
        {
            Response.Buffer = true;
            Response.ExpiresAbsolute = DateTime.Now.AddSeconds(-1);
            Response.Expires = 0;
            Response.CacheControl = "no-cache";
            StimulationCheck stimuche = StimulationCheck.getNew();
            string SQLWhere = "StimulatedType='2' and StimulationId='" + stimuche.Id + "'";
            StimulationType stimtype = StimulationType.SelecByWhere(SQLWhere);

            stimuappexist = StimulationAppliction.GetStimuAppWhere("StimulationAndTypeId='" + stimtype.Id + "'");
            if (stimuappexist != null)
            {
                attachmentList = CY.CSTS.Core.Business.Annex.SelectAnnexByContentID(stimuappexist.Id);
            }
            try
            {
                if (!IsPostBack)
                {

                    if (stimuappexist != null)
                    {

                        StimulationApplicationForCenter appforcenter = StimulationApplicationForCenter.Load(stimuappexist.Id);
                        this.labstatus.Text = appforcenter.Statename;
                        if (appforcenter.State == 2)
                        {

                            this.UndoApp.Visible = true;
                        }
                        else if (appforcenter.State == 1)
                        {
                            this.SubmitApp.Visible = true;
                            this.UndoApp.Visible = false;
                            this.EditApp.Visible = true;

                        }
                        else if (appforcenter.State == 4)
                        {
                            this.UndoApp.Visible = false;
                            this.EditApp.Visible = true;
                        }
                        else if (appforcenter.State == 3)
                        {
                            this.UndoApp.Visible = false;
                            this.EditApp.Visible = false;
                        }
                        else if (appforcenter.State == 6)
                        {
                            this.btnPrint.Visible = true;
                            this.UndoApp.Visible = false;
                            this.EditApp.Visible = false;
                        }
                        else
                        {
                            this.UndoApp.Visible = false;
                            this.EditApp.Visible = false;
                        }
                    }
                    else
                    {
                        this.UndoApp.Visible = false;
                        this.EditApp.Visible = false;
                    }

                    BindPage();

                }
            }
            catch
            {
                Page.ClientScript.RegisterStartupScript(this.GetType(), "", "<script type='text/javascript'>alert('页面加载错误!将返回网站主页');window.location = '../../home.aspx'</script>");
                return;
            }
        }
예제 #3
0
        protected void SubmitApp_Click(object sender, EventArgs e)
        {
            StimulationAppliction stimuapp = new StimulationAppliction();
            try
            {

                //StimulationCheck stimuche = StimulationCheck.getNew();
                //string SQLWhere = "StimulatedType='2' and StimulationId='" + stimuche.Id + "'";
                //StimulationType stimtype = StimulationType.SelecByWhere(SQLWhere);

                //stimuappexist = StimulationAppliction.GetStimuAppWhere("StimulationAndTypeId='" + stimtype.Id + "'");

                    StimulationApplicationForCenter appforcenter = StimulationApplicationForCenter.Load(stimuappexist.Id);
                    if (appforcenter.State == 1)
                    {
                        appforcenter.State = 2;
                    }
                    else if (appforcenter.State == 4)
                    {
                        appforcenter.State = 3;
                    }
                    appforcenter.Save();

                Response.Redirect("StimuAppServerView.aspx");

            }
            catch (Exception ex)
            {
                Page.ClientScript.RegisterStartupScript(this.GetType(), "", "<script type='text/javascript'>alert('考评申请提交失败!');</script>");

            }
        }
        protected void SaveApp_Click(object sender, EventArgs e)
        {
            StimulationAppliction stimuapp = new StimulationAppliction();
            try
            {
                //StimulationCheck stimuche = StimulationCheck.getNew();
                //string SQLWhere = "StimulatedType='2' and StimulationId='" + stimuche.Id + "'";
                //stimtype = StimulationType.SelecByWhere(SQLWhere);
                //stimuappexist = StimulationAppliction.GetStimuAppWhere("StimulationAndTypeId='" + stimtype.Id + "'");

                if (stimuappexist == null || stimuappexist.IsNew)
                {
                    stimuapp.StimulationAndTypeId = stimtype.Id;
                    stimuapp.Save();

                    StimulationApplicationForCenter appforcenter = new StimulationApplicationForCenter();

                    appforcenter.Id = stimuapp.Id;
                    appforcenter.DraftWriter = u.Name;//改
                    appforcenter.FillDate = DateTime.Now;
                    appforcenter.State = 1;
                    appforcenter.Save();
                    UploadFile(appforcenter.Id);
                    forcenteraddquestion(appforcenter);
                }
                else
                {
                    StimulationApplicationForCenter appforcenter = StimulationApplicationForCenter.Load(stimuappexist.Id);
                    appforcenter.DraftWriter = u.Name;//改
                    appforcenter.FillDate = DateTime.Now;
                    appforcenter.State = 1;
                    appforcenter.Save();
                    UploadFile(appforcenter.Id);
                    forcenteraddquestion(appforcenter);
                }
                Response.Redirect("StimuAppServerView.aspx");

            }
            catch (Exception ex)
            {
                Page.ClientScript.RegisterStartupScript(this.GetType(), "", "<script type='text/javascript'>alert('考评申请保存失败!');</script>");

            }
        }
예제 #5
0
        protected void SubmitApp_Click(object sender, EventArgs e)
        {
            StimulationAppliction stimuapp = new StimulationAppliction();
            try
            {
                //StimulationCheck stimuche = StimulationCheck.getNew();
                //string sqlwhere = "StimulationId='" + stimuche.Id.ToString() + "'" + "and StimulatedType='1'";
                //stimtype = StimulationType.SelecByWhere(sqlwhere);

                //stiforcrew = StimulationApplicationForCrew.FindMachineGroupNewestAppforCrew(stimtype.Id, SetID);
                if (stiforcrew.State == 1)
                {
                    stiforcrew.State = 2;
                }
                else if (stiforcrew.State == 4)
                {
                    stiforcrew.State = 3;
                }
                else if (stiforcrew.State == 8)
                {
                    stiforcrew.State = 7;
                }
                stiforcrew.update();
                Response.Redirect("StimuAppSetView.aspx?SetID=" + SetID);
            }
            catch (Exception ex)
            {
                Page.ClientScript.RegisterStartupScript(this.GetType(), "", "<script type='text/javascript'>alert('考评申请提交失败!');</script>");

            }
        }
예제 #6
0
        private void BindBtn(StimulationType stimulationType, int StimulatedType)
        {
            StimulationAppliction stimuappexist = new StimulationAppliction();
            switch (StimulatedType)
            {
                case 1:
                    try
                    {
                        bindSetGv();
                        //DataSet manchineDS = CY.Utility.Common.ListToDS.ToDataSet(manchinelist);
                        //manchineDS = HandMachine(manchineDS, stimulationType);
                        //this.RpMachinegroup.DataSource = manchineDS;
                        //this.RpMachinegroup.DataBind();

                    }
                    catch
                    {
                        clickenable = "false";
                    }

                    break;

                case 2: stimuappexist = StimulationAppliction.GetStimuAppWhere("StimulationAndTypeId='" + stimulationType.Id + "'");
                    if (u.UserType == 5)
                    {
                        if (stimulationType.State == 2)
                        {
                            if (stimuappexist == null)
                            {
                                this.btn_ServerApp.Enabled = true;
                                this.btn_ServeView.Enabled = false;
                            }
                            else
                            {
                                this.btn_ServerApp.Enabled = false;
                                this.btn_ServeView.Enabled = true;
                            }
                        }
                        else
                        {
                            this.btn_ServerApp.Enabled = false;
                            if (stimuappexist == null)
                            {

                                this.btn_ServeView.Enabled = false;
                            }
                            else
                            {

                                this.btn_ServeView.Enabled = true;
                            }
                        }
                    }
                    else
                    {
                        this.btn_ServerApp.Enabled = false;
                        this.btn_ServeView.Enabled = false;
                    }
                    break;
                case 3: StimulationApplicationForSubCenterAndCollaborateUnit stiforsub_coop = StimulationApplicationForSubCenterAndCollaborateUnit.FindUnitNewestAppforSub_Coop(stimulationType.Id, u.UnitID);
                    if (u.UserType == 6 || u.UserType == 7)
                    {
                        if (stimulationType.State == 2 || stimulationType.State == 3)
                        {
                            if (stiforsub_coop == null)
                            {
                                this.btn_ServerApp.Enabled = false;
                                this.btn_ServeView.Enabled = false;
                                this.btn_SubApp.Enabled = true;
                                this.btn_SubView.Enabled = false;
                            }
                            else
                            {
                                this.btn_ServerApp.Enabled = false;
                                this.btn_ServeView.Enabled = false;
                                this.btn_SubApp.Enabled = false;
                                this.btn_SubView.Enabled = true;
                            }
                        }
                        else
                        {
                            if (stiforsub_coop == null)
                            {

                                this.btn_SubView.Enabled = false;
                            }
                            else
                            {

                                this.btn_SubView.Enabled = true;
                            }
                        }
                    }
                    else
                    {
                        this.btn_SubApp.Enabled = false;
                        this.btn_SubView.Enabled = false;
                    }
                    break;
            }
        }
        protected void SubmitApp_Click(object sender, EventArgs e)
        {
            StimulationAppliction stimuapp = new StimulationAppliction();
            try
            {

                StimulationCheck stimuche = StimulationCheck.getNew();
                string SQLWhere = "StimulatedType='3' and StimulationId='" + stimuche.Id + "'";
                stimtype = StimulationType.SelecByWhere(SQLWhere);
                stiforsub_coop = StimulationApplicationForSubCenterAndCollaborateUnit.FindUnitNewestAppforSub_Coop(stimtype.Id, u.UnitID);
                if (stiforsub_coop == null)
                {
                    stimuapp.StimulationAndTypeId = stimtype.Id;
                    stimuapp.Save();
                    stiforsub_coop = new StimulationApplicationForSubCenterAndCollaborateUnit();
                    stiforsub_coop.Id = stimuapp.Id;
                    stiforsub_coop.UintId = u.UnitID;
                    stiforsub_coop.DraftWriter = u.Name;//改
                    stiforsub_coop.FillDate = DateTime.Now;
                    stiforsub_coop.State = 2;
                    stiforsub_coop.Save();
                    forsubaddquestion(stiforsub_coop);
                }
                else
                {

                    stiforsub_coop.DraftWriter = u.Name;//改
                    stiforsub_coop.FillDate = DateTime.Now;
                    if (stiforsub_coop.State == 1)
                    {
                        stiforsub_coop.State = 2;
                    }
                    else if (stiforsub_coop.State == 4)
                    {
                        stiforsub_coop.State = 3;
                    }
                    stiforsub_coop.Save();
                    forsubaddquestion(stiforsub_coop);
                }
                Response.Redirect("StimuAppSub_CoopView.aspx");
            }
            catch (Exception ex)
            {
                Page.ClientScript.RegisterStartupScript(this.GetType(), "", "<script type='text/javascript'>alert('考评申请提交失败!');");

            }
        }
예제 #8
0
        protected void SubmitApp_Click(object sender, EventArgs e)
        {
            StimulationAppliction stimuapp = new StimulationAppliction();
            try
            {

                //StimulationCheck stimuche = StimulationCheck.getNew();
                //string sqlwhere = "StimulationId='" + stimuche.Id.ToString() + "'" + "and StimulatedType='1'";
                //stimtype = StimulationType.SelecByWhere(sqlwhere);

                //appforcrew = StimulationApplicationForCrew.FindMachineGroupNewestAppforCrew(stimtype.Id, SetID);
                if (appforcrew == null)
                {
                    stimuapp.StimulationAndTypeId = stimtype.Id;
                    stimuapp.Save();
                    appforcrew = new StimulationApplicationForCrew();
                    appforcrew.Id = stimuapp.Id;
                    appforcrew.CrewId = new Guid(SetID);
                    appforcrew.DraftWriter = u.Name;//改
                    appforcrew.FillDate = DateTime.Now;
                    appforcrew.State = 2;
                    appforcrew.Save();
                    forcrewaddquestion(appforcrew);
                }
                else
                {

                    appforcrew.DraftWriter = u.Name;//改
                    appforcrew.FillDate = DateTime.Now;
                    if (appforcrew.State == 1)
                    {
                        appforcrew.State = 2;
                    }
                    else if (appforcrew.State == 4)
                    {
                        appforcrew.State = 3;
                    }
                    else if (appforcrew.State == 8)
                    {
                        appforcrew.State = 7;
                    }
                    appforcrew.update();
                    forcrewaddquestion(appforcrew);
                }
                Response.Redirect("StimuAppSetView.aspx?SetID=" + SetID);
            }
            catch (Exception ex)
            {
                Page.ClientScript.RegisterStartupScript(this.GetType(), "", "<script type='text/javascript'>alert('考评申请提交失败!');");

            }
        }