Ejemplo n.º 1
0
 protected void Page_Load(object sender, EventArgs e)
 {
     ProcessLogFileName = @"Excel\" + Session["UserName"].ToString() + "ProcessLog.txt";
     if (!Page.IsPostBack)
     {
         //RunByLabel.Text = Session["UserName"].ToString();
         CatBegTextBox.Focus();
         btnAccept.Visible        = false;
         ProcessPanel.Visible     = false;
         ActionPanel.Visible      = false;
         ActionSubmitButt.Visible = false;
         PrintButt.Visible        = false;
         SKUPanel.Visible         = false;
         FactorPrompt.Visible     = false;
         CPRFactor.Text           = "1";
         Session["PageOp"]        = "";
         string FullFilePath = Server.MapPath(ProcessLogFileName);
         using (StreamWriter sw = new StreamWriter(FullFilePath))
         {
             sw.WriteLine("Branch Stocking Analysis started at " + DateTime.Now.ToLongDateString() + " " + DateTime.Now.ToLongTimeString());
         }
         LoadBranches();
     }
     else
     {
         SKUPanel.Height    = int.Parse(yh.Text.ToString()) - 90;
         ActionPanel.Height = int.Parse(yh.Text.ToString()) - 90;
         ResultsUpdatePanel.Update();
     }
     ScriptManager1.AsyncPostBackTimeout = 1200;
     //ScriptManager1.SetFocus(CatBegTextBox);
     ScriptManager1.RegisterAsyncPostBackControl(BranchListButt);
     //lblErrorMessage.Text = Session["PageOp"];
 }
Ejemplo n.º 2
0
    protected void Page_Load(object sender, EventArgs e)
    {
        Users     usr  = (Users)Session["Identify"];
        BasicInfo info = BasicInfo.GetBasicInfoByID(usr.UserID);

        if (!PageAuthorityManage.hasAuthority(info, "固定资产申购"))
        {
            Response.Write("<script Language='JavaScript'>alert('抱歉!您没有此操作的权限');window.location.href ='../Account/ApplyListPage.aspx'</script>");
        }

        ScriptManager1.RegisterAsyncPostBackControl(addRow);
        if (ViewState["count"] != null)
        {
            for (int i = 0; i < Convert.ToInt16(ViewState["count"]); i++)
            {
                addNewRow();
            }
        }
        if (!IsPostBack)
        {
            DataSet allPro = ProjectInfo.GetAllProjects();
            projectCodeList.DataSource     = allPro.Tables[0].DefaultView;
            projectCodeList.DataTextField  = "ProjectName";
            projectCodeList.DataValueField = "ProjectCode";
            projectCodeList.DataBind();

            staffName.Text  = info.StaffName;
            department.Text = info.Department;
            applyDate.Text  = DateTime.Today.ToShortDateString();
        }
    }
Ejemplo n.º 3
0
    protected void Page_Load(object sender, EventArgs e)
    {
        ScriptManager1.RegisterAsyncPostBackControl(lkbBuscar);       // Da um postback async ao clicar no botao pesquisar para nao atualizar a pagina inteira
        if (!IsPostBack)                                              //Se nao for postback, ou seja, se estiver carregando a pagina pela primeira vez
        {
            CarregaGrid();                                            //chama o método carregaGrid();

            DataSet dsSem      = Semestre_Ano_DB.SelectSemestreAno(); //preenche o dataset com o retorno do método pegando todos semestre ano
            DataSet dsPIsFatec = Curso.SelecionarTodos();             //preenche o dataset com o retorno do método pegando todos os cursos que vem do banco da FATEC

            //preenche a dropdown curso com o dataset criado anteriormente dsPIsFatec
            ddlCurso.DataSource     = dsPIsFatec.Tables[0];
            ddlCurso.DataTextField  = "Sigla";
            ddlCurso.DataValueField = "Codigo";
            ddlCurso.DataBind();
            ddlCurso.Items.Insert(0, new ListItem("Selecione", "0"));

            //preenche a dropdown semestre/ano com o dataset criado anteriormente dsSem
            ddlSemestreAno.DataSource     = dsSem;
            ddlSemestreAno.DataTextField  = "concat(SAN_ANO,'-',SAN_SEMESTRE)";
            ddlSemestreAno.DataValueField = "SAN_CODIGO";
            ddlSemestreAno.DataBind();
            ddlSemestreAno.Items.Insert(0, new ListItem("Selecione", "0"));

            //preenche a dropdown status manualmente por serem valores fixos
            ddlStatus.Items.Insert(0, new ListItem("Selecione", "0"));
            ddlStatus.Items.Insert(1, new ListItem("Finalizado", "1"));
            ddlStatus.Items.Insert(2, new ListItem("Em andamento", "2"));
        }
    }
    public void choose(Button o)
    {
        ScriptManager1.RegisterAsyncPostBackControl(this.Button1);
        ScriptManager1.RegisterAsyncPostBackControl(this.Button2);
        timetablelinqDataContext db = new timetablelinqDataContext();
        var results = from r in db.ordertable
                      where r.month.ToString() + "月" + r.day.ToString() + "日" == o.Text.ToString()
                      select r;

        for (int i = 1; i <= 91; i++)
        {
            hoverbutton k = (hoverbutton)this.FindControl("b" + i.ToString());
            k.enabled = true;
        }

        if (results.FirstOrDefault() != null)
        {
            foreach (var r in results)
            {
                int         a = r.addressid;
                int         d = int.Parse(r.hour.ToString().Substring(0, 2));
                hoverbutton c = (hoverbutton)this.FindControl("b" + ((a - 1) * 13 + d - 7).ToString());
                c.enabled = false;
            }
        }

        Session["date"] = o.Text.ToString();
    }
Ejemplo n.º 5
0
        protected void PreRenderBtnTrigger(object sender, EventArgs e)
        {
            Button btn = (Button)sender;

            ScriptManager1.RegisterAsyncPostBackControl(btn);
            AchievementsUpdatePanel.Update();
        }
