⭐ 欢迎来到虫虫下载站! | 📦 资源下载 📁 资源专辑 ℹ️ 关于我们
⭐ 虫虫下载站

📄 workplan.aspx.cs

📁 贸易有限公司项目管理系统(C#.NET2003),供学习参考!
💻 CS
字号:
using System;
using System.Data;
using System.Configuration;
using System.Collections;
using System.Web;
using System.Web.Security;
using System.Web.UI;
using System.Web.UI.WebControls;
using System.Web.UI.WebControls.WebParts;
using System.Web.UI.HtmlControls;
using System.Data.SqlClient;
public partial class WorkPlan : System.Web.UI.Page
{
    public static SqlConnection MyConnection;
    public static SqlCommand MyCommand;
    protected void Page_Load(object sender, EventArgs e)
    {
        if (Session["Name"] == null)
        {
            JS.Alert("您还未登陆或登陆超时!");
            Response.Redirect("Default.aspx");
        }
        if ((DateTime.Now.DayOfWeek == System.DayOfWeek.Monday))
        {
            Panel1.Visible = true ;
            Panel2.Visible = false;
           
        }
    }
    protected void btnSubmit_Click(object sender, ImageClickEventArgs e)
    {
        string name=Session["Name"].ToString();
        DateTime time=DateTime.Now;
        string content=txtTask.Text;
        string department = Session["Department"].ToString();
        if(WorkPlan.InsertWorkPlanInfo(name,content,time,"还未完成",department))
        {
            JS.Alert("本周工作计划写入完毕!请按照计划合理安排进度!");
        }
        
        
    }
    public static bool InsertWorkPlanInfo(string s1, string s2, DateTime time,string s3,string s4)
    {
        MyConnection = DB.createCon();
        MyCommand = new SqlCommand("Insert_WorkPlan_Info", MyConnection);
        MyCommand.CommandType = CommandType.StoredProcedure;

        SqlParameter Emp_Name = new SqlParameter("@Emp_Name", SqlDbType.VarChar);
        Emp_Name.Value = s1;
        MyCommand.Parameters.Add(Emp_Name);

        SqlParameter Task_Content = new SqlParameter("@Task_Content", SqlDbType.VarChar);
        Task_Content.Value = s2;
        MyCommand.Parameters.Add(Task_Content);

        SqlParameter Start_Time = new SqlParameter("@Start_Time", SqlDbType.DateTime);
        Start_Time.Value = time;
        MyCommand.Parameters.Add(Start_Time);

        SqlParameter Status = new SqlParameter("@Status", SqlDbType.VarChar);
        Status.Value = s3;
        MyCommand.Parameters.Add(Status);

        SqlParameter Department = new SqlParameter("@Dep_Name", SqlDbType.VarChar);
        Department.Value = s4;
        MyCommand.Parameters.Add(Department);

        MyConnection.Open();
        int result;
        result = MyCommand.ExecuteNonQuery();
        MyConnection.Close();
        if (result > 0)
        {
            return true;
        }
        else
        {
            return false;
        }
    }
}

⌨️ 快捷键说明

复制代码 Ctrl + C
搜索代码 Ctrl + F
全屏模式 F11
切换主题 Ctrl + Shift + D
显示快捷键 ?
增大字号 Ctrl + =
减小字号 Ctrl + -