コード例 #1
0
        public static int Login_Save(Entity.Common.Auth auth)
        {
            int rowsAffacted = 0;

            using (SqlConnection con = new SqlConnection(ConfigurationManager.ConnectionStrings["constr"].ToString()))
            {
                using (SqlCommand cmd = new SqlCommand())
                {
                    cmd.Connection  = con;
                    cmd.CommandText = "usp_Login_Save";
                    cmd.CommandType = CommandType.StoredProcedure;
                    cmd.Parameters.AddWithValue("@UserId", auth.UserId);
                    cmd.Parameters.AddWithValue("@IP", auth.IP);
                    cmd.Parameters.AddWithValue("@Status", Enum.GetName(typeof(Entity.Common.LoginStatus), auth.Status));
                    cmd.Parameters.AddWithValue("@Client", auth.Client);
                    cmd.Parameters.AddWithValue("@FailedUserName", auth.FailedUserName);
                    cmd.Parameters.AddWithValue("@FailedPassword", auth.FailedPassword);

                    cmd.CommandType = CommandType.StoredProcedure;
                    if (con.State == ConnectionState.Closed)
                    {
                        con.Open();
                    }
                    rowsAffacted = cmd.ExecuteNonQuery();
                    con.Close();
                }
            }
            return(rowsAffacted);
        }
コード例 #2
0
 public int Login_Save(Entity.Common.Auth auth)
 {
     return(DataAccess.HR.EmployeeMaster.Login_Save(auth));
 }