Ejemplo n.º 6
0
        protected void Page_Load(object sender, EventArgs e)
        {
            try
            {
                ScriptManager1.RegisterAsyncPostBackControl(Btn_Send);
                //ScriptManager1.RegisterAsyncPostBackControl(Timer1);
                litMessages.SelectedIndex = litMessages.Items.Count - 1;

                if (!IsPostBack && Session["LoggedIn"] != null && Session["LoggedIn"].ToString() != "true")
                {
                    dtCheck = DateTime.Now.ToString();
                    string roomID = Request["roomID"];
                    lblRoomID.Text = roomID;
                    this.InsertMessage(ConfigurationManager.AppSettings["ChatLoggedInText"] + "" + DateTime.Now.ToString());
                    litMessages.SelectedIndex = litMessages.Items.Count - 1;
                    this.GetLoggenInUser();
                }
                else
                {
                    dtCheck = DateTime.Now.ToString();
                    string roomID = Request["roomID"];
                    lblRoomID.Text            = roomID;
                    litMessages.SelectedIndex = litMessages.Items.Count - 1;
                }
            }
            catch (Exception ex)
            {
                Console.WriteLine(ex);
            }
        }
Ejemplo n.º 7
0
    protected void Page_Load(object sender, EventArgs e)
    {
        Users     usr  = (Users)Session["Identify"];
        BasicInfo info = BasicInfo.GetBasicInfoByID(usr.UserID);

        if (!PageAuthorityManage.hasAuthority(info, "出差报销"))
        {
            Response.Write("<script Language='JavaScript'>alert('抱歉!您没有此操作的权限');window.location.href ='../Account/ApplyListPage.aspx'</script>");
        }

        ScriptManager1.RegisterAsyncPostBackControl(projectNameList);
        if (!IsPostBack)
        {//首次加载才需要绑定
            DataSet allPro = ProjectInfo.GetAllProjects();
            projectNameList.DataSource     = allPro.Tables[0].DefaultView;
            projectNameList.DataTextField  = "ProjectName";
            projectNameList.DataValueField = "ProjectName";
            projectNameList.DataBind();
            accountList.DataSource     = allPro.Tables[0].DefaultView;
            accountList.DataTextField  = "ProjectAccount";
            accountList.DataValueField = "ProjectAccount";
            accountList.DataBind();

            accountList.SelectedValue = ProjectInfo.GetProjectInfoByName(projectNameList.SelectedValue).ProjectAccount;

            staffName.Text  = info.StaffName;
            department.Text = info.Department;
            applyDate.Text  = DateTime.Today.ToShortDateString();
        }



        //
    }
    protected void Page_Load(object sender, EventArgs e)
    {
        //页面载入之前,先进行登录检查以及权限检查

        ScriptManager1.RegisterAsyncPostBackControl(this.DropDownList_Grade);
        // ScriptManager1.RegisterAsyncPostBackControl(this.lessLessonTime);
        if (!IsPostBack)  // 如果是为响应客户端回发而加载该页,则为 true;否则为 false。
        {
            if (!(LoginAndPermissionChecking.LoginChecking()))
            {
                Response.Redirect("/ErrorPage/error_NotLogin.aspx");
            }
            if (!(LoginAndPermissionChecking.PermissionChecking(PermissionEnum.EducationDean)))
            {
                Response.Redirect("/ErrorPage/error_DeniedPermission.aspx");
            }
            ListItem i1 = new ListItem(HttpUtility.HtmlDecode("&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;") + "初一", "1");
            ListItem i2 = new ListItem(HttpUtility.HtmlDecode("&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;") + "初二", "2");
            ListItem i3 = new ListItem(HttpUtility.HtmlDecode("&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;") + "初三", "3");
            DropDownList_Grade.Items.Add(i1);//这里这么做完全是为了显示的时候可以居中,没别的意思
            DropDownList_Grade.Items.Add(i2);
            DropDownList_Grade.Items.Add(i3);

            SetItemForChoosableCourse();
        }
        Page.MaintainScrollPositionOnPostBack = true; //刷新后滚动条回到之前的位置,但是会导致页面闪烁
                                                      // Page.MaintainScrollPositionOnPostBack = false;//刷新后滚动条回到顶部
        SelectCourseByGrade();                        //一开始显示默认的年级的科目
    }
Ejemplo n.º 9
0
    protected void Page_Load(object sender, EventArgs e)
    {
        if (IsPostBack)
        {
            StallID = Convert.ToInt16(ViewState["StallID"].ToString());
        }
        else
        {
            // Only bind if this is not a postback
            BindList();
        }

        int totalRows = ProductList.Rows.Count;

        rowChanged = new bool[totalRows];
        rowDeleted = new bool[totalRows];

        ViewState.Add("StallID", StallID);

        foreach (GridViewRow row in ProductList.Rows)
        {
            var checkBox = row.FindControl("cbDelete");
            ScriptManager1.RegisterAsyncPostBackControl(checkBox);
        }
    }
Ejemplo n.º 10
0
 protected void Page_Load(object sender, EventArgs e)
 {
     ScriptManager1.RegisterAsyncPostBackControl(Button1);
     id3 = Convert.ToInt32(Request.Params["type"]);
     id1 = Convert.ToInt32(Request.Params["id"]);
     fengye();
 }
Ejemplo n.º 11
0
    protected void dlBlogComments_ItemDataBound(object sender, DataListItemEventArgs e)
    {
        //LinkButton delete_button = (LinkButton)dlBlogComments.FindControl("lnkbtnDelete");
        try
        {
            if (Convert.ToInt32(DataBinder.Eval(e.Item.DataItem, "poster_id")) == Convert.ToInt32(Session["user_id"]) && Convert.ToInt32(DataBinder.Eval(e.Item.DataItem, "is_admin")) == 0)
            {
                System.Web.UI.HtmlControls.HtmlGenericControl divoptions = (System.Web.UI.HtmlControls.HtmlGenericControl)e.Item.FindControl("div_blog_comment_options");

                LinkButton DeleteButton = new LinkButton();
                DeleteButton.ID              = "lnkbtnDelete";
                DeleteButton.Command        += new CommandEventHandler(lnkbtnDelete_Command);
                DeleteButton.CommandArgument = DataBinder.Eval(e.Item.DataItem, "comment_id").ToString();
                DeleteButton.CssClass        = "lnkbtnDelete";
                DeleteButton.Text            = "Delete";

                divoptions.Controls.Add(DeleteButton);

                ScriptManager1.RegisterAsyncPostBackControl(DeleteButton);


                //add the profile pic of the commenter
            }

            Image imgpp = (Image)e.Item.FindControl("img_commenter_pic");
            imgpp.ImageUrl = GetImageUrl(Convert.ToInt32(DataBinder.Eval(e.Item.DataItem, "poster_id")), Convert.ToInt16(DataBinder.Eval(e.Item.DataItem, "is_admin")));
        }

        catch (Exception ex)
        {
            ErrorReportBAL error = new ErrorReportBAL();
            error.SendErrorReport("ViewPost.aspx", ex.ToString());
            Response.Write("<script>alert('Some Error Occured \n Sorry for inconvenience');</script>");
        }
    }
Ejemplo n.º 12
0
    protected void Page_Load(object sender, EventArgs e)
    {
        ScriptManager1.RegisterAsyncPostBackControl(lkbPesquisar);
        ScriptManager1.RegisterPostBackControl(ddlAcao);
        ScriptManager1.RegisterPostBackControl(ddlTabela);

        if (!IsPostBack)
        {
            CarregarGridAuditoria();
            //updFiltro.Update();
            UpdatePanelAuditoria.Update();
            //UpdatePanelAuditoria.Update();

            ddlAcao.Items.Insert(0, new ListItem("Selecione", "SELECIONE"));
            ddlAcao.Items.Insert(1, new ListItem("Inserção", "INSERCAO"));
            ddlAcao.Items.Insert(2, new ListItem("Alteração", "ALTERACAO"));
            ddlAcao.Items.Insert(3, new ListItem("Exclusão", "EXCLUSAO"));

            ddlTabela.Items.Insert(0, new ListItem("Selecione", "SELECIONE"));
            ddlTabela.Items.Insert(1, new ListItem("Critérios Gerais", "CGE_CRITERIOS_GERAIS"));
            ddlTabela.Items.Insert(2, new ListItem("Criterios do PI", "CPI_CRITERIO_PI"));
            ddlTabela.Items.Insert(3, new ListItem("Eventos", "EVE_EVENTOS"));
            ddlTabela.Items.Insert(4, new ListItem("Alunos do grupo", "GAL_GRUPO_ALUNO"));
            ddlTabela.Items.Insert(5, new ListItem("Grupo", "GRU_GRUPO"));
            ddlTabela.Items.Insert(6, new ListItem("Histórico do Aluno", "HIS_HISTORICO_ALUNO_DISCIPLINA"));
            ddlTabela.Items.Insert(7, new ListItem("Mensagens", "MSG_MENSAGEM"));
            ddlTabela.Items.Insert(8, new ListItem("Coordenadores", "PER_PERFIL"));
            ddlTabela.Items.Insert(9, new ListItem("Requerimento", "REQ_REQUERIMENTO"));
        }

        ddlAcao.AutoPostBack   = false;
        ddlTabela.AutoPostBack = false;
    }
Ejemplo n.º 13
0
        protected void Page_Load(object sender, EventArgs e)
        {
            bAdd.Attributes.Add("onclick", " this.disabled = true; " + ClientScript.GetPostBackEventReference(bAdd, null) + ";");
            //tbCar.Attributes["onclick"] = "chbManual.Checeked = !chbManual.Checeked";
            string tmp = ClientScript.GetPostBackEventReference(bAdd, null);

            ScriptManager1.RegisterAsyncPostBackControl(bAdd);
            DA = new SqlDataAdapter();
            DS = new DataSet();
            DA.SelectCommand            = new SqlCommand();
            DA.SelectCommand.Connection = new SqlConnection("Data Source=127.0.0.1;Initial Catalog=CWM;Persist Security Info=True;User ID=CWM;Password=manager");
            if (!Page.IsPostBack)
            {
                JOB job = (JOB)Session["JOB"];
                DA.SelectCommand.CommandText = "select ID,PNAME from CWM..PRICELIST where IDCLASS = " + job.IDCLASS
                                               + " order by PNAME";
                DS = new DataSet();
                DA.Fill(DS, "PRICE");
                chblPrice.DataSource     = DS.Tables["PRICE"];
                chblPrice.DataTextField  = "PNAME";
                chblPrice.DataValueField = "ID";
                chblPrice.DataBind();
                chblPrice.RepeatColumns = 2;
            }
        }
Ejemplo n.º 14
0
    protected void Page_Load(object sender, EventArgs e)
    {
        //Register Update Trigger
        ScriptManager1.RegisterAsyncPostBackControl(ButtonInv1);

        SqlConnection  conn        = new SqlConnection(ConfigurationManager.ConnectionStrings["MeetMeConnectionString"].ConnectionString);
        SqlDataAdapter sdaUserData = new SqlDataAdapter("select * from Users where email='" + Session["New"].ToString() + "'", conn);
        DataTable      dt          = new DataTable();

        sdaUserData.Fill(dt);
        UID = dt.Rows[0]["UserID"].ToString();


        //Notification System
        SqlDataAdapter sdaMesaje = new SqlDataAdapter("select * from Mesaje where userId='" + UID + "'", conn);
        DataTable      dtt       = new DataTable();

        sdaMesaje.Fill(dtt);

        foreach (DataRow msgRes in dtt.Rows)
        {
            if (msgRes["seen"].ToString().Trim() == "no")
            {
                chatTab.Attributes.Add("style", "background-color:#b50000; border-radius: 5px;");

                break;
            }
        }

        SqlDataAdapter sdaFriendReq = new SqlDataAdapter("select * from FriendRequests where userId='" + UID + "'", conn);
        DataTable      dt1          = new DataTable();

        sdaFriendReq.Fill(dt1);

        foreach (DataRow friendReqRes in dt1.Rows)
        {
            if (friendReqRes["seen"].ToString().Trim() == "no")
            {
                testDepTxt.Attributes.Add("style", "background-color:#b50000; border-radius: 5px;");

                break;
            }
        }

        SqlDataAdapter sdaDateReq = new SqlDataAdapter("select * from DateRequests where fId='" + UID + "'", conn);
        DataTable      dt2        = new DataTable();

        sdaDateReq.Fill(dt2);

        foreach (DataRow dateReqRes in dt2.Rows)
        {
            if (dateReqRes["seen"].ToString().Trim() == "no")
            {
                dateReqTab.Attributes.Add("style", "background-color:#b50000; border-radius: 5px;");

                break;
            }
        }
    }
Ejemplo n.º 15
0
    protected void Page_Load(object sender, EventArgs e)
    {
        ScriptManager1.RegisterAsyncPostBackControl(Slider1);

        if (Page.IsPostBack)
        {
            lblUpdateDate.Text = "Changed at: " + DateTime.Now.ToLongTimeString();
        }
    }
Ejemplo n.º 16
0
 protected void Page_Load(object sender, EventArgs e)
 {
     ScriptManager1.RegisterAsyncPostBackControl(lkbQuit);//注册退出按钮,控制上方用户名/退出按钮异步刷新
     //更新首页上的用户名
     if (Session["User"] != null)
     {
         Customer customer = (Customer)Session["User"];
         lblNameInput.Text = customer.Name;
     }
 }
Ejemplo n.º 17
0
 protected void Page_Load(object sender, EventArgs e)
 {
     ScriptManager1.RegisterAsyncPostBackControl(addRow);
     if (ViewState["count"] != null)
     {
         for (int i = 0; i < Convert.ToInt16(ViewState["count"]); i++)
         {
             addNewRow();
         }
     }
 }
Ejemplo n.º 18
0
    /*
     * protected override void OnLoad(EventArgs e)
     * {
     *
     * }
     */
    protected void Page_Load(object sender, EventArgs e)
    {
        //外部添加局部刷新控件
        ScriptManager1.RegisterAsyncPostBackControl(this.DropDownList_Grade);
        ScriptManager1.RegisterAsyncPostBackControl(this.DropDownList_semester);
        ScriptManager1.RegisterAsyncPostBackControl(this.DropDownList_year);
        if (!IsPostBack)
        {
            if (!(LoginAndPermissionChecking.LoginChecking()))
            {
                Response.Redirect("/ErrorPage/error_NotLogin.aspx");
            }
            if (!(LoginAndPermissionChecking.PermissionChecking(PermissionEnum.EducationDean)))
            {
                Response.Redirect("/ErrorPage/error_DeniedPermission.aspx");
            }
            //首先先检查是否有gcgFeedBack这张表,如果不存在就新建
            string         sql_LookForgcgFeedBack = "select * from sysobjects where name = 'gcgFeedBack' and xtype = 'U'";
            DBManipulation dbm = new DBManipulation();
            object         o   = dbm.ExecuteScalar(sql_LookForgcgFeedBack, null);
            if (o == null)
            {
                string sql_CreategcgFeedBack = "create table gcgFeedBack(" +
                                               "class_id char(4) not null," +
                                               "CourseNo char(3) not null," +
                                               "TeacherNo char(8) not null," +
                                               "primary key(class_id, CourseNo)" +
                                               ")";
                dbm.ExecuteNonQuery(sql_CreategcgFeedBack, null);
            }

            /*create table gcgFeedBack(  --排课组内部专用表
             *      class_id char(4) not null,
             *      CourseNo char(3) not null,
             *      TeacherNo char(8) not null,
             *      primary key(class_id,CourseNo)
             * )*/
            //页面第一次载入之前,要查询gcgFeedBack授课安排反馈表,看看是不是还有未确认的反馈信息
            string sql = "select class_id,CourseNo from gcgFeedBack";
            // DBManipulation dbm = new DBManipulation();
            SqlDataReader dr = dbm.ExecuteQueryOnLine(sql, null);
            while (dr.Read())
            {
                string buttonName = dr.GetString(0) + dr.GetString(1);
                //Session[buttonName] = "nameRedButton";//我们使用Session保存有意见的老师安排的css样式
                Session[buttonName] = "aspTableCellBrown2";//把原先红色的恢复成黑色
            }
            dr.Close();
            dbm.Close();
        }

        createtable(GetSemesterNo());
    }
Ejemplo n.º 19
0
        protected void Page_Init(object sender, EventArgs e)
        {
            if (!IsPostBack)
            {
                this.ClearSession(this.ID);
            }

            this.InitializeControls();
            this.LoadValuesFromSession();
            this.BindGridView();
            ScriptManager1.RegisterAsyncPostBackControl(ProductGridView);
        }
Ejemplo n.º 20
0
        protected void Page_Load(object sender, EventArgs e)
        {
            ScriptManager1.RegisterAsyncPostBackControl(calendarTanggalLahir);

            if (Session["user_to_edit"] != null)
            {
                selectedUser     = (User)Session["user_to_edit"];
                txtUsername.Text = selectedUser.username;
                txtName.Text     = selectedUser.name;
                txtPassword.Attributes.Add("value", selectedUser.password);
                roleDropDownList.SelectedValue    = selectedUser.role;
                calendarTanggalLahir.SelectedDate = (DateTime)selectedUser.birthday;
            }
        }
Ejemplo n.º 21
0
    protected void Page_Load(object sender, EventArgs e)
    {
        ScriptManager1.RegisterAsyncPostBackControl(reason);
        if (!IsPostBack)
        {//初次加载
         //DataSet allDep = Department.GetAllDepartment();
         //depList.DataSource = allDep.Tables[0].DefaultView;
         //depList.DataTextField = "DepartmentName";
         //depList.DataValueField = "DepartmentID";
         //depList.DataBind();

            //Users usr=(Users)Session["Identify"];
            //DataSet allPro = ProjectInfo.GetProjectByUserID(usr.UserID);
            //proManagerList.DataSource = allPro.Tables[0].DefaultView;
            //proManagerList.DataTextField = "Manager";
            //proManagerList.DataValueField = "Manager";
            //proManagerList.DataBind();
        }
    }
Ejemplo n.º 22
0
    protected void Page_Load(object sender, EventArgs e)
    {
        Users     usr  = (Users)Session["Identify"];
        BasicInfo info = BasicInfo.GetBasicInfoByID(usr.UserID);

        if (!PageAuthorityManage.hasAuthority(info, "资金使用审批"))
        {
            Response.Write("<script Language='JavaScript'>alert('抱歉!您没有此操作的权限');window.location.href ='../Account/ApplyListPage.aspx'</script>");
        }
        ScriptManager1.RegisterAsyncPostBackControl(money);
        if (!IsPostBack)
        {
            DataSet allPro = ProjectInfo.GetAllProjects();
            projectCodeList.DataSource     = allPro.Tables[0].DefaultView;
            projectCodeList.DataTextField  = "ProjectName";
            projectCodeList.DataValueField = "ProjectCode";
            projectCodeList.DataBind();

            staffName.Text  = info.StaffName;
            department.Text = info.Department;
        }
    }
Ejemplo n.º 23
0
    protected void Page_Load(object sender, EventArgs e)
    {
        ScriptManager1.RegisterAsyncPostBackControl(this.TextBox_11);
        ScriptManager1.RegisterAsyncPostBackControl(this.TextBox_12);
        ScriptManager1.RegisterAsyncPostBackControl(this.TextBox_21);
        ScriptManager1.RegisterAsyncPostBackControl(this.TextBox_22);
        ScriptManager1.RegisterAsyncPostBackControl(this.TextBox_31);
        ScriptManager1.RegisterAsyncPostBackControl(this.TextBox_32);
        ScriptManager1.RegisterAsyncPostBackControl(this.TextBox_41);
        ScriptManager1.RegisterAsyncPostBackControl(this.TextBox_42);
        ScriptManager1.RegisterAsyncPostBackControl(this.TextBox_51);
        ScriptManager1.RegisterAsyncPostBackControl(this.TextBox_52);
        ScriptManager1.RegisterAsyncPostBackControl(this.TextBox_61);
        ScriptManager1.RegisterAsyncPostBackControl(this.TextBox_62);
        ScriptManager1.RegisterAsyncPostBackControl(this.TextBox_71);
        ScriptManager1.RegisterAsyncPostBackControl(this.TextBox_72);
        ScriptManager1.RegisterAsyncPostBackControl(this.TextBox_81);
        ScriptManager1.RegisterAsyncPostBackControl(this.TextBox_82);
        //ScriptManager1.RegisterAsyncPostBackControl(this.DropDownList_Grade);
        //ScriptManager1.RegisterAsyncPostBackControl(this.DropDownList_Week);
        //不能使用UpdatePanel绑定两个下拉框,否则页面不会刷新。,这是为什么呢?
        // ScriptManager1.RegisterAsyncPostBackControl(this.Button_submit);

        if (!IsPostBack)
        {// 如果是为响应客户端回发而加载该页,则为 true;否则为 false。
         // ScriptManager1.RegisterAsyncPostBackControl(this.Button_submit);

            if (!(LoginAndPermissionChecking.LoginChecking()))
            {
                Response.Redirect("/ErrorPage/error_NotLogin.aspx");
            }
            if (!(LoginAndPermissionChecking.PermissionChecking(PermissionEnum.EducationDean)))
            {
                Response.Redirect("/ErrorPage/error_DeniedPermission.aspx");
            }

            SetValueForHtmlTextBox();
        }
    }
Ejemplo n.º 24
0
    protected void Page_Load(object sender, EventArgs e)
    {
        Users     usr  = (Users)Session["Identify"];
        BasicInfo info = BasicInfo.GetBasicInfoByID(usr.UserID);

        if (!PageAuthorityManage.hasAuthority(info, "车辆使用登记"))
        {
            Response.Write("<script Language='JavaScript'>alert('抱歉!您没有此操作的权限');window.location.href ='ApplyListPage.aspx'</script>");
        }
        ScriptManager1.RegisterAsyncPostBackControl(addRow);
        if (ViewState["count"] != null)
        {
            for (int i = 0; i < Convert.ToInt16(ViewState["count"]); i++)
            {
                addNewRow();
            }
        }
        if (!IsPostBack)
        {
            staffName.Text  = info.StaffName;
            department.Text = info.Department;
        }
    }
Ejemplo n.º 25
0
    protected void gv_measures_RowDataBound(object sender, GridViewRowEventArgs e)
    {
        GridViewRow row = e.Row;

        if (row.RowType == DataControlRowType.DataRow)
        {
            Button btn = (Button)e.Row.FindControl("btnGetMeasureDetails");
            if (btn != null)
            {
                ScriptManager1.RegisterPostBackControl(btn);
            }
            Button btn2 = (Button)e.Row.FindControl("btnUpdateMeasureStats");
            if (btn2 != null)
            {
                string needupdate = Convert.ToString(DataBinder.Eval(e.Row.DataItem, "data_lastupdated"));

                ScriptManager1.RegisterAsyncPostBackControl(btn2);
                btn2.Visible = (needupdate.Contains("update") ? true : false);

                //Readd
                btn2.Visible = true;
            }
        }
    }
Ejemplo n.º 26
0
 protected void Page_Load(object sender, EventArgs e)
 {
     ScriptManager1.RegisterAsyncPostBackControl(DataList1);
     Label1.Text = DateTime.Now.ToString();
 }
Ejemplo n.º 27
0
    protected void Page_Load(object sender, EventArgs e)
    {
        //ScriptManager1.RegisterAsyncPostBackControl(this.DropDownList_Grade);
        ScriptManager1.RegisterAsyncPostBackControl(this.DropDownList_Course);
        ScriptManager1.RegisterAsyncPostBackControl(this.DropDownList_semester);
        ScriptManager1.RegisterAsyncPostBackControl(this.DropDownList_year);
        if (!IsPostBack)
        {
            if (!(LoginAndPermissionChecking.LoginChecking()))
            {
                Response.Redirect("/ErrorPage/error_NotLogin.aspx");
            }
            if (!(LoginAndPermissionChecking.PermissionChecking(PermissionEnum.CourseMaster)))
            {
                Response.Redirect("/ErrorPage/error_DeniedPermission.aspx");
            }

            Object o = Session["subjectGroupName"];
            if (o == null)
            {
                Response.Redirect("/login/login.aspx");
            }
            else
            {
                //Label_SubjectGroup.Text = Request.QueryString["subjectGroupName"].ToString();
                Label_SubjectGroup.Text = Session["subjectGroupName"].ToString();
            }
            ProvideDataForSelectSubject();

            //页面刚刚载入的时候查询学科表中所有学科的对应课时数,并放置在一张学科课时表中,以待后面使用
            string                    sql_MappingCourseNoAndCourseTime = "select CourseNo,CourseTime from gcgCourse";
            DBManipulation            dbm = new DBManipulation();
            SqlDataReader             dr  = dbm.ExecuteQueryOnLine(sql_MappingCourseNoAndCourseTime, null);
            Dictionary <string, Byte> dict_CourseNo_CourseTime = new Dictionary <string, Byte>();
            while (dr.Read())
            {
                dict_CourseNo_CourseTime.Add(dr.GetString(0), dr.GetByte(1));
            }
            dr.Close();
            dbm.Close();
            Cache["dict_CourseNo_CourseTime"] = dict_CourseNo_CourseTime;

            //同时计算所有老师的授课课时数,放在一个映射表中,以待后面使用
            string    sql_getTeacherSet = "select TeacherNo from temp_teacher";
            DataSet   ds           = dbm.ExecuteQueryOffLine(sql_getTeacherSet, null);
            DataTable teacherTable = ds.Tables["defaultTable"];
            Dictionary <string, int> dict_TeacherNo_CourseTime = new Dictionary <string, int>();
            foreach (DataRow r in teacherTable.Rows)
            {
                string TeacherNo            = r["TeacherNo"].ToString();
                string sql_countTeacherTime = "select sum(CourseTime) from gcgLectureForm,temp_teacher,gcgCourse " +
                                              "where gcgLectureForm.TeacherNo = temp_teacher.TeacherNo " +
                                              "and gcgLectureForm.CourseNo = gcgCourse.CourseNo " +
                                              "and temp_teacher.TeacherNo = '" + TeacherNo + "'";
                //  DBManipulation dbm = new DBManipulation();
                object obj = dbm.ExecuteScalar(sql_countTeacherTime, null);
                if (obj == null || obj.ToString() == "")
                {//还没有给这个老师安排带班
                    dict_TeacherNo_CourseTime[TeacherNo] = 0;
                }
                else
                {
                    dict_TeacherNo_CourseTime[TeacherNo] = int.Parse(obj.ToString());
                }
            }
            Cache["dict_TeacherNo_CourseTime"] = dict_TeacherNo_CourseTime;
            //保存每一个下拉菜单的索引值,方便下面进行课时计算
            CreateTableBasedOnClass();
            setDataForEachTeacherDropDownList();
            foreach (DropDownList l in DropDownList_select)
            {
                Session[l.ID] = l.SelectedIndex;//使用对象的唯一标识符作为唯一ID保存
            }
        }
        //debug1.Text = Request.QueryString["subjectGroupName"].ToString();
        CreateTableBasedOnClass();
        setDataForEachTeacherDropDownList();
        //  Page.MaintainScrollPositionOnPostBack = true;//刷新后滚动条回到之前的位置,但是会导致页面闪烁
    }
Ejemplo n.º 28
0
        protected void Page_Load(object sender, EventArgs e)
        {
            tbCar.Attributes["onclick"] = "chbManual.Checeked = !chbManual.Checeked";
            ScriptManager1.RegisterAsyncPostBackControl(bAdd);
            DA                           = new SqlDataAdapter();
            DS                           = new DataSet();
            DSJ                          = new DataSet();
            DSP                          = new DataSet();
            DSPA                         = new DataSet();
            DSD                          = new DataSet();
            DSPAD                        = new DataSet();
            DA.SelectCommand             = new SqlCommand();
            DA.SelectCommand.Connection  = new SqlConnection("Data Source=127.0.0.1;Initial Catalog=CWM;Persist Security Info=True;User ID=CWM;Password=manager");
            DA.SelectCommand.CommandText = "select * from JOB where ID = " + Request["idj"];
            DA.Fill(DSJ, "J");

            /*string ch = DSJ.Tables[0].Rows[0]["PLUS_50"].ToString();
             * if (DSJ.Tables[0].Rows[0]["PLUS_50"].ToString() == "True")
             * {
             *  Plus_50 = true;
             * }
             * else
             * {
             *  Plus_50 = false;
             * }*/
            //Plus_50 = (DSJ.Tables[0].Rows[0]["PLUS_50"].ToString() == "true") ? true : false;
            //if (Plus_50 == null)
            //{
            //  Plus_50 = false;
            //}
            //Plus_50 = o;
            DA.SelectCommand.CommandText = "select * from PACKAGE where ( DELETED = 0 or DELETED is null ) and IDJOB = " + Request["idj"];
            DA.Fill(DSP, "P");
            DA.SelectCommand.CommandText = "select * from PACKAGE where DELETED = 1 and IDJOB = " + Request["idj"];
            DA.Fill(DSD, "D");

            /*DA.SelectCommand.CommandText = "select * from PACKAGEADDSERV where ( DELETED = 0 or DELETED is null ) and IDJOB = " + Request["idj"];
             * DA.Fill(DSPA, "PA");
             * DA.SelectCommand.CommandText = "select * from PACKAGEADDSERV where DELETED = 1 and IDJOB = " + Request["idj"];
             * DA.Fill(DSPAD, "PAD");*/
            if (Session["delp"] != null)
            {
                DeletedServices = Session["delp"] as List <int>;
            }
            if (Session["delpa"] != null)
            {
                DeletedServicesA = Session["delpa"] as List <int>;
            }
            if (!Page.IsPostBack)
            {
                if ((int)DSJ.Tables[0].Rows[0]["TOTALCOST"] == 0)
                {
                    ddlSpecial.SelectedIndex = 1;
                }
                else
                {
                    ddlSpecial.SelectedIndex = 0;
                }

                DeletedServices = new List <int>();
                foreach (DataRow r in DSD.Tables["D"].Rows)
                {
                    DeletedServices.Add((int)r["IDPRICE"]);
                }
                Session.Add("delp", DeletedServices);

                DeletedServicesA = new List <int>();

                /*foreach (DataRow r in DSPAD.Tables["PAD"].Rows)
                 * {
                 *  DeletedServicesA.Add((int)r["IDADDSERV"]);
                 * }*/
                Session.Add("delpa", DeletedServicesA);

                tbPlate.Text = DSJ.Tables["J"].Rows[0]["NPLATE"].ToString();
                DA.SelectCommand.CommandText = "select ID,LNAME from CWM..LINE";
                DA.Fill(DS, "L");

                ddlLine.DataSource     = DS.Tables["L"];
                ddlLine.DataTextField  = "LNAME";
                ddlLine.DataValueField = "ID";
                ddlLine.DataBind();
                foreach (ListItem it in ddlLine.Items)
                {
                    if (it.Value == DSJ.Tables["J"].Rows[0]["LINE"].ToString())
                    {
                        it.Selected = true;
                        break;
                    }
                }
                DA.SelectCommand.CommandText = "select ID,ENAME from CWM..EMPLOYEE where (DELETED != 1 or DELETED is null) order by ENAME";
                DA.Fill(DS, "E");
                DataView dve = new DataView();
                dve      = DS.Tables["E"].DefaultView;
                dve.Sort = "ENAME";

                ddlCar.DataSource           = dve;
                ddlEmployees.DataSource     = dve;
                ddlEmployees.DataTextField  = "ENAME";
                ddlEmployees.DataValueField = "ID";
                ddlEmployees.DataBind();
                foreach (ListItem it in ddlEmployees.Items)
                {
                    if (it.Value == DSJ.Tables["J"].Rows[0]["IDEMP"].ToString())
                    {
                        it.Selected = true;
                        break;
                    }
                }

                DA.SelectCommand.CommandText = "select ID,CNAME+': '+ANNOTATION as CNAME from CWM..CARCLASS";
                DS = new DataSet();
                DA.Fill(DS, "C");
                ddlClass.DataSource     = DS.Tables["C"];
                ddlClass.DataTextField  = "CNAME";
                ddlClass.DataValueField = "ID";
                ddlClass.DataBind();
                foreach (ListItem it in ddlClass.Items)
                {
                    if (it.Value == DSJ.Tables["J"].Rows[0]["IDCLASS"].ToString())
                    {
                        it.Selected = true;
                        break;
                    }
                }
                DA.SelectCommand.CommandText = "select ID,CNAME from CWM..CAR where IDCLASS = " + ddlClass.SelectedValue + "  order by CNAME";
                DS = new DataSet();
                DA.Fill(DS, "CAR");
                DataView dv = new DataView();
                dv      = DS.Tables["CAR"].DefaultView;
                dv.Sort = "CNAME";

                ddlCar.DataSource     = dv;
                ddlCar.DataTextField  = "CNAME";
                ddlCar.DataValueField = "ID";
                ddlCar.DataBind();
                foreach (ListItem it in ddlCar.Items)
                {
                    if (it.Value == DSJ.Tables["J"].Rows[0]["IDCAR"].ToString())
                    {
                        it.Selected = true;
                        break;
                    }
                }
                DA.SelectCommand.CommandText = "select ID,PNAME from CWM..PRICELIST where IDCLASS = " + ddlClass.SelectedValue
                                               + " order by PNAME";
                DS = new DataSet();
                DA.Fill(DS, "PRICE");
                chblPrice.DataSource     = DS.Tables["PRICE"];
                chblPrice.DataTextField  = "PNAME";
                chblPrice.DataValueField = "ID";
                chblPrice.DataBind();
                foreach (ListItem it in chblPrice.Items)
                {
                    foreach (DataRow r in DSP.Tables["P"].Rows)
                    {
                        if (it.Value == r["IDPRICE"].ToString())
                        {
                            it.Selected = true;
                        }
                    }
                }
                chblPrice.RepeatColumns = 2;

                /*DA.SelectCommand.CommandText = "select ID,ASNAME from CWM..ADDITIONALSERVICE order by ASNAME";
                 * DS = new DataSet();
                 * DA.Fill(DS, "ADDSERV");
                 * chblAddServ.DataSource = DS.Tables["ADDSERV"];
                 * chblAddServ.DataTextField = "ASNAME";
                 * chblAddServ.DataValueField = "ID";
                 * chblAddServ.DataBind();
                 * foreach (ListItem it in chblAddServ.Items)
                 * {
                 *  foreach (DataRow r in DSPA.Tables["PA"].Rows)
                 *  {
                 *      if (it.Value == r["IDADDSERV"].ToString())
                 *      {
                 *          it.Selected = true;
                 *      }
                 *  }
                 * }
                 * chblAddServ.RepeatColumns = 2;
                 * if (Plus_50 == true)
                 * {
                 *  chbPlus_50.Checked = true;
                 * }
                 * else
                 * {
                 *  chbPlus_50.Checked = false;
                 * }*/
            }
        }
Ejemplo n.º 29
0
 protected void Page_Load(object sender, EventArgs e)
 {
     ScriptManager1.RegisterAsyncPostBackControl(Button1);
 }
Ejemplo n.º 30
0
    protected void Page_Load(object sender, EventArgs e)
    {
        if (Session["New"] == null)
        {
            Response.Redirect("Login.aspx");
        }

        Page.MaintainScrollPositionOnPostBack = true;

        //Register Update Trigger
        ScriptManager1.RegisterAsyncPostBackControl(ButtonInv);


        //Receive data from url
        friendUID = Request.QueryString["fid"].ToString();
        UserID    = Request.QueryString["id"].ToString();

        //Creating SQL Connection
        SqlConnection conn = new SqlConnection(ConfigurationManager.ConnectionStrings["MeetMeConnectionString"].ConnectionString);

        //Get the Friend Name
        SqlDataAdapter sdaFrData = new SqlDataAdapter("select * from Users where UserID='" + friendUID + "'", conn);
        DataTable      dtFrDt    = new DataTable();

        sdaFrData.Fill(dtFrDt);

        friendName = dtFrDt.Rows[0]["fname"].ToString() + " " + dtFrDt.Rows[0]["sname"].ToString();

        //Get Profile Pic Name
        SqlDataAdapter sdaPic = new SqlDataAdapter("select * from ProfilePictures where userId='" + friendUID + "'", conn);
        DataTable      dtPic  = new DataTable();

        sdaPic.Fill(dtPic);

        if (dtPic.Rows.Count != 0)
        {
            profilePictureName = dtPic.Rows[0]["imageName"].ToString();
        }
        else
        {
            profilePictureName = "defaultProfilePicture.png";
        }

        ImageProfilePicture.ImageUrl = "ProfilePictures/" + profilePictureName;

        //Populate the chat screen

        SqlDataAdapter sdaUserData = new SqlDataAdapter("select * from Mesaje where userId='" + UserID + "' and fId='" + friendUID + "'", conn);
        DataTable      dt          = new DataTable();

        sdaUserData.Fill(dt);
        int keyCt = 0;

        foreach (DataRow msgRes in dt.Rows)
        {
            if (msgRes["type"].ToString().Trim() == "SEND")
            {
                messagesScreenID.InnerHtml += "<div class='sendMsg'><p>" + msgRes["messageText"].ToString() + "</p></div><div class='clearArea'></div>";
                keyCt++;
            }
            else
            {
                messagesScreenID.InnerHtml += "<div class='receiveMsg'><p>" + msgRes["messageText"].ToString() + "</p></div><div class='clearArea'></div>";
            }
        }

        suggestionText.InnerText = "There are no Message Suggestions at the moment! You are doing great! Keep it that way!";

        //Retrieve keywords from DB
        SqlDataAdapter userKeyWords = new SqlDataAdapter("select * from Keywords where userId='" + UserID + "' and fId='" + friendUID + "'", conn);
        DataTable      dtKey        = new DataTable();

        userKeyWords.Fill(dtKey);

        //Message Suggestion 1 'Hello!'
        if (keyCt <= 5 && dtKey.Rows[0]["hello"].ToString().Trim() == "no")
        {
            suggestionText.InnerText = "Message Suggestion: Try saying: \"Hello!\"";
        }

        //Message Suggestion 2 'How was/is your day?'
        if ((keyCt > 5 && keyCt <= 15) && dtKey.Rows[0]["day"].ToString().Trim() == "no")
        {
            suggestionText.InnerText = "Message Suggestion: Try saying: \"How was/is your day?\"";
        }

        //Message Suggestion 3 'What hobby do you have?'
        if ((keyCt > 15 && keyCt <= 25) && dtKey.Rows[0]["hobby"].ToString().Trim() == "no")
        {
            suggestionText.InnerText = "Message Suggestion: Try saying: \"What hobby do you have?\"";
        }

        //Message Suggestion 4 'What are you doing for a living?'
        if ((keyCt > 25 && keyCt <= 30) && dtKey.Rows[0]["living"].ToString().Trim() == "no")
        {
            suggestionText.InnerText = "Message Suggestion: Try saying: \"What are you doing for a living?\"";
        }

        //Message Suggestion 5 'What kind of music do you listen to?'
        if ((keyCt > 30 && keyCt <= 40) && dtKey.Rows[0]["music"].ToString().Trim() == "no")
        {
            suggestionText.InnerText = "Message Suggestion: Try saying: \"What kind of music do you listen to?\"";
        }

        //Message Suggestion 6 'What was the last movie you watched?'
        if ((keyCt > 40 && keyCt <= 50) && dtKey.Rows[0]["movies"].ToString().Trim() == "no")
        {
            suggestionText.InnerText = "Message Suggestion: Try saying: \"'What was the last movie you watched?\"";
        }

        //Message Suggestion 7 'Do you like playing games?'
        if ((keyCt > 50 && keyCt <= 60) && dtKey.Rows[0]["games"].ToString().Trim() == "no")
        {
            suggestionText.InnerText = "Message Suggestion: Try saying: \"Do you like playing games?\"";
        }

        //Message Suggestion 8 'What type of food do you like?'
        if ((keyCt > 60 && keyCt <= 70) && dtKey.Rows[0]["food"].ToString().Trim() == "no")
        {
            suggestionText.InnerText = "Message Suggestion: Try saying: \"What type of food do you like?\"";
        }

        //Message Suggestion 9 'Your gallery pictures are beautiful!'
        if ((keyCt > 70 && keyCt <= 80) && dtKey.Rows[0]["pictures"].ToString().Trim() == "no")
        {
            suggestionText.InnerText = "Message Suggestion: Try saying: \"Your gallery pictures are beautiful!\"";
        }

        //Message Suggestion 10 'Let's date in the weekend!'
        if (keyCt > 80 && dtKey.Rows[0]["date"].ToString().Trim() == "no")
        {
            suggestionText.InnerText = "Message Suggestion: Try saying: \"Let's date in the weekend!\"";
        }

        //check for helper option
        SqlDataAdapter userProfDet = new SqlDataAdapter("select * from ProfileDetails where userId='" + UserID + "'", conn);
        DataTable      dtUserOpt   = new DataTable();

        userProfDet.Fill(dtUserOpt);
        if (dtUserOpt.Rows[0]["chat"].ToString().Trim() == "Off")
        {
            SuggestionDiv.Visible = false;
        }
    